Question

I have a a list of points (latitude,longitude), it's a bus path and around this path I have some points (bus stops), the points are not on the path.

I need to project the bus stops points on the path for compute the traveled distance from the beginning of the path for each bus stops. For that I need the know the latitude and longitude for each stops on the path.

I can compute the distance but I can't project the points on the path en get the new latitude-longitude of the bus stops points.

I search for a formula they do that without success...

Someone have an idea, I work with C# 4.0.

Was it helpful?

Solution

PostGIS has a function called ST_LineLocatePoint from which you can get an exact point using ST_LineInterpolatePoint.

The PostGIS source code is available here

OTHER TIPS

I would say you need to calculate the minimum distance between the line (bus route) and the point (bus stop). See http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top