get_layer {arcgislayers} | R Documentation |
Extract a layer from a Feature or Map Server
Description
These helpers provide easy access to the layers contained in a
FeatureServer
or MapServer
.
Usage
get_layer(x, id = NULL, name = NULL, token = arc_token())
get_all_layers(x, token = arc_token())
get_layers(x, id = NULL, name = NULL, token = arc_token())
Arguments
x |
an object of class |
id |
default |
name |
default |
token |
your authorization token. |
Details
The id
and name
arguments must match the field values of the respective names as seen in the output of list_items()
Value
-
get_layer()
returns a singleFeatureLayer
orTable
based on its ID -
get_layers()
returns a list of the items specified by theid
orname
argument -
get_all_layers()
returns a namedlist
with an elementlayers
andtables
. Each a list containingFeatureLayer
andTable
s respectively.
Examples
## Not run:
# FeatureServer
furl <- paste0(
"https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/",
"PLACES_LocalData_for_BetterHealth/FeatureServer"
)
fserv <- arc_open(furl)
fserv
get_layer(fserv, 0)
get_layers(fserv, name = c("Tracts", "ZCTAs"))
get_all_layers(fserv)
## End(Not run)