[GRASS-dev] [GRASS GIS] #2936: v.net.distance: wrong directions in one-way streets

GRASS GIS trac at osgeo.org
Thu Feb 25 07:59:46 PST 2016


#2936: v.net.distance: wrong directions in one-way streets
-------------------------------------------------+-------------------------
 Reporter:  mlennert                             |      Owner:  grass-dev@…
     Type:  defect                               |     Status:  new
 Priority:  normal                               |  Milestone:  7.0.4
Component:  Vector                               |    Version:  svn-trunk
 Keywords:  v.net.distance network one-way       |        CPU:  Unspecified
  direction                                      |
 Platform:  Unspecified                          |
-------------------------------------------------+-------------------------
 In the NC demo dataset:

 {{{
 v.net -c streets_wake op=nodes out=mynet
 v.db.update map=mynet at user1 column=TF_COST value=-1 where=ONE_WAY='FT'
 v.db.update map=mynet at user1 column=FT_COST value=-1 where=ONE_WAY='TF'
 v.net.distance --overwrite input=mynet output=distance_7779_7780
 from_layer=2 from_cats=7779 to_layer=2 to_cats=7780 arc_column=FT_COST
 arc_backward_column=TF_COST
 v.net.distance --overwrite input=mynet output=distance_7780_7779
 from_layer=2 from_cats=7780 to_layer=2 to_cats=7779 arc_column=FT_COST
 arc_backward_column=TF_COST
 d.vect map=mynet
 d.vect map=mynet display=shape,dir where="ONE_WAY='FT' OR ONE_WAY='TF'"
 color=red attribute_column=ONE_WAY yref=top
 d.vect map=mynet layer=2 display=shape,cat cats=7779-7780
 fill_color=255:165:0 icon=basic/circle label_layer=2
 d.vect map=distance_7779_7780 display=shape,dir
 type=point,line,boundary,area,face color=blue width=3 attribute_column=cat
 label_color=blue
 d.vect map=distance_7780_7779 display=shape,dir
 type=point,line,boundary,area,face color=83:201:10 width=3
 attribute_column=cat label_color=83:201:10
 }}}

 gives the attached map v_distance_map.png. One can see there that the
 segment connection 7779 and 7780 directly has a line direction from 7779
 to 7780, but it is defined as ONE_WAY='TF', meaning that vehicles can only
 go from 7780 to 7779. However, when looking at the paths identified by
 v.net.distance, the path coming from 7779 and going to 7780 (blue,
 identified in the map as 7779) goes in the opposite direction through the
 one-way street and that the other path takes the long route.

 As a comparison, v.net.path gives correct results:


 {{{
 echo "1 7779 7780
 2 7780 7779" | v.net.path mynet out=paths arc_column=FT_COST
 arc_backward_column=TF_COST
 d.vect map=paths display=shape,cat cats=1 color=0:128:0 width=2
 label_color=0:128:0
 d.vect map=paths display=shape,cat cats=2 color=128:0:128 width=2
 label_color=128:0:128
 }}}

 See the second attached map v_net_path_example.png which shows that path
 number 2 (purple), that goes from 7780 to 7779 takes the short route,
 while path 1 (green) takes the long route.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2936>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list