Changeset 50501
- Timestamp:
- Jan 27, 2012, 10:10:35 AM (13 years ago)
- Location:
- grass/trunk/vector/v.category
- Files:
-
- 2 edited
-
main.c (modified) (4 diffs)
-
v.category.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/vector/v.category/main.c
r49959 r50501 103 103 "chlayer;change layer number (e.g. layer=3,1 changes layer 3 to layer 1);" 104 104 "sum;add the value specified by cat option to the current category value;" 105 "transfer;copy values from one layer to another (e.g. layer=1,2 copies values from layer 1 to layer 2);"105 "transfer;copy values from one layer to another (e.g. layer=1,2,3 copies values from layer 1 to layer 2 and 3);" 106 106 "report;print report (statistics), in shell style: layer type count min max;" 107 107 "print;print category values, more cats in the same layer are separated by '/'"); … … 234 234 235 235 if (option == O_TRANS && open_level > 1) { 236 /* check if field[ 1] already exists */236 /* check if field[>0] already exists */ 237 237 if (nfields > 1) { 238 if (Vect_cidx_get_field_index(&In, fields[1]) != -1) 239 G_warning(_("Categories already exist in layer %d"), fields[1]); 238 for(i = 1; i < nfields; i++) { 239 if (Vect_cidx_get_field_index(&In, fields[i]) != -1) 240 G_warning(_("Categories already exist in layer %d"), fields[i]); 241 } 240 242 } 241 243 /* find next free layer number */ … … 340 342 if (Cats->field[i] == fields[0]) { 341 343 scat = Cats->cat[i]; 342 if (Vect_cat_set(Cats, fields[1], scat) > 0) { 343 nmodified++; 344 } 345 } 346 } 344 break; 345 } 346 } 347 for (i = 1; i < nfields; i++) { 348 if (Vect_cat_set(Cats, fields[i], scat) > 0) { 349 G_debug(4, "Copy cat %i of field %i to into field %i", scat, fields[0], fields[i]); 350 } 351 } 352 nmodified++; 347 353 } 348 354 Vect_write_line(&Out, type, Points, Cats); … … 704 710 705 711 if (option == O_TRANS && nmodified > 0) 706 G_important_message(_("Categories copied from layer %d to layer %d"), 707 fields[0], fields[1]); 712 for(i = 0; i < nfields; i++) 713 G_important_message(_("Categories copied from layer %d to layer %d"), 714 fields[0], fields[i]); 708 715 G_done_msg(_("%d features modified."), nmodified); 709 716 } -
grass/trunk/vector/v.category/v.category.html
r49651 r50501 103 103 using <em><a href="d.what.vect.html">d.what.vect</a></em>. 104 104 105 <h3>Copy categories from layer 1 to layer 2,3,4,5,6,7 and 8</h3> 106 Existing layer will be overwritten, non-existing will be created. 107 <div class="code"><pre> 108 v.category input=observer output=observer_new option=transfer layer=1,2,3,4,5,6,7,8 109 </pre></div> 110 105 111 <h3>Print vector categories of given layer</h3> 106 112
Note:
See TracChangeset
for help on using the changeset viewer.
