landfireAPIv2 {rlandfire} | R Documentation |
Call the LANDFIRE Product Service (LFPS) API
Description
landfireAPIv2
downloads LANDFIRE data by calling the LFPS API
Usage
landfireAPIv2(
products,
aoi,
email,
projection = NULL,
resolution = NULL,
edit_rule = NULL,
edit_mask = NULL,
priority_code = NULL,
path = NULL,
max_time = 10000,
method = "curl",
verbose = TRUE,
background = FALSE
)
Arguments
products |
Product names as character vector (see: Products Table) |
aoi |
Area of interest as character or numeric vector defined by
latitude and longitude in decimal degrees in WGS84 and ordered
|
email |
Email address as character string. This is a required argument
for the LFPS v2 API. See the LFPS Guide
for more information. Outside of the LFPS API request, this email address
is not used for any other purpose, stored, or shared by |
projection |
Optional. A numeric value of the WKID for the output projection Default is a localized Albers projection. |
resolution |
Optional. A numeric value between 30-9999 specifying the resample resolution in meters. Default is 30m. |
edit_rule |
Optional. A list of character vectors ordered "operator class" "product", "operator", "value" where "operator class" is one of "condition", "ORcondition", or "change". Edits are limited to fuel theme products only. (see: LFPS Guide) |
edit_mask |
Optional. Path to a compressed shapefile (.zip) to be used as an edit mask. The shapefile must be less than 1MB in size and must comply with ESRI shapefile naming rules. |
priority_code |
Optional. Priority code for wildland fire systems/users. Contact the LANDFIRE help desk for information (helpdesk@landfire.gov) |
path |
Path to |
max_time |
Maximum time, in seconds, to wait for job to be completed. |
method |
Passed to |
verbose |
If FALSE suppress all status messages |
background |
If TRUE, the function will return immediately and the job
will run in the background. User will need to check the status of the job
manually with |
Value
Returns a landfire_api
object with named elements:
-
request
- list with elementsquery
,date
,url
,job_id
,request
,dwl_url
-
content
- Informative messages passed from API -
response
- Full response -
status
- Final API status, one of "Failed", "Succeeded", or "Timed out" -
time
- time of job completion -
path
- path to save directory
Examples
## Not run:
products <- c("ASP2020", "ELEV2020", "230CC")
aoi <- c("-123.7835", "41.7534", "-123.6352", "41.8042")
email <- "email@example.com"
projection <- 6414
resolution <- 90
edit_rule <- list(c("condition","ELEV2020","lt",500),
c("change", "230CC", "st", 181))
save_file <- tempfile(fileext = ".zip")
resp <- landfireAPIv2(products, aoi, email, projection,
resolution, edit_rule = edit_rule,
path = save_file)
## End(Not run)