Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: adding optional location and buffer dist parameters to esri2sf #46

Open
elipousson opened this issue Feb 16, 2022 · 1 comment

Comments

@elipousson
Copy link
Contributor

I use the bbox parameter of esri2sf all the time but I just wrote a get_esri_data() helper function that wraps esri2sf in my new {overedge} package and realized that it may make sense to pull one of the features into the main package.

Drawing on the example of the mapboxapi package, I set up the function so it can accept an sf object (as well as a bounding box) and then apply a buffer before creating the bounding box to pass into the query. But, the ArcGIS FeatureServer query API actually supports a distance parameter in combination with the data passed to geometry as a spatial filter. Ideally, implementing a location parameter could also include:

  • Support for point as well as polygon sf data
  • Access to the spatial relation options for spatial filtering. Those include: "esriSpatialRelIntersects | esriSpatialRelContains | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin"
  • Support for setting the units of the distance buffer

I'm currently doing all of this without the API using a wrapper function for sf_buffer but I'm assuming it may be faster for all that processing to take place on the server side. Happy to start working on this once the URL validation branch gets incorporated back into the package.

@elipousson
Copy link
Contributor Author

I made some progress on this by adding support for the spatial relation parameter to my fork of esri2sf and added support for POINT geometry (which works with the "esriGeometryPoint" geometry type).

If anyone is interested in expanding support for other geometry types, I think the new sf2geometry function is the place to add that functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant