[GRASS-SVN] r57940 - grass/trunk/vector/v.category

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 5 06:14:42 PDT 2013


Author: mmetz
Date: 2013-10-05 06:14:42 -0700 (Sat, 05 Oct 2013)
New Revision: 57940

Modified:
   grass/trunk/vector/v.category/main.c
   grass/trunk/vector/v.category/v.category.html
Log:
v.category: fix manual for option=del

Modified: grass/trunk/vector/v.category/main.c
===================================================================
--- grass/trunk/vector/v.category/main.c	2013-10-04 12:47:27 UTC (rev 57939)
+++ grass/trunk/vector/v.category/main.c	2013-10-05 13:14:42 UTC (rev 57940)
@@ -113,7 +113,7 @@
 	       "print;%s;"
 	       "layers;%s",
 	       _("add a new category"),
-	       _("delete category (-1 to delete all categories of given layer)"),
+	       _("delete category (cat=-1 to delete all categories of given layer)"),
 	       _("change layer number (e.g. layer=3,1 changes layer 3 to layer 1)"),
 	       _("add the value specified by cat option to the current category value"),
 	       _("copy values from one layer to another (e.g. layer=1,2,3 copies values from layer 1 to layer 2 and 3)"),
@@ -397,7 +397,7 @@
 		    n = TCats->n_cats;
 		    for (i = 0; i < n; i++) {
 			scat = TCats->cat[i];
-			for (i = 0; i < nfields; i++) {
+			for (i = 1; i < nfields; i++) {
 			    if (Vect_cat_set(Cats, fields[i], scat) > 0) {
 				G_debug(4, "Copy cat %i of field %i to into field %i", scat, fields[0], fields[i]);
 			    }

Modified: grass/trunk/vector/v.category/v.category.html
===================================================================
--- grass/trunk/vector/v.category/v.category.html	2013-10-04 12:47:27 UTC (rev 57939)
+++ grass/trunk/vector/v.category/v.category.html	2013-10-05 13:14:42 UTC (rev 57940)
@@ -39,9 +39,16 @@
 an area without a centroid; in this case, the module places new
 centroids in areas automatically.
 
-<p>The <b>cat</b> parameter is only used with <b>option</b>=<i>add</i> and
-<b>option</b>=<i>sum</i>.
+<p>The <b>cat</b> parameter is only used with <b>option</b>=<i>add</i>, 
+<b>option</b>=<i>sum</i> and <b>option</b>=<i>del</i>.
 
+<p>Categories can be deleted for the given layer with <em>option=del</em>. 
+If <b>cat</b> is set to <i>-1</i>, all categories for the given layer 
+are deleted. If <b>cat</b> is zero or positive, only this category value 
+will be deleted. By default, <b>cat</b> is set to <i>1</i> which means 
+that only categories of value <i>1</i> will be deleted. 
+
+
 <p>The <b>ids</b> parameter specifies the list of feature IDs to which the
 operation is performed; by default, all vector feature ids are processed. 
 The <i>feature ID</i> is an internal (unique) geometry ID that all vector
@@ -73,7 +80,7 @@
 <h3>Delete all vector categories in layer 1</h3>
 
 <div class="code"><pre>
-v.category input=testmap output=outmap option=del
+v.category input=testmap output=outmap option=del cat=-1
 </pre></div>
 
 <h3>Add vector categories in layer 1 with step=2</h3>



More information about the grass-commit mailing list