[pgrouting-users] [Fwd: How determining a path from two points (X, Y) no node of the graph]

Stephen Woodbridge woodbri at swoodbridge.com
Fri Mar 6 14:05:19 EST 2009

Please reply all so responses go back to the list.

-------- Original Message --------
Subject: How determining a path from two points (X, Y) no node of the graph
Date: Fri, 6 Mar 2009 12:50:22 -0500
From: Pablo Velazco Villares <pvela at uci.cu>
To: Stephen Woodbridge <woodbri at swoodbridge.com>
References: <1A668661A3AAA343B3C49E2F266DDAE004D9E4A5 at ucixw2.uci.cu> 
<49B16094.6070508 at swoodbridge.com>

Hi Peter, thank you for your cooperation

Peter, what I have implemented an algorithm that we developed in C #, 
but then cut the edge in an array of arcs, the idea that you give me 
change my original arched base, consistently, if you understand ... I 
explain better: I would not want to have more of the arches in my graph, 
because I would much more difficult to update ... you think about it?


-----Mensaje original-----
De: Stephen Woodbridge [mailto:woodbri at swoodbridge.com]
Enviado el: vie 06/03/2009 12:42
Para: Pablo Velazco Villares
CC: pgrouting-users at lists.postlbs.org
Asunto: Re: [pgrouting-users] How determining a path from two points (X, 
Y) no node of the graph

Pablo Velazco Villares wrote:
> Hello colleagues,
> I am starting my work with pgRouting, not work well with road
> networks.
> I need to know if possible or is there some function that supports
> the analysis of route from fucking X, Y located on or near a given
> edge.
> ie not necesariametente, take into account two nodes or vertices
> (start or end of an edge)
> resuntante require that the path includes only a portion of the edge
> source or target of the solution ... thank you all and hope to have
> been sufficiently explicit ... because I am trying to communicate a
> complex issue in a strange language
> if someone can give me a hand with this, it will be very grateful


You have to split the starting edge and ending edge and use the part you
need. postGIS has tools to do this. I don't have my postGIS manual in
front of me, but here are the basic steps:

pct := ST_line_locate_point(segment, point);

a2pct := ST_line_substring(segment, 0.0, pct);
pct2b := ST_line_substring(segment, pct, 1.0);

a2pct is the segment from the start of the line to the point and pct2b
is the segment from the point to the end of the line. You have to decide
which substring you need to use based on how things are connected in the


More information about the Pgrouting-users mailing list