[pgrouting-users] filtering the data used for shortest
path calculations
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Apr 11 21:51:12 EDT 2011
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 at gmail.com>/* wrote:
>
>
> From: James Mueller <jmuel11 at gmail.com>
> Subject: [pgrouting-users] filtering the data used for shortest path
> calculations
> To: pgrouting-users at 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 at lists.osgeo.org
> </mc/compose?to=Pgrouting-users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
More information about the Pgrouting-users
mailing list