query_layer: Query Layer

View source: R/query_layer.R

query_layerR Documentation

Query Layer

Description

Query a layer on an arcgis server

Usage

query_layer(
  endpoint,
  in_geometry = NULL,
  spatial_filter = "intersects",
  return_geometry = TRUE,
  where = NULL,
  out_fields = c("*"),
  return_n = NULL,
  geometry_precision = NULL,
  query = list(),
  crs = 4326,
  my_token = NULL,
  cache = NULL
)

Arguments

endpoint

a string defining the enpoint url. It can be generated by the feature_server_endpoint and map_server_endpoint functons. See https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm

in_geometry

the geometry to use when applying a spatial filter to the layer. This should be an sf object with only one geometry. If you want to query with multiple geometries, the best practice is to use sf::st_union() to combine them. Bounding boxes are accepted by this argument and are the fastest.

spatial_filter

The type of spatial filter. Defaults to intersection (intersects). Options are: intersects, contains, crosses, envelope_intersects, index_intersects, overlaps, touches, within

return_geometry

should the geometry be returned or just a table?

where

an optional SQL where query formatted as a single string. See the documentation for what is accepted

out_fields

the fields of the layer to return (character vector)

return_n

how many features (maximum) should be returned by the query?

geometry_precision

The number of decimal places in the response geometries returned by the query operation

query

a named vector of parameters to include in the query

crs

the output crs, defaulting to 4326

my_token

an access token acquired via get_token

cache

either: TRUE to use default caching (in the cache directory set with set_cache_directory()); a path to an alternative cache location or NULL for no caching (default)

Value

an sf object


MatthewJWhittle/getarc documentation built on April 22, 2023, 12:16 p.m.