[GRASS-dev] [GRASS GIS] #1000: v.category option=del doesn't delete multiple cats per object

GRASS GIS trac at osgeo.org
Sun Mar 14 01:35:26 EST 2010


#1000: v.category option=del doesn't delete multiple cats per object
----------------------------------------------------------------+-----------
 Reporter:  needelsd                                            |       Owner:  grass-dev at lists.osgeo.org
     Type:  defect                                              |      Status:  new                      
 Priority:  normal                                              |   Milestone:  6.4.0                    
Component:  Vector                                              |     Version:  6.4.0 RCs                
 Keywords:  v.category v.to.points v.clean delete replace cats  |    Platform:  Unspecified              
      Cpu:  Unspecified                                         |  
----------------------------------------------------------------+-----------
 The manual for for v.category option=del states that it will "delete all
 categories of given layer". However, only one cat per object is deleted
 for objects with multiple cats (listed separated by a "/").

 Here is a Spearfish example that starts with a line vector with multiple
 segments, generates a point vector from the nodes (in layer 2), removes
 the resulting duplicate points, and then attempts to delete the layer 2
 cats in order to generate new cats with sequential values.

 # Extract 5 lines, extract nodes into layer 2
 v.edit map=L_1 tool=create --o
 v.edit map=L_1 tool=copy ids=17,424-426,496 bgmap=roads
 v.to.points -n input=L_1 output=P_1_raw
 # Remove duplicate points (overlapping nodes from adjacent segments)
 v.clean input=P_1_raw output=P_1 tool=snap,rmdupl thresh=.1,-1 type=point
 --o
 # Replace cat values with sequential values
 v.category input=P_1 output=P_1_no_cats option=del layer=2 --o
 v.category input=P_1_no_cats output=P_1_cats option=add layer=2 --o

 # Expected result- layer 2 cat values 1-6
 v.category input=P_1_cats option=print layer=2
 ## cat  1 2 1 2 3 6

 # The v.clean tool=rmdupl step results in objects with multiple cats
 separated by "/"
 v.category P_1 option=print layer=2
 ## cat  4 9 10/1 5/2 8/3 7/6

 # The v.category option=del step only removes the first cat of each pair
 v.category input=P_1_no_cats option=print layer=2
 ## cat  1 2 3 6

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1000>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list