[postgis-users] Segements and Routing

Stephen Woodbridge woodbri at swoodbridge.com
Sun Jan 11 05:50:26 PST 2009


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.



More information about the postgis-users mailing list