Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Find closest NON interpolated point on a LINESTRING

$
0
0

I have a linestring and a point, I want to find the closest point on the linestring to that point.

Below is a screenshot of a test I created to confirm that the various POSTGIS functions for finding the closest point between two objects will interpolate a point that isn’t in the original linestring.

I need to return the nearest point that is an actually point that exists in the linestring source. In the test it should be the first square-red marker i want returned. But POSTGIS returns a point in-between points 1 & 2 that it generates.

[test screenshot]
http://i.imgur.com/XWfJPZV.jpg


Viewing all articles
Browse latest Browse all 1138

Trending Articles