[postgis-users] Distance of point on a line

Abe Gillespie abe.gillespie at gmail.com
Tue Apr 19 10:06:57 PDT 2005


There may be a more direct way ... but you could always make a temp
linestring of all the points along the string up to, and including,
the point in question.  Then you can get the length from that.  It
shouldn't be too hard to create a custom function to do this.

-Abe

On 4/19/05, Derek C. Figg <derek at cxtsoftware.com> wrote:
>  
> Hello all, 
>   
> I sent out a fairly dumb question about a week ago and received many helpful
> responses, and wanted to thank everyone for that.  Now I have another fairly
> simple (I hope) question that I cannot find an answer to in the
> documentation. 
>   
> If I have a non-linear linestring, with many points, I know I can find the
> total distance of the line with "length(geom)".  If I specify a point that
> lies somewhere directly on the linestring, is there a function that will
> determine the length from the beginning point of the line to the specified
> point somewhere on that line?  Thanks for the help. 
>   
>   
> Derek Figg 
> CXT Software, 
> a Connection Technology Company 
> www.cxtsoftware.com 
> office (602) 265-0195 
> fax (602) 263-0942 
>   
> _______________________________________________
> 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