agol_filter | R Documentation |
This function uses the arcgislayers package, which has has had compatibility issues for several commonly used platforms. It is mainly here for historical reasons.
agol_filter(url, layer_name = NULL, geom, simplify = TRUE)
url |
the url of the remote resource. Must be of length one. |
layer_name |
the name(s) associated with the layer you want
to retrieve. Can be a character vector. If |
geom |
an object of class |
simplify |
when only one layer exists, just return the |
An sf
object, or a data.frame
, or a list of these objects if
layer_name == NULL
or if length(layer_name) > 1
. Missing layers return
"NULL".
## Not run:
# Get a single layer
agol_filter(
url = "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer/",
layer_name = "WBDHU12",
geom = FedData::meve
)
# Can be returned as a list
agol_filter(
url = "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer/",
layer_name = "WBDHU12",
geom = FedData::meve,
simplify = FALSE
)
# Get a list with all layers
agol_filter(
url = "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer/",
geom = FedData::meve
)
# Or include a vector of layer names
# Note that missing layers are returned as `NULL` values
agol_filter(
url = "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer/",
layer_name = c(
"NHDPoint",
"NetworkNHDFlowline",
"NonNetworkNHDFlowline",
"NHDLine",
"NHDArea",
"NHDWaterbody"
),
geom = FedData::meve
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.