Retrieve ArcGIS REST API spatial layer by spatial query
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 (
get_layer_by_poly(url, geometry, sp_rel = "contains", ...) 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", ... )
A character string of the url for the layer to pull
sfobject used for the spatial query
Character. The type of relationship to query by. Possible options include "intersects", "contains", and "crosses"
Additional arguements to pass to
A character of the geometry type to be used. This param is automatically specified in all
The spatial reference value
base_wdnr_url <- "https://dnrmaps.wi.gov/arcgis/rest/services/" hydro_path <- "WT_SWDV/WT_Inland_Water_Resources_WTM_Ext_v2/MapServer/2" hydro_url <- paste0(base_wdnr_url, hydro_path) mke_waters <- get_layer_by_poly(url = hydro_url, mke_county) #> Warning: GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order.