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 FeatureServer or MapServer

id

default NULL. A numeric vector of unique ID of the layer you want to retrieve. This is a scalar in get_layer().

name

default NULL. The name associated with the layer you want to retrieve. name is mutually exclusive with id. This is a scalar in get_layer().

token

your authorization token.

Details

[Experimental]

The id and name arguments must match the field values of the respective names as seen in the output of list_items()

Value

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)

[Package arcgislayers version 0.3.0 Index]