[GRASS-SVN] r33120 - grass/branches/develbranch_6/vector/v.extrude

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 27 09:58:19 EDT 2008


Author: neteler
Date: 2008-08-27 09:58:19 -0400 (Wed, 27 Aug 2008)
New Revision: 33120

Modified:
   grass/branches/develbranch_6/vector/v.extrude/main.c
Log:
glynn: Fix null tests to handle loop termination correctly (merge from trunk, r33118)

Modified: grass/branches/develbranch_6/vector/v.extrude/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.extrude/main.c	2008-08-27 13:19:22 UTC (rev 33119)
+++ grass/branches/develbranch_6/vector/v.extrude/main.c	2008-08-27 13:58:19 UTC (rev 33120)
@@ -426,19 +426,30 @@
 	    voffset_curr = G_get_raster_sample(fdrast, &window, NULL,
 					       Points->y[k], Points->x[k], 0,
 					       NEAREST);
-	    if (G_is_d_null_value(&voffset_curr))
-		continue;
 
 	    if (type != GV_POINT) {
 		voffset_next = G_get_raster_sample(fdrast, &window, NULL,
 						   Points->y[k + 1],
 						   Points->x[k + 1], 0,
 						   NEAREST);
-		if (G_is_d_null_value(&voffset_next))
-		    continue;
 	    }
 	}
 
+	if (G_is_d_null_value(&voffset_curr) ||
+	    G_is_d_null_value(&voffset_next)) {
+	    if (type == GV_POINT)
+		break;
+	    else if (type == GV_LINE) {
+		if (k >= Points->n_points - 1)
+		    break;
+	    }
+	    else if (type & (GV_BOUNDARY | GV_AREA)) {
+		if (k >= Points->n_points - 2)
+		    break;
+	    }
+	    continue;
+	}
+
 	if (trace) {
 	    voffset_curr += voffset;
 	    voffset_next += voffset;



More information about the grass-commit mailing list