Is it possible to filter out subpaths on the shortest path calculations? For example, if I wanted to use djikstra’s algorithm to calculate the shortest path between point A and point B without using Street X?
You can effectively doing this by making the travel costs of Street X’s segment very high. Doing this causes the algorithm to exclude the those segments from the solution since using them is costs. — On Sat, 4/9/11, James Mueller jmuel11@gmail.com wrote: > From: James Mueller jmuel11@gmail.com > Subject: [pgrouting-users] filtering the data used for shortest path calculations > To: pgrouting-users@lists.osgeo.org > Received: Saturday, April 9, 2011, 2:46 PM > > Is it possible to filter out subpaths on the shortest path calculations? For example, if I wanted to use djikstra’s algorithm to calculate the shortest path between point A and point B without using Street X? > > -----Inline Attachment Follows----- > > _______________________________________________ > Pgrouting-users mailing list > Pgrouting-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/pgrouting-users |
---|
A simplier approach to this is to modify the wrapper plpgsql function to filter out the street by name or unique id. Basically the wrapper functions take a start and end point and construct an expanded bbox that is used to load the the segments into the graph that get solved.
Something like:
select .... from table where the_geom && st_expand(setsrid(makeline(p1, p2), 4326);
change this to be:
select .... from table where the_geom && st_expand(setsrid(makeline(p1, p2), 4326) AND gid != exclude_gid;
or:
select .... from table where the_geom && st_expand(setsrid(makeline(p1, p2), 4326) AND name != exclude_name;
and you can clone the wrapper function and add a new parameter for exclude_*
-Steve
On 4/9/2011 6:15 PM, Dan Putler wrote:
You can effectively doing this by making the travel costs of Street X's
segment very high. Doing this causes the algorithm to exclude the those
segments from the solution since using them is costs.--- On *Sat, 4/9/11, James Mueller /<jmuel11@gmail.com>/* wrote:
From: James Mueller <jmuel11@gmail.com>
Subject: [pgrouting-users] filtering the data used for shortest path
calculations
To: pgrouting-users@lists.osgeo.org
Received: Saturday, April 9, 2011, 2:46 PMIs it possible to filter out subpaths on the shortest path
calculations? For example, if I wanted to use djikstra's algorithm
to calculate the shortest path between point A and point B without
using Street X?-----Inline Attachment Follows-----
_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
</mc/compose?to=Pgrouting-users@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/pgrouting-users_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users