GAEZ v4 data is available via an online Image Service server. Querying a certain URL, properly composed, serves a raster image to the user for download. The corresponding base URLs are available in the first table of the Data Access page of GAEZ.

gaez_download(
  cropcode,
  variable = "yl",
  input = "H",
  irrigation = "r",
  co2 = "",
  scenario = c("CRUTS32", "Hist", "8110"),
  dir = ".",
  res = "res05/"
)

Arguments

cropcode

string one code from data(crops)

variable

string variable name

input

string "H" or "L"

irrigation

string code from irrigation()

co2

string "" for CO2 fertilization (the default) or "0" without (not available for historical climate)

scenario

vector of string with 3 elements: Climate Model, Climate Scenario, Time period.

dir

path to folder where GAEZ data will be stored. Default .

res

string indicating the GAEZ theme (e.g. "05" corresponds to Theme 4, Suitability and Attainable Yield)

Details

This function composes a URL string and sends the query to the server. For example, one can download GAEZ data for a certain GAEZ theme, a given crop, input and irrigation settings for a certain scenario into a corresponding folder on disk. This function is helpful for Crop Yield Data. The simplest way to compose an URL is to use the GAEZ data viewer, following the steps below. The viewer looks like this: GAEZ v4 Data Viewer

  1. choose appropriate theme on top

  2. Choose a variable (if known-else leave blank for default choice): not all variables are available in all combinations

  3. Choose Time period (or leave blank)

  4. Choose Climate Model. available via climate_models()

  5. Choose RCP scenario (only if making extrapolation to the future): available via rcps()

  6. Choose a crop. via data(crops)

  7. Choose Water Supply. codes in irrigation()

  8. Choose an input level (high or low)

  9. Choose with or without CO2 fertilizer

The image on the right of the dropdown menus is your current raster, which can be downloaded. You will notice that not all data is available in all parts of the world.

How To Get the URL String

In the data viewer, zoom into a region of interest and click on an arbitrary pixel, as illustrated here: GAEZ v4 Pixel Selector

In the appearing popup menu, right click on link download this raster. It will have a form like https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res05/CRUTS32/Hist/6190H/ycHr0_whe.tif, which composes as follows:

  • Base url: https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org

  • GAEZ theme: res05

  • Climate Model: CRUTS32

  • Climate Scenario: Hist for past, one of several RCP scenarios for future.

  • Time Period: 6190H stands for 1961 thru 1990 Historical

  • The Variable name: ycHr0_whe.tif

    • yc stands for Average attainable yield of current cropland. Other values in Theme 4 are for example yl (Output Density (potential production divided by total grid cell area)) or yx (Average attainable yield of best occurring suitability class in grid cell)

    • H is the choice of input level (High or Low)

    • r whether rainfed (see irrigation())

    • 0 whether there is CO2 fertilization.

    • whe is the crop code from data(crops).

Christophe Gouel wrote the core of this function. Florian Oswald rearranged and wrote the supporting documentation.

Examples

gaez_download("whe")