[GRASS-dev] [GRASS GIS] #2092: v.category option=del doesn't delete any categories

#2092: v.category option=del doesn't delete any categories
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.category | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
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
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2092&gt;
GRASS GIS <http://grass.osgeo.org>

#2092: v.category option=del doesn't delete any categories
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.category | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mmetz):

Replying to [ticket:2092 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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2092#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2092: v.category option=del doesn't delete any categories
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.category
  Platform: Linux | Cpu: Unspecified
---------------------+------------------------------------------------------
Changes (by marisn):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:1 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 :stuck_out_tongue: )

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2092#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>