Sfoglia il codice sorgente

v.what: adjust for new topology

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53381 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 anni fa
parent
commit
05101ba68a
1 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. 7 3
      vector/v.what/what.c

+ 7 - 3
vector/v.what/what.c

@@ -247,7 +247,10 @@ void what(struct Map_info *Map, int nvects, char **vect, double east, double nor
 		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 @@ void what(struct Map_info *Map, int nvects, char **vect, double east, double nor
 		    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;