Opened 11 years ago

Closed 11 years ago

#2092 closed defect (fixed)

v.category option=del doesn't delete any categories

Reported by: marisn Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: v.category Cc:
CPU: Unspecified Platform: Linux

Description

According to v.category documentation, option=del should result in deleting all categories, still it does nothing - all categories are present after module run.

v.category input=augstumi_merged option=print layer=1 | head
62
63
v.category input=augstumi_merged output=augstumi_merged2 option=del layer=1
Processing features...
Copying attribute table(s)...
Building topology for vector map <augstumi_merged2>...
Registering primitives...
11942 primitives registered
11942 vertices registered
Building areas...
 100%
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
 100%
Number of nodes: 0
Number of primitives: 11942
Number of points: 11942
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.category izpildīts. 1 features modified.
GRASS 7.0.svn (Latvija_LKS):~/soft/grass_trunk > v.category input=augstumi_merged2 option=print layer=1 | head
62
63

Change History (2)

in reply to:  description ; comment:1 by mmetz, 11 years ago

Replying to marisn:

According to v.category documentation, option=del should result in deleting all categories, still it does nothing - all categories are present after module run.

option=del deletes all categories with the value set with the cat option. The cat option is by default set to 1, thus only categories with value 1 will be deleted, as happened in the example:

v.category input=augstumi_merged output=augstumi_merged2 option=del layer=1
v.category izpildīts. 1 features modified.

In order to delete all categories of the given layer, cat must be set to -1. This was nmot clear in the documentation, fixed in r57940.

in reply to:  1 comment:2 by marisn, 11 years ago

Resolution: fixed
Status: newclosed

Replying to mmetz:

option=del deletes all categories with the value set with the cat option. The cat option is by default set to 1, thus only categories with value 1 will be deleted, as happened in the example:

Ahhh. This slipped my mind as cat option only accepts single integer and no ranges or lists of categories. Opened a new bug for it: #2094

Closing as issue is fixed, still I would vote for not having cat=1 as default for "delete" action as it endangers 1st cat to accidental deletion. (Read - why 1st is more special than others? If user forgot to specify cat, let's punish him by nuking 1st cat :P )

Note: See TracTickets for help on using tickets.