Skip to contents

Pulls attribute records from an ArcGIS REST layer, paginating through the server transfer limit automatically (ArcGIS caps a single query at maxRecordCount features, typically 1000-2000).

Usage

morie_fetch_arcgis(
  layer_url,
  where = "1=1",
  out_fields = "*",
  params = NULL,
  page_size = 2000L,
  max_records = Inf
)

Arguments

layer_url

The layer URL, ending in /FeatureServer/<n> or /MapServer/<n>.

where

SQL-style WHERE filter (default "1=1", all rows).

out_fields

Comma-separated field list (default "*").

params

Optional named list of extra query parameters.

page_size

Records requested per page (default 2000).

max_records

Cap on the total number of records (default Inf – fetch the whole layer).

Value

A data.frame of feature attributes (geometry is dropped).

See also

Examples

if (FALSE) { # \dontrun{
layer <- paste0(
  "https://services.arcgis.com/ORG/arcgis/rest/",
  "services/Assault/FeatureServer/0"
)
df <- morie_fetch_arcgis(layer)
} # }