-
Notifications
You must be signed in to change notification settings - Fork 559
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
Get Nearest Point on Linestring #190
Comments
The point returned is the nearest point on the line to the original point. The nearest point is not necessarily an existing vertex in the LineString, and in this case it isn't.
If you want to find the nearest vertex you should first convert the LineString to a MultiPoint geometry, then use the
This query requires calculating the distance between the original point and each vertex in the original linestring. For very complex routes this could be rather slow. If this is the case you should consider using the |
Oh ok Thanks for your response. |
@snorfalorpagus . I was searching for something like this. any smart suggestions to get rid of the floating point error? Same issue is there with this tool also. |
Hello,
Given a point, I am trying to get the nearest point on a linestring. It seems to work fine for a simple linestring, e.g
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
However, for a complex linestring I am not getting the intended results.e.g.
end=Point(19.125150,72.893218)
np = route.interpolate(route.project(end))
I was expecting the result to be 19.124929, 72.893177. Is it something which I am doing wrong? Any help appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: