Hi,
I try to understand how to block a street in a certain direction
for shortest path routing (in v.net.alloc just set cost attribute
to -1 and the direction is blocked, apparently not the case for
v.net.path|d.path).
Attached a small map with a roundabout and a screenshot.
The idea is that you cannot go clockwise in the roundabout
(continental European directions).
Still GRASS suggests this...
I did (small sample data set attached):
# import in any metric location, doesn't matter (Spearfish, NC, ...)
v.in.ogr shortest.shp out=roundabout -o
g.region vect=roundabout
# snap broken connections
v.clean roundabout out=roundabout2 tool=snap thresh=10
d.mon x0
d.vect roundabout disp=shape,dir,topo
# look at attributes
v.info -c roundabout
v.db.select roundabout
...
# add two columns to handle directions separately
v.db.addcol roundabout col="forward integer, backward integer"
# initialize directions:
v.db.update roundabout col=backward value=1
v.db.update roundabout col=forward value=1
# reset roundabout to one way (set high costs?? or -1?):
v.db.update roundabout col=backward value=-1 where="cat=4 OR cat=5 OR
cat=6 OR cat=8"
v.db.select roundabout col=cat,desvia,backward,forward
# navigate
d.path roundabout afcol=forward abcol=backward
# If you now start in the south bound street and route clockwise
# in the roundabout, GRASS happily permits this
Any suggestions? Anything bad in Vect_net_shortest_path_coor() of
lib/vector/Vlib/net.c ?
thanks
Markus
(attachments)
shortest.zip (1.23 KB)