Browse Source

v.category: fix manual for option=del

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57940 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 11 năm trước cách đây
mục cha
commit
e5c131093b
2 tập tin đã thay đổi với 12 bổ sung5 xóa
  1. 2 2
      vector/v.category/main.c
  2. 10 3
      vector/v.category/v.category.html

+ 2 - 2
vector/v.category/main.c

@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
 	       "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 @@ int main(int argc, char *argv[])
 		    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]);
 			    }

+ 10 - 3
vector/v.category/v.category.html

@@ -39,8 +39,15 @@ is reported at the end.
 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. 
@@ -73,7 +80,7 @@ all         1379          1       1379
 <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>