View source: R/get_rap_16day.R
| get_rap_production16day_table | R Documentation |
Retrieves remotely sensed production estimates from the Rangeland Analysis
Platform (RAP) using the production16dayV3 API endpoint. This function
supports querying one or more spatial features (points, lines, or polygons)
provided as a terra SpatVector in WGS84 longitude latitude
("EPSG:4326").
get_rap_production16day_table(
aoi,
year = NULL,
mask = TRUE,
nodata_flag = NA_real_
)
aoi |
Area of Interest. A |
year |
integer. Optional. Numeric year or vector of years (1986 to last
full year). Default: |
mask |
logical. Exclude cropland, development, and water? Default:
|
nodata_flag |
numeric. Value to use for missing data. The API encodes
"NODATA" as |
For each feature - year combination, a separate request is made to the RAP
API, and results are returned as a combined data.frame. In the special case
of year=NULL) default all available years are returned in a single query.
For more information on the API and data products, see the RAP API documentation: https://rangelands.app/support/71-api-documentation
A data.frame with 16-day production data including the following
columns: "date" (production estimate date), "year" (production estimate
year), "doy" (production estimate Julian day of year), "AFG" (Annual
Forb and Grass production), "PFG" (Perennial Forb and Grass production),
"HER" (Herbaceous production), "feature" (feature ID, row number from
aoi)
aoi <- terra::vect(data.frame(x = -119.72330, y = 36.92204),
geom = c('x', 'y'),
crs = "EPSG:4326")
# all years (year=NULL)
res <- get_rap_production16day_table(aoi)
str(res)
# specific year
res <- get_rap_production16day_table(aoi, year = 1992)
str(res)
# multiple specific years
res <- get_rap_production16day_table(aoi, year = 1993:2003)
str(res)
# 1 kilometer buffer around point
res <- get_rap_production16day_table(terra::buffer(aoi, 1000), year = 2004)
str(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.