[GRASS-SVN] r53381 - grass/trunk/vector/v.what

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 13 04:01:55 PDT 2012


Author: mmetz
Date: 2012-10-13 04:01:54 -0700 (Sat, 13 Oct 2012)
New Revision: 53381

Modified:
   grass/trunk/vector/v.what/what.c
Log:
v.what: adjust for new topology

Modified: grass/trunk/vector/v.what/what.c
===================================================================
--- grass/trunk/vector/v.what/what.c	2012-10-13 11:00:19 UTC (rev 53380)
+++ grass/trunk/vector/v.what/what.c	2012-10-13 11:01:54 UTC (rev 53381)
@@ -247,7 +247,10 @@
 		int n, node[2], nnodes, nnlines, nli, nodeline, left, right;
 		float angle;
 
-		Vect_get_line_areas(&(Map[i]), line, &left, &right);
+		if (type & GV_BOUNDARY)
+		    Vect_get_line_areas(&(Map[i]), line, &left, &right);
+		else
+		    left = right = 0;
 		if (script) {
 		    fprintf(stdout, "Feature_max_distance=%f\n", maxdist);
 		    fprintf(stdout,
@@ -266,12 +269,13 @@
 		    fprintf(stdout, _("Length: %f\n"), l);
 		}
 		else {		/* points */
-		    nnodes = 1;
+		    nnodes = 0;
 		    if (!script)
 			fprintf(stdout, "\n");
 		}
 
-		Vect_get_line_nodes(&(Map[i]), line, &node[0], &node[1]);
+		if (nnodes > 0)
+		    Vect_get_line_nodes(&(Map[i]), line, &node[0], &node[1]);
 
 		for (n = 0; n < nnodes; n++) {
 		    double nx, ny, nz;



More information about the grass-commit mailing list