View source: R/rs_build_task.R
rs_build_task | R Documentation |
Builds a valid JSON formatted API request from either a tidy data frame with point based sub-tasks, or when a region of interest (roi) is specified coordinates (latitude/longitude) will be ignored and a bounding box for an sf or SpatRaster object will be used instead.
rs_build_task(df, roi, format = "geotiff")
df |
a data frame with task name (task), subtask name (subtask), latitude, longitude, start (start) and end (end) date. |
roi |
a region of interest defined by a SpatRaster or sf object, the roi will override any point based data provided as latittude-longitude coordinates in the data frame |
format |
file format of the downloaded data either geotiff (the default) or netcdf4 |
a valid AppEEARS JSON formatted task
# define a task as a tidy data frame
# multiple subtasks can be provided
df <- data.frame(
task = "task_name",
subtask = c("sub_task"),
latitude = c(36.206228),
longitude = c(-112.127134),
start = c("2018-01-01"),
end = c("2018-01-15"),
product = c("MCD12Q2.006"),
layer = c("Greenup")
)
# build a task
rs_build_task(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.