I need to calculate the distance between some points on a line (LineString), using PostGIS, to find the nearest over a set of MultiPoint.
I know there is a function ST_Distance(), but this one returns a distance as the crow flies, with no possibility to take a path into account.
The problem is : "which of A or B is the nearest of S ?"
Here is a little drawing, for a better explanation :
Is there an alternative to ST_Distance() ?
I have already read Getting distance between two points over linestring using PostGIS?, but unfortunately, it doesn't give a complete reply : I have a MultiPoint feature.
The solution given wasn't succesfull, but I guess it may just need an adaptation ..?