[postgis-users] Segements and Routing

Ahmad Bdair bdair2002 at gmail.com
Mon Jan 12 00:20:39 PST 2009

Thnx Steve, you are the man :)
I suppose I need to calculate line_start and line_end for both first and
last segment.

On Sun, Jan 11, 2009 at 3:50 PM, Stephen Woodbridge <woodbri at swoodbridge.com
> wrote:

> bdair2002 wrote:
>> Hello, I am using POSGIS with Pgrouting, I noticed that the  route deals
>> with
>> segments (either it takes the full segments or ignore it). Lets say I have
>> segments A B & C , A and C are connected through B.
>> And I want to go from A to C, the routing result is A B C which is
>> correct,
>> now lets say I want to go from half A to C, now the route display A B and
>> C
>> again.
>> So My question is, Is it possible to make the route from the exact start
>> point (Half A, or from the first Quarter of A) to the exact end point? Is
>> there any function which takes the x1,y1 for segment A and a LonLat on the
>> same segment and return me the partial geometry of A?
>> Regards
> pct := line_locate_point(line, pnt);
> line_start := line_substring(line, 0, pct);
> line_end := line substring(line, pct, 1.0);
> These should do what you want.
> -Steve W.
> http://imaptools.com/leaddog/routing/dd.html  My routing Demo page.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090112/e615821e/attachment.html>

More information about the postgis-users mailing list