sodascience / osmenrich

Enrich sf data with geographic features from OpenStreetMaps.
https://sodascience.github.io/osmenrich/
MIT License
15 stars 3 forks source link

Optimize distances #41

Open jgarciab opened 2 years ago

jgarciab commented 2 years ago

Code optimized to find the potential neighbors within a radius using KD-trees (from the dbscan library, a new dependency), instead of calculating distances to all possible neighbors using sf (slow). Those distances can be used directly passing the argument exact_distances = FALSE.