[GRASS-SVN] r73668 - grass/trunk/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 13 06:52:37 PST 2018


Author: mmetz
Date: 2018-11-13 06:52:37 -0800 (Tue, 13 Nov 2018)
New Revision: 73668

Modified:
   grass/trunk/vector/v.generalize/main.c
Log:
v.generalize: preserve boundary categories

Modified: grass/trunk/vector/v.generalize/main.c
===================================================================
--- grass/trunk/vector/v.generalize/main.c	2018-11-13 06:59:33 UTC (rev 73667)
+++ grass/trunk/vector/v.generalize/main.c	2018-11-13 14:52:37 UTC (rev 73668)
@@ -44,7 +44,7 @@
 {
     struct Map_info In, Out, Error;
     struct line_pnts *Points;
-    struct line_cats *Cats;
+    struct line_cats *Cats, *ACats;
     int i, type, iter;
     struct GModule *module;	/* GRASS module for parsing arguments */
     struct Option *map_in, *map_out, *error_out, *thresh_opt, *method_opt,
@@ -317,6 +317,7 @@
 
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
+    ACats = Vect_new_cats_struct();
 
     Vect_check_input_output_name(map_in->answer, map_out->answer,
 				 G_FATAL_EXIT);
@@ -438,13 +439,13 @@
 			    right = Vect_get_isle_area(&Out, abs(right));
 
 			if (left > 0) {
-			    Vect_get_area_cats(&Out, left, Cats);
-			    do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
+			    Vect_get_area_cats(&Out, left, ACats);
+			    do_line = Vect_cats_in_constraint(ACats, layer, cat_list);
 			}
 			
 			if (!do_line && right > 0) {
-			    Vect_get_area_cats(&Out, right, Cats);
-			    do_line = Vect_cats_in_constraint(Cats, layer, cat_list);
+			    Vect_get_area_cats(&Out, right, ACats);
+			    do_line = Vect_cats_in_constraint(ACats, layer, cat_list);
 			}
 		    }
 		    if (!do_line)



More information about the grass-commit mailing list