[GRASS-SVN] r71216 - grass-addons/grass7/raster/r.stream.snap

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 24 07:49:49 PDT 2017


Author: annakrat
Date: 2017-06-24 07:49:49 -0700 (Sat, 24 Jun 2017)
New Revision: 71216

Modified:
   grass-addons/grass7/raster/r.stream.snap/points_io.c
Log:
r.stream.snap: fix reading input points without topology, now topology level is not required

Modified: grass-addons/grass7/raster/r.stream.snap/points_io.c
===================================================================
--- grass-addons/grass7/raster/r.stream.snap/points_io.c	2017-06-24 14:21:45 UTC (rev 71215)
+++ grass-addons/grass7/raster/r.stream.snap/points_io.c	2017-06-24 14:49:49 UTC (rev 71216)
@@ -6,8 +6,7 @@
     struct Map_info Map;
     struct bound_box box;
     int num_point = 0;
-    int total_points = 0;
-    int type, i, j, cat;
+    int type, i, cat;
     struct line_pnts *sites;
     struct line_cats *cats;
     double absaccum;
@@ -28,13 +27,10 @@
     }
 
     points = (OUTLET *) G_malloc(num_point * sizeof(OUTLET));
-    total_points = Vect_get_num_lines(&Map);
+    Vect_rewind(&Map);
     i = 0;
+    while ((type = Vect_read_next_line(&Map, sites, cats)) > -1) {
 
-    for (j = 0; j < total_points; ++j) {
-
-	type = Vect_read_line(&Map, sites, cats, j + 1);
-
 	if (type != GV_POINT)
 	    continue;
 



More information about the grass-commit mailing list