[GRASS-dev] [GRASS GIS] #1001: Add option to replace (instead of just add) cats with v.category

#1001: Add option to replace (instead of just add) cats with v.category
---------------------------------------------+------------------------------
Reporter: needelsd | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Keywords: v.category add del replace cats | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------------+------------------------------
Add an option to v.category option=replace that overwrites the cat values
in a vector instead of only adding a cat to objects that do not already
have a cat.

Equivalent to

v.category input=input_vector output=tmp option=del
v.category input=tmp output=output_vector option=add
g.remove vect=tmp

Personally, I would also appreciate a flag [-r]?? or other mechanism to
overwrite cats in the original vector (allow output=input).

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

#1001: Add option to replace (instead of just add) cats with v.category
--------------------------+-------------------------------------------------
  Reporter: needelsd | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.category add del replace cats
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

aka v.edit?

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

#1001: Add option to replace (instead of just add) cats with v.category
--------------------------+-------------------------------------------------
  Reporter: needelsd | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.category add del replace cats
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Old description:

Add an option to v.category option=replace that overwrites the cat values
in a vector instead of only adding a cat to objects that do not already
have a cat.

Equivalent to

v.category input=input_vector output=tmp option=del
v.category input=tmp output=output_vector option=add
g.remove vect=tmp

Personally, I would also appreciate a flag [-r]?? or other mechanism to
overwrite cats in the original vector (allow output=input).

New description:

Add an option to v.category option=replace that overwrites the cat values
in a vector instead of only adding a cat to objects that do not already
have a cat.

Equivalent to

{{{
v.category input=input_vector output=tmp option=del
v.category input=tmp output=output_vector option=add
g.remove vect=tmp
}}}

Personally, I would also appreciate a flag [-r]?? or other mechanism to
overwrite cats in the original vector (allow output=input).

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

#1001: Add option to replace (instead of just add) cats with v.category
--------------------------+-------------------------------------------------
  Reporter: needelsd | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.category add del replace cats
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by needelsd):

> aka v.edit?

As far as I can tell the v.edit tool=catadd does not replace cats. It
appears to append the same one or more cats designated by cats= to every
feature selected by ids=, but without incrementing the cat value.

Is there a way to tell v.edit to add sequential cat numbers or to replace
an existing cat with a new one?

But v.edit does make changes to the original file. Also, the tool=catdel
ids=1-9999 cats=1-9999 does delete all multiple cats associated with
individual selected vector features.

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