<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>GRASS GIS: v.category</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="grassdocs.css" type="text/css"> </head> <body bgcolor="white"> <img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade> <h2>NAME</h2> <em><b>v.category</b></em> - Attach, delete or report vector categories to map geometry. <h2>KEYWORDS</h2> vector <h2>SYNOPSIS</h2> <b>v.category</b><br> <b>v.category help</b><br> <b>v.category</b> [-<b>g</b>] <b>input</b>=<em>name</em> [<b>output</b>=<em>name</em>] [<b>type</b>=<em>string</em>[,<i>string</i>,...]] [<b>option</b>=<em>string</em>] [<b>cat</b>=<em>integer</em>] [<b>layer</b>=<em>integer</em>[,<i>integer</i>,...]] [<b>step</b>=<em>integer</em>] [--<b>overwrite</b>] [--<b>verbose</b>] [--<b>quiet</b>] <h3>Flags:</h3> <DL> <DT><b>-g</b></DT> <DD>Shell script style, currently only for report</DD> <DD>Format: layer type count min max</DD> <DT><b>--overwrite</b></DT> <DD>Allow output files to overwrite existing files</DD> <DT><b>--verbose</b></DT> <DD>Verbose module output</DD> <DT><b>--quiet</b></DT> <DD>Quiet module output</DD> </DL> <h3>Parameters:</h3> <DL> <DT><b>input</b>=<em>name</em></DT> <DD>Name of input vector map</DD> <DT><b>output</b>=<em>name</em></DT> <DD>Name for output vector map</DD> <DT><b>type</b>=<em>string[,<i>string</i>,...]</em></DT> <DD>Type</DD> <DD>Feature type(s)</DD> <DD>Options: <em>point,line,boundary,centroid,area</em></DD> <DD>Default: <em>point,line,boundary,centroid,area</em></DD> <DT><b>option</b>=<em>string</em></DT> <DD>Action to be done</DD> <DD>Options: <em>add,del,chlayer,sum,report,print</em></DD> <DD>Default: <em>add</em></DD> <DD><b>add</b>: add a new category</DD> <DD><b>del</b>: delete category</DD> <DD><b>chlayer</b>: change layer number (e.g. layer=3,1 changes layer 3 to layer 1)</DD> <DD><b>sum</b>: add the value specified by cat option to the current category value</DD> <DD><b>report</b>: print report (statistics), in shell style: layer type count min max</DD> <DD><b>print</b>: print category values, more cats in the same layer are separated by '/'</DD> <DT><b>cat</b>=<em>integer</em></DT> <DD>Category value</DD> <DD>Default: <em>1</em></DD> <DT><b>layer</b>=<em>integer[,<i>integer</i>,...]</em></DT> <DD>Layer number</DD> <DD>A single vector map can be connected to multiple database tables. This number determines which table to use.</DD> <DD>Default: <em>1</em></DD> <DT><b>step</b>=<em>integer</em></DT> <DD>Category increment</DD> <DD>Default: <em>1</em></DD> </DL> <h2>DESCRIPTION</h2> <em>v.category</em> attaches, deletes or reports vector categories to map geometry. These categories (IDs) are used to link a vector map to an attribute table. <h2>NOTES</h2> <p> Use <em>v.to.db</em> to upload related categories to a linked attribute table. <p> The <b>type</b> parameter specifies the type of geometry objects to which the category is added; it is similar to an input filter - only the geometry specified in 'type' is processed. <p> If the <b>type</b> parameter is set to <b>centroid</b> and the <b>option</b> parameter set to <b>add</b>, new categories will be added to existing centroids. Note however, that new centroids cannot be created this way. To do so, they must be added manually using v.digit or by running v.category with the type parameter set to area (see below also). <p> Areas are a special case because it is impossible to attach a cat to an area without a centroid; in this case, the module places new centroids in areas automatically. <h2>EXAMPLES</h2> <em>1) Report vector categories</em><br> <div class="code"><pre> v.category in=testmap option=report LAYER/TABLE 1/testmap: type count min max point 0 0 0 line 1379 1 1379 boundary 0 0 0 centroid 0 0 0 area 0 0 0 all 1379 1 1379 </pre></div> <P> <em>2) Delete all vector categories in layer 1</em><br> <div class="code"><pre> v.category in=testmap out=outmap option=del </pre></div> <p> <em>3) Add vector categories in layer 1 with step=2</em><br> <div class="code"><pre> v.category in=outmap out=stepmap option=add step=2 LAYER/TABLE 1/outmap: type count min max point 0 0 0 line 1379 1 2757 boundary 0 0 0 centroid 0 0 0 area 0 0 0 all 1379 1 2757 </pre></div> <P> <em>4) Add categories/centroids to a vector map without categories</em><br> <div class="code"><pre> v.category in=wkt out=wktnew option=add </pre></div> <P> Results can be tested using <em><a HREF="d.what.vect.html">d.what.vect</a></em>. <h2>SEE ALSO</h2> <em> <a href="v.db.connect.html">v.db.connect</a>, <a href="v.to.db.html">v.to.db</a> </em> <h2>AUTHOR</h2> Radim Blazek, ITC-Irst, Trento, Italy <p><i>Last changed: $Date: 2006-08-31 16:06:33 +0200 (Thu, 31 Aug 2006) $</i> <HR> <P><a href="index.html">Main index</a> - <a href="vector.html">vector index</a> - <a href="full_index.html">Full index</a></P> <P>© 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p> </body> </html>