[X] documentation updated with devtools::document()
[X] devtools::check() passes locally
Changes
Implement modifications to the handling of the filter_geom parameter by arc_select() (based on the approach initially included in this draft PR: ) including:
Add filter_geom_as_sfg() helper function to simplify logic of filter_geom processing
Use sf::st_concave_hull to convert input geometry to POLYGON if the data sf::st_union() does not yield a single filter geometry
Add warning if a sfc input with length > 1 slips through (instead of getting silently dropped)
Add a warning and return a NULL value if a sfc input filter has empty geometry (no issue for this bug but it popped up while testing)
Adds more comprehensive tests for the filter_geom functionality
If there is a vignette added in the future with more details on how arc_select() works with filter_geom the edge cases for input handling could be described in more detail. Alternatively, this could be further refactored to handle MULTIPOLYGON geometries by breaking them up into multiple requests where each POLYGON element is used as a separate spatial filter but this seemed like too much complexity to resolve the issue at this time.
Checklist
devtools::document()
devtools::check()
passes locallyChanges
Implement modifications to the handling of the
filter_geom
parameter byarc_select()
(based on the approach initially included in this draft PR: ) including:filter_geom_as_sfg()
helper function to simplify logic of filter_geom processingsf::st_concave_hull
to convert input geometry to POLYGON if the datasf::st_union()
does not yield a single filter geometryIssues that this closes
https://github.com/R-ArcGIS/arcgislayers/issues/166
Follow up tasks
If there is a vignette added in the future with more details on how
arc_select()
works withfilter_geom
the edge cases for input handling could be described in more detail. Alternatively, this could be further refactored to handle MULTIPOLYGON geometries by breaking them up into multiple requests where each POLYGON element is used as a separate spatial filter but this seemed like too much complexity to resolve the issue at this time.