Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Proximity to polygon edge #35

Open
lukepighetti opened this issue Jan 1, 2021 · 1 comment
Open

Proximity to polygon edge #35

lukepighetti opened this issue Jan 1, 2021 · 1 comment

Comments

@lukepighetti
Copy link

lukepighetti commented Jan 1, 2021

I'd like to be able to query the two closest polygon edges to a single point. Any ideas?

Use case: tell the user which country border they are closest to. "You are 15km from the France/Germany border!"

@synw
Copy link
Owner

synw commented Jan 1, 2021

An idea: if you have the polygon's centroids your could get the closest polygons with a cheap points distance calculation ( https://github.com/wingkwong/geodesy#distancebetweentwogeopointslatlng-l1-latlng-l2-num-radius ). Then you can get the closest point in these polygons

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

No branches or pull requests

2 participants