3
<em>v.category</em> attaches, copies, deletes or reports categories of
4
vector geometry objects. Further on, <em>v.category</em> adds a number
5
given by the <em>cat</em> option to categories of the selected layer.
6
These categories (IDs) are used to assign IDs or to group geometry objects
7
into categories (several different geometry objects share the same
8
category). These categories are also used to link geometry
9
object(s) to attribute records (from an attribute table linked to vector map).
14
Use <em><a href="v.to.db.html">v.to.db</a></em> to upload related categories
15
to a linked attribute table.
17
<p>The <b>type</b> parameter specifies the type of geometry objects to which
18
the category is added; it is similar to an input filter - only the
19
geometry specified in 'type' is processed.
21
<p>If the <b>type</b> parameter is set to <b>centroid</b> and
22
the <b>option</b> parameter set to <b>add</b>, new categories will be
23
added to existing centroids. Note however, that new centroids cannot
24
be created this way. To do so, they must be added manually
25
using <em><a href="wxGUI.vdigit.html">wxGUI vector
26
digitizer</a></em> or by running <em>v.category</em> with the type
27
parameter set to area.
29
<p>If categories are copied with <em>option=transfer</em>, a warning is
30
issued if categories already exit in the layer they are copied to. In
31
this case the user must make sure beforehand that copying categories
32
from one layer to another layer does not cause undesired grouping of
33
different geometry objects into the same categories. This can be avoided
34
by specifying only one <em>layer</em>. The module will then find the
35
next free layer number and copy categories to there. The new layer number
36
is reported at the end.
38
<p>Areas are a special case because it is impossible to attach a cat to
39
an area without a centroid; in this case, the module places new
40
centroids in areas automatically.
42
<p>The <b>cat</b> parameter is only used with <b>option</b>=<i>add</i>,
43
<b>option</b>=<i>sum</i> and <b>option</b>=<i>del</i>.
45
<p>Categories can be deleted for the given layer with <em>option=del</em>.
46
If <b>cat</b> is set to <i>-1</i>, all categories for the given layer
47
are deleted. If <b>cat</b> is zero or positive, only this category value
48
will be deleted. By default, <b>cat</b> is set to <i>1</i> which means
49
that only categories of value <i>1</i> will be deleted.
52
<p>The <b>ids</b> parameter specifies the list of feature IDs to which the
53
operation is performed; by default, all vector feature ids are processed.
54
The <i>feature ID</i> is an internal (unique) geometry ID that all vector
55
primitives possess, and is separate from any category the feature may
57
Use <div class="code"><pre>
58
<em><a href="v.edit.html">v.edit</a></em> map=inputname tool=select
60
to find out the geometry ids of certain features.
65
<h3>Report vector categories</h3>
67
<div class="code"><pre>
68
v.category input=testmap option=report
70
LAYER/TABLE 1/testmap:
80
<h3>Delete all vector categories in layer 1</h3>
82
<div class="code"><pre>
83
v.category input=testmap output=outmap option=del cat=-1
86
<h3>Add vector categories in layer 1 with step=2</h3>
88
<div class="code"><pre>
89
v.category input=outmap output=stepmap option=add step=2
92
v.category input=stepmap option=report
103
<h3>Add categories/centroids to a vector map without categories</h3>
105
<div class="code"><pre>
106
v.category input=wkt output=wktnew option=add
109
Results can be tested
110
using <em><a href="d.what.vect.html">d.what.vect</a></em>.
112
<h3>Copy categories from layer 1 to layer 2,3,4,5,6,7 and 8</h3>
113
Existing layer will be overwritten, non-existing will be created.
114
<div class="code"><pre>
115
v.category input=observer output=observer_new option=transfer layer=1,2,3,4,5,6,7,8
118
<h3>Print vector categories of given layer</h3>
120
Print vector categories from the first layer, only for feature ids 1-50.
122
<div class="code"><pre>
123
v.category input=roads option=print layer=1 id=1-50
130
<a href="v.centroids.html">v.centroids</a>,
131
<a href="v.db.connect.html">v.db.connect</a>,
132
<a href="v.edit.html">v.edit</a>,
133
<a href="v.to.db.html">v.to.db</a>
139
Radim Blazek, ITC-irst, Trento, Italy<br>
140
Modified (the id parameter) by Martin Landa,
141
FBK-irst (formerly ITC-irst), Trento, Italy, 2008/02
143
<p><i>Last changed: $Date: 2014-04-11 17:48:44 +0200 (Fri, 11 Apr 2014) $</i>