[GRASS-SVN] r70599 - grass/trunk/vector/v.build.polylines

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 15 23:26:39 PST 2017


Author: hcho
Date: 2017-02-15 23:26:39 -0800 (Wed, 15 Feb 2017)
New Revision: 70599

Modified:
   grass/trunk/vector/v.build.polylines/main.c
   grass/trunk/vector/v.build.polylines/walk.c
Log:
v.build.polylines: Activate the cats=same option; Remove compile warnings

Modified: grass/trunk/vector/v.build.polylines/main.c
===================================================================
--- grass/trunk/vector/v.build.polylines/main.c	2017-02-16 07:08:51 UTC (rev 70598)
+++ grass/trunk/vector/v.build.polylines/main.c	2017-02-16 07:26:39 UTC (rev 70599)
@@ -97,7 +97,6 @@
 
     int polyline;
     int *lines_visited;
-    int points_in_polyline;
     int start_line;
     int nlines;
     int write_cats, copy_tables;
@@ -177,8 +176,10 @@
 	write_cats = NO_CATS;
     else if (strcmp(cats->answer, "first") == 0)
 	write_cats = ONE_CAT;
-    else
+    else if (strcmp(cats->answer, "multi") == 0)
 	write_cats = MULTI_CATS;
+    else
+	write_cats = SAME_CATS;
 
     if (type_opt->answer)
 	type = Vect_option_to_types(type_opt);
@@ -218,9 +219,8 @@
 	G_debug(1, "Polyline %d: start line = %d", polyline, start_line);
 
 	/* Walk forward and pick up coordinates */
-	points_in_polyline =
-	    walk_forward_and_pick_up_coords(&map, start_line, ltype, points,
-					    lines_visited, Cats, write_cats);
+	walk_forward_and_pick_up_coords(&map, start_line, ltype, points,
+					lines_visited, Cats, write_cats);
 
 	/* Write the line (type of the first line is used) */
 	Vect_write_line(&Out, ltype, points, Cats);
@@ -230,12 +230,10 @@
 
     G_verbose_message(n_("%d line or boundaries found in input vector map",
                          "%d lines or boundaries found in input vector map",
-                         nlines),
-		      nlines, Vect_get_name(&map), Vect_get_mapset(&map));
+                         nlines), nlines);
     G_verbose_message(n_("%d polyline stored in output vector map",
                          "%d polylines stored in output vector map",
-                         polyline),
-		      polyline, Vect_get_name(&Out), Vect_get_mapset(&Out));
+                         polyline), polyline);
 
     /* Copy (all linked) tables if needed */
     if (copy_tables) {

Modified: grass/trunk/vector/v.build.polylines/walk.c
===================================================================
--- grass/trunk/vector/v.build.polylines/walk.c	2017-02-16 07:08:51 UTC (rev 70598)
+++ grass/trunk/vector/v.build.polylines/walk.c	2017-02-16 07:26:39 UTC (rev 70599)
@@ -129,7 +129,7 @@
 {
     int cat_idx;
     int line, next_line, n1, n2;
-    int type, node, next_node;
+    int node, next_node;
     struct line_pnts *pnts;
     struct line_cats *cats_tmp;
 
@@ -149,9 +149,9 @@
     /* Pick up first set of coordinates */
     lines_visited[line] = 1;
     if (cats_tmp)
-	type = Vect_read_line(map, pnts, Cats, line);
+	Vect_read_line(map, pnts, Cats, line);
     else
-	type = Vect_read_line(map, pnts, NULL, line);
+	Vect_read_line(map, pnts, NULL, line);
 
     Vect_get_line_nodes(map, line, &n1, &n2);
     next_line = find_next_line(map, line, n1, ltype);
@@ -175,7 +175,7 @@
     node = next_node;
     while (line != 0 && line != start_line) {
 	G_debug(2, "  line = %d", line);
-	type = Vect_read_line(map, pnts, cats_tmp, line);
+	Vect_read_line(map, pnts, cats_tmp, line);
 	if (cats_tmp && write_cats == MULTI_CATS) {
 	    for (cat_idx = 0; cat_idx < cats_tmp->n_cats; cat_idx++) {
 		Vect_cat_set(Cats, cats_tmp->field[cat_idx],



More information about the grass-commit mailing list