[pgrouting-users] isochrone map traversing partial lines

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jun 4 18:13:06 PDT 2012


On 6/4/2012 5:16 PM, Ian wrote:
> hi all,
>
>
>
> i'd like to implement something to do partial edge traversal at the end
> of each route so my function isn't limited to all or nothing edges. I
> saw the implementation of starting from the nearest edge point here
> <http://lists.osgeo.org/pipermail/pgrouting-users/2012-January/000927.html>
> (as opposed to the nearest node and i will implement that, thanks
> steve). does anyone have any suggestions on how i could do partial edge
> traversal at the end of the routes based on the function i'm currently
> using? also, has this been done already and i just missed it along the
> way? a few things about the function i'm currently using:
>
> a friend and i came up with a function that takes a lon, lat, and
> distance parameters and returns all the lines possible to traverse
> within the distance parameter. (attached). in the function the edge
> table is named lines, and the cost column is named distancecolumn, which
> has values for each edge as the length of the edge in feet. also, this
> function finds the nearest node to start from rather than the nearest
> point on the nearest edge. the lines table is in epsg 4269 and the input
> lat lon are meant to be in epsg 4326.

Hi Ian,

You just have to do the math. There are postgis linear referencing 
functions that will do most of the heavy lifting.

Basically if you end point is aa x,y location, you typically snap to the 
nearest edge in you model then select the nearest node along that edge. 
Then when you get your results you just trim the final segment to that 
point or extent the path with the snapped to segment if it were not 
traversed already and trim that to the snap point.

Currently, the code does not add a virtual edge from the start point or 
end point to the surround nodes, except in the case of TRSP when you use 
the edge and percentage along that edge as input.

-Steve


More information about the Pgrouting-users mailing list