[pgrouting-users] help(network and points)

Stephen Woodbridge woodbri at swoodbridge.com
Thu Feb 25 12:08:30 EST 2010

Ricardo Rodríguez wrote:
> hello all, I have a question, how can I make the shortest road load on a 
> network but additionally have another layer or points of interest files 
> from the network.
>   there is any way to integrate these two files into one so that for the 
> calculations, only takes into account only the points of interest and do 
> not see how to add and this in pgrouting condition.

Are you trying to relate your points of interest to your route?

If so, then could do this as a post processing step.

1. run the shortest path, and get the route as a list of segments
2. do a spatial search of your points of interest for each segment
    for one segment you might do:
    select * from points where st_expand(the_geom, MAX_DIST) && SEGMENT 
and distance(the_geom, SEGMENT) <= MAX_DIST;

    then loop for all segments.

-Steve W

More information about the Pgrouting-users mailing list