2

I am using Postgis. I have a linestring defined in postgis. Using Postgis calls how would I go about identifying the coordinates of a point 100 meters along a line string.

1 Answer 1

1

Something like the following (example that works).

select ST_AsText( ST_LineInterpolatePoint( 'LINESTRING(0 0,100 200, 300 400, 500 500)', 100.0/ ST_Length('LINESTRING(0 0,100 200, 300 400, 500 500)')))

This returns POINT(44.7xxx 89.4xxx) which means that the 100th distance unit from the start of the line referenced is at 44.7, 89,4.

So to use for your own data, replace 'LINESTRING....' with your own (line) geometry. And remove the AsText function call if you just want geometry - I just used that for debugging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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