I am trying to find the orthogonal projection of a Point (in 4326 SRID) onto a LineString (in 4326). The picture shows the objective.

orthogonal projection

I have tried to use ST_Distance function, but in this case the function will only return the minimum distance to the starting point of LineString.

  • 1
    And by "orthogonal" do you mean that EPSG:4326 can be treated as a Cartesian CRS, or do you mean a true 90° angle on an ellipsoid of revolution? How does gid1 get extrapolated when needed? Using the last two coordinates? – Mike T Mar 28 '16 at 20:55
  • Sorry if i didn't understand your comment, but i need as a result a point in EPSG:4326. That will be a point at "continue" of LineString identified by gid 1 – Daniel Padilha Mar 28 '16 at 21:03
  • Are you not looking for postgis.net/docs/ST_ClosestPoint.html in an appropriate projection? – John Powell Mar 29 '16 at 6:12

Not sure wgs84 is the best CRS for that kind of problem. Consider moving (st_transform with Postgis) to an appropriate system.

When two lines are perpendicular, the slope of one is the negative reciprocal of the other. If the slope of one line is m, the slope of the other is -1/m.

This is probably a good and easy way to calculate your point without "thinking" only with Postgis spatial functions. Check this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.