| prepare_spatial_filter {arcgislayers} | R Documentation |
Prepare JSON for use as a spatial filter based on feature geometry or bounding box input
Description
prepare_spatial_filter() prepares a named list with ESRI JSON geometry for
use as a spatial filter based on a a sfc, sfg, or bbox input object.
match_spatial_rel() takes a scalar character vector with a predicate name
to a type of ESRI spatial relation.
Usage
prepare_spatial_filter(
filter_geom,
crs,
predicate,
error_call = rlang::caller_env()
)
match_spatial_rel(predicate, error_call = rlang::caller_env())
Arguments
filter_geom |
an object of class |
crs |
a representation of a coordinate reference system. |
predicate |
Spatial predicate to use with |
error_call |
default |
Details
Using sfc objects as filter_geom
If an sfc object is provided it will be transformed to the layers spatial
reference. If the sfc is missing a CRS (or is an sfg object) it is
assumed to use the same spatial reference as the FeatureLayer. If the sfc
object has multiple features, the features are unioned with
sf::st_union(). If an sfc object has MULTIPOLYGON geometry, the features
are unioned before being cast to POLYGON geometry with sf::st_cast(). All
geometries are checked for validity before conversion.
Value
prepare_spatial_filter() returns a named list with the
geometryType, geometry (as Esri JSON), and spatial relation predicate.
match_spatial_rel() returns one of the following spatial binary predicates:
esriSpatialRelIntersects
esriSpatialRelContains
esriSpatialRelCrosses
esriSpatialRelOverlaps
esriSpatialRelTouches
esriSpatialRelWithin
Examples
prepare_spatial_filter(sf::st_point(c(0, 5)), 4326, "intersects")