[GRASS-dev] Re: [GRASS GIS] #1000: v.category option=del doesn't
delete multiple cats per object
GRASS GIS
trac at osgeo.org
Sun Mar 14 09:42:30 EDT 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
Resolution: | Keywords: v.category v.to.points v.clean delete replace cats
Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by martinl):
Replying to [ticket:1000 needelsd]:
Please use pre-formatted text otherwise it's not readable.
{{{
# 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#comment:2>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list