get_layers_by_spatial: Retrieve ArcGIS REST API spatial layer by spatial query

get_layers_by_spatialR Documentation

Retrieve ArcGIS REST API spatial layer by spatial query

Description

These functions are wrappers around get_spatial_layer that are specialized for querying by a spatial layer. They will make a POST request to the query URL which returns data (if available) based on the appropriate spatial feature (geometry) and relationship (sp_rel).

Usage

get_layer_by_poly(url, geometry, sp_rel = "intersects", clip_layer = TRUE, ...)

get_layer_by_line(url, geometry, sp_rel = "intersects", ...)

get_layer_by_point(url, geometry, sp_rel = "intersects", ...)

get_layer_by_multipoint(url, geometry, sp_rel = "intersects", ...)

get_layer_by_envelope(url, geometry, sp_rel = "intersects", ...)

get_layer_by_spatial(
  url,
  geometry,
  geom_type,
  sp_ref = NULL,
  sp_rel = "intersects",
  ...
)

Arguments

url

A character string of the url for the layer to pull

geometry

An sf object used for the spatial query

sp_rel

Character. The type of relationship to query by. Possible options include "intersects", "contains", and "crosses"

clip_layer

Logical. Currently only available for get_layer_by_poly. Should the polygon be "clipped" to what is in geometry using st_intersection (TRUE, default) or not (FALSE)

...

Additional arguments to pass to get_spatial_layer

geom_type

A character of the geometry type to be used. This param is automatically specified in all get_layer_by_* functions except get_spatial_layer

sp_ref

The spatial reference value

Value

An object of class "sf" of the appropriate layer

Examples

## Not run: 
  mke_waters <- get_layer_by_poly(wi_hydro_url, mke_county)

## End(Not run)

arcpullr documentation built on June 3, 2026, 9:07 a.m.