This post introduces the new FAOSTAT Data Downloader plugin for QGIS. This tool is based on the official FAOSTAT API and allows users to fetch data from the biggest database for agriculture statistics data and create thematic maps using QGIS. The image below shows an example of what can be done with this plugin.
According to Wikipedia:
The FAOSTAT system is one of FAO’s most important corporate systems. It is a major component of FAO’s information systems, contributing to the organization’s strategic objective of collecting, analyzing, interpreting, and disseminating information relating to nutrition, food and agriculture for development and the fight against global hunger and malnutrition.
The FAOSTAT database contains agriculture and food security timeseries from 1961 to 2014 in English, Spain and French. Data can be downloaded through the web-site or can be accessed in a more programmatic way through the API.
QGIS is an open source GIS tool that can be downloaded for free from the project’s web-site. The plugins are one of the most interesting features of QGIS. Developers can design and implement their own tools and make them available to the community through the plugins repository. To install QGIS, please follow the installation guide. Plugins can be discovered and installed straight from the QGIS user interface. Please refer to this guide for further instructions.
The FAOSTAT Data Downloader plugin for QGIS
This plugins is a wrapper for the FAOSTAT API that provides an access to agriculture statistics within QGIS in order to create maps taking advantage of the existing QGIS tools. To install the plugin go to the Plugins menu item and open Manage and Install Plugins…. Then search for FAOSTAT and install the plugin. When the installation is complete you should find a new icon in the toolbar, or you can access it from Plugins > Download Data > FAOSTAT Data Downloader. The plugin looks something like this:
The user interface follows the structure of the FAOSTAT database. The user is required to select a Group (e.g. Production) and then a Domain (e.g. Crops). To complete the selection we also need to select an Element (e.g. Production Quantity) and then an Item (e.g. Wheat). Once the download folder has been selected as well, it is possible to start the download.
The plugin will create a vector layer containing, in its attributes table, a column for each available year. The layer will be stored in a sub-folder that reflects the FAOSTAT structure. In our example, the layer will be store in [DOWNLOAD_FOLDER]/Q/QC, being Q the code for the Production group, and QC the code for the Crops domain.
When the Add output layer to canvas is selected, the output layer will be added to the current map. By default, values are divided using the Pretty breaks with the PuBu gradient.
The map in the Introduction has been created with the following parameters: Emissions – Agriculture as the group, Enteric Fermentation as the domain, Emissions (CO2Eq) as the element and Sheep as the item. The default output of the plugin is the following:
The plugin has a GPL2 license and its source code is available on GitHub. It is also possible to contribute to the translation through the project on Transifex. The plugin is already available in English, Italian and Portuguese, but Spanish and French translators are more than welcome! You can also donate to this open source project via Pledgie at this link.