API Documentation
RAP data can be accessed from a client application or script using the public Application Programming Interface (API) described below. This API provides access to both map tiles and geoJSON time series data.
Time Series
Time series endpoints can be used to request mean cover, annual production, or 16-day production data for an area of interest (AOI).
A geoJSON object should be used to specify the AOI in units of latitude and longitude (EPSG:4326). Point, Polygon, and LineString geometries are all accepted (see examples below). The geoJSON object should be sent in the body of the POST request.
Specify whether or not to exclude cropland, development, and water using the "mask" property of the geoJSON object.
Specify which year of data should be returned using the "year" property of the geoJSON object. Valid years are 1986 through the previous year. All years are returned if none is specified.
View examples of accessing time series data using R and Python.
POST coverV3
Returns a time series of fractional cover data for the specified AOI and year(s). AFG = annual forb and grass. PFG = perennial forb and grass. SHR = shrub. TRE = tree. LTR = litter. BGR = bare ground.
Example Request
https://us-central1-rap-data-365417.cloudfunctions.net/coverV3
Example Response
{ "type": "Feature", "geometry": { //... }, "properties": { "cover": [ [ "year", "AFG", "PFG", "SHR", "TRE", "LTR", "BGR" ], [ 1986, 21.776763447380944, 29.96920831813192, 9.364111323995871, 0.42612040368116144, 8.467131684428939, 27.473813636923555 ], [ 1987, 15.666614156867306, 37.15455518481902, 10.229329461138262, 0.5328141950416888, 9.217932740745704, 22.629679794921763 ], //... ] "mask": true } }
POST coverMeteorologyV3
Returns a time series of fractional cover and meteorological data for the specified AOI and year(s). AFG = annual forb and grass. PFG = perennial forb and grass. SHR = shrub. TRE = tree. LTR = litter. BGR = bare ground. AnnualTemp = Annual average temperature in degrees Fahrenheit. AnnualPrecip = Annual total precipitation in inches.
Example Request
https://us-central1-rap-data-365417.cloudfunctions.net/coverMeteorologyV3
Example Response
{ "type": "Feature", "geometry": { //... }, "properties": { "cover": [ [ "year", "AFG", "PFG", "SHR", "TRE", "LTR", "BGR", "annualTemp", "annualPrecip" ], [ 1986, 21.315278997230887, 30.069286799481272, 9.469778213003998, 0.42686149631367476, 8.38786711970053, 27.83561127994594, 46.512537613481456, 15.569844612853016 ], [ 1987, 15.121336999648433, 37.37263677202248, 10.348649022645368, 0.5519896895734215, 9.111712199080294, 22.8638559857512, 47.22724422579757, 14.395731266447926 ], //... ] "mask": true } }
POST productionV3
Returns a time series of annual above-ground production data for the specified AOI and year(s). AFG = annual forb and grass. PFG = perennial forb and grass. HER = total herbaceous. Estimates are provided in United States customary units (lbs/acre).
Example Request
https://us-central1-rap-data-365417.cloudfunctions.net/productionV3
Example Response
{ "type": "Feature", "geometry": { //... }, "properties": { "mask": true, "production": [ [ "year", "AFG", "PFG", "HER" ], [ 1986, 163.52025723692677, 368.6485872720137, 529.5783699635925 ], [ 1987, 167.07643845644452, 636.4623500768087, 799.3028522723472 ], //... ] } }
POST production16dayV3
Returns a time series of 16-day above-ground production data for the specified AOI and year(s). Data for all 16-day intervals of a given are returned (a total of 23 intervals per year). AFG = annual forb and grass. PFG = perennial forb and grass. HER = total herbaceous. Estimates are provided in United States customary units (lbs/acre).
Example Request
https://us-central1-rap-data-365417.cloudfunctions.net/production16dayV3
Example Response
{ "type": "Feature", "geometry": { //... }, "properties": { "mask": true, "production16day": [ [ "date", "year", "doy", "AFG", "PFG", "HER" ], [ "1986-01-16", 1986, 16, 0, 0, 0 ], [ "1986-02-01", 1986, 32, 0, 0, 0 ], //... [ "1987-01-16", 1987, 16, 0.01919215518733891, 0.1986059561763264, 0.21779811136366525 ], [ "1987-02-01", 1987, 32, 0.25862509935687933, 0.09033161499494316, 0.3489567143518222 ] //... ] } }
Example Polygon AOI
{ "type":"Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -106.41602428606434, 44.08657769114205 ], [ -106.15784557512684, 44.228451650352675 ], [ -106.14685924700184, 44.47199042169604 ], [ -106.32813366106434, 44.417086251829154 ], [ -106.38855846575184, 44.31891474827157 ], [ -106.45447643450184, 44.193015141103366 ], [ -106.41602428606434, 44.08657769114205 ] ] ] }, "properties": { "mask":true, "year": null } }
Example Point AOI
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -108.26713899038693, 47.92371000909408 ] }, "properties": { "mask": true, "year": null } }
Example LineString AOI
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ [ -105.9960953173008, 46.383007488312415 ], [ -105.4687515673008, 46.048524085719926 ], [ -104.08300973742867, 46.26161334458482 ] ] }, "properties": { "mask": true, "year": null } }
Map Tiles
Map tile endpoints can be used to request cover and production tiles to display on an interactive web map.
GET usda-rap-tiles-cover-v3/masked/{vegetation-type}/{year}/{z}/{x}/{y}.png
Returns a map tile of fractional cover for the specified vegetation type and year, excluding cropland, development, and water. Vegetation type must be one of afg (annual forb and grass), pfg (perennial forb and grass), shr (shrub), tre (tree), or bgr (bare ground). Year can be any year from 1986 to the previous year, inclusive.
Leaflet Example
L.tileLayer('https://storage.googleapis.com/usda-rap-tiles-cover-v3/masked/pfg/2011/{z}/{x}/{y}.png', { maxZoom: 12, //RAP tiles are not available at higher zoom levels attribution: '<a href="https://rangelands.app/">Rangeland Analysis Platform</a>, USDA Agricultural Research Service' }).addTo(yourMap);
Google Maps Example
yourMap.mapTypes.set("RAP", new google.maps.ImageMapType({ getTileUrl: function(coord, zoom) { return "https://storage.googleapis.com/usda-rap-tiles-cover-v3/masked/pfg/2011/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "RAP", maxZoom: 12 //RAP tiles are not available at higher zoom levels }));
GET usda-rap-tiles-cover-v3/unmasked/{vegetation-type}/{year}//{z}/{x}/{y}.png
Returns a map tile of fractional cover for the specified vegetation type and year, including cropland, development, and water. Vegetation type must be one of afg (annual forb and grass), pfg (perennial forb and grass), shr (shrub), tre (tree), or bgr (bare ground). Year can be any year from 1986 to the previous year, inclusive.
Leaflet Example
L.tileLayer('https://storage.googleapis.com/usda-rap-tiles-cover-v3/unmasked/pfg/2011/{z}/{x}/{y}.png', { maxZoom: 12, //RAP tiles are not available at higher zoom levels attribution: '<a href="https://rangelands.app/">Rangeland Analysis Platform</a>, USDA Agricultural Research Service' }).addTo(yourMap);
Google Maps Example
yourMap.mapTypes.set("RAP", new google.maps.ImageMapType({ getTileUrl: function(coord, zoom) { return "https://storage.googleapis.com/usda-rap-tiles-cover-v3/unmasked/pfg/2011/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "RAP", maxZoom: 12 //RAP tiles are not available at higher zoom levels }));
GET usda-rap-tiles-biomass-v3/masked/{vegetation-type}/{year}/{z}/{x}/{y}.png
Returns a map tile of annual above-ground production for the specified vegetation type and year, excluding cropland, development, and water. Vegetation type must be one of afg (annual forb and grass), pfg (perennial forb and grass), or herbaceous (total herbaceous). Year can be any year from 1986 to the previous year, inclusive. Estimates are provided in United States customary units (lbs/acre).
Leaflet Example
L.tileLayer('https://storage.googleapis.com/usda-rap-tiles-biomass-v3/masked/pfg/2011/{z}/{x}/{y}.png', { maxZoom: 12, //RAP tiles are not available at higher zoom levels attribution: '<a href="https://rangelands.app/">Rangeland Analysis Platform</a>, USDA Agricultural Research Service' }).addTo(yourMap);
Google Maps Example
yourMap.mapTypes.set("RAP", new google.maps.ImageMapType({ getTileUrl: function(coord, zoom) { return "https://storage.googleapis.com/usda-rap-tiles-biomass-v3/masked/pfg/2011/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "RAP", maxZoom: 12 //RAP tiles are not available at higher zoom levels }));
GET usda-rap-tiles-biomass-v3/unmasked/{vegetation-type}/{year}/{z}/{x}/{y}.png
Returns a map tile of annual above-ground production for the specified vegetation type and year, including cropland, development, and water. Vegetation type must be one of afg (annual forb and grass), pfg (perennial forb and grass), or herbaceous (total herbaceous). Year can be any year from 1986 to the previous year, inclusive. Estimates are provided in United States customary units (lbs/acre).
Leaflet Example
L.tileLayer('https://storage.googleapis.com/usda-rap-tiles-biomass-v3/unmasked/pfg/2011/{z}/{x}/{y}.png', { maxZoom: 12, //RAP tiles are not available at higher zoom levels attribution: '<a href="https://rangelands.app/">Rangeland Analysis Platform</a>, USDA Agricultural Research Service' }).addTo(yourMap);
Google Maps Example
yourMap.mapTypes.set("RAP", new google.maps.ImageMapType({ getTileUrl: function(coord, zoom) { return "https://storage.googleapis.com/usda-rap-tiles-biomass-v3/unmasked/pfg/2011/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; }, tileSize: new google.maps.Size(256, 256), name: "RAP", maxZoom: 12 //RAP tiles are not available at higher zoom levels }));