[postgis-users] interpolate and extract points from line

Nicolas Ribot nicolas.ribot at gmail.com
Sun Apr 8 04:37:46 PDT 2012

On 8 April 2012 13:32, Gery <gamejihou at hotmail.com> wrote:
> Thanks for the answer, I tried st_segmentize and segmentize (I think they are
> the same, at least the provide the same result) with the same formulation as
> I showed before but instead of having 245 points (I think it produces
> segments instead) I got 269 as result after using st_npoints. So, there is
> something missing there I don't understand.

st_segmentize will add points to your line, keeping the existing
points in the line, thus given a higher count.
So in your case, you're right: st_line_interpolate_point suits your need.

> Well, I'm using this distance as decimal degrees because this line was
> created from long/lat data, but I don't see what it'd be the difference of
> using st_distancesphere().

A distance in decimal degree represents nothing, as the size of a
degree is varying with latitude.
If your data span a large area, you will introduce errors my measuring
dd distances.

You can also convert your data to a geography type instead of geometry.
Distances between geographies are computed in meters.


> I'll test your code and see what happens. Thanks again.
> --
> View this message in context: http://postgis.17.n6.nabble.com/interpolate-and-extract-points-from-line-tp4707400p4708199.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

More information about the postgis-users mailing list