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

Bring back st_is_within_distance? #419

Closed
karldw opened this issue Jul 15, 2017 · 2 comments
Closed

Bring back st_is_within_distance? #419

karldw opened this issue Jul 15, 2017 · 2 comments

Comments

@karldw
Copy link
Contributor

karldw commented Jul 15, 2017

The st_is_within_distance function was removed in commit 587cbc7 because of changes in the GEOS C API. Would it be possible to bring it back?
From some naïve Googling, it seems like GEOS still includes a function to answer the question "is x within some distance of y?"

If you'd rather not reimplement st_is_within_distance, I can do a quick PR to remove the reference to it from vignette 1.

@edzer
Copy link
Member

edzer commented Jul 15, 2017

The GEOS C API did not change, but sf changed from using the C++ API to using the C API from GEOS, which does not offer this. Using the C++ API caused a lot of portability troubles on WIndows and Mac osx.

Yes, PR welcome!

@edzer edzer closed this as completed in 0087f38 Jul 16, 2017
@edzer
Copy link
Member

edzer commented Jul 16, 2017

I decided to bring st_is_within_distance back to sf, but for sparse matrices only. If you can hold dense matrices, you could already do

st_distance(x, y) <= dist

to obtain the dense logical matrix; in case the dense matrix is too large to hold in memory, st_is_within_distance now returns you the sparse representation.

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

2 participants