[GRASS-SVN] r73820 - grass/trunk/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 21 13:39:49 PST 2018


Author: mmetz
Date: 2018-12-21 13:39:48 -0800 (Fri, 21 Dec 2018)
New Revision: 73820

Modified:
   grass/trunk/vector/v.distance/main.c
Log:
v.distance: speed improvement for small dmax

Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c	2018-12-20 18:51:10 UTC (rev 73819)
+++ grass/trunk/vector/v.distance/main.c	2018-12-21 21:39:48 UTC (rev 73820)
@@ -503,6 +503,20 @@
 	max_step[0] = max_map;
     }
 
+    if (max > 0) {
+	G_debug(2, "reduce max steps");
+	for (i = 0; i < n_max_steps; i++) {
+	    if (max_step[i] > max) {
+		if (i == 1) {
+		    i = 0;
+		}
+		n_max_steps = i + 1;
+		max_step[i] = max;
+		break;
+	    }
+	}
+    }
+
     /* Open database driver */
     db_init_string(&stmt);
     db_init_string(&dbstr);



More information about the grass-commit mailing list