[GRASS-SVN] r33100 - grass/trunk/vector/v.extrude
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 26 17:23:08 EDT 2008
Author: glynn
Date: 2008-08-26 17:23:08 -0400 (Tue, 26 Aug 2008)
New Revision: 33100
Modified:
grass/trunk/vector/v.extrude/main.c
Log:
Catch null values returned from G_get_raster_sample()
Modified: grass/trunk/vector/v.extrude/main.c
===================================================================
--- grass/trunk/vector/v.extrude/main.c 2008-08-26 21:01:42 UTC (rev 33099)
+++ grass/trunk/vector/v.extrude/main.c 2008-08-26 21:23:08 UTC (rev 33100)
@@ -405,6 +405,9 @@
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 (k == 0) {
voffset_dem = voffset_curr;
}
@@ -415,9 +418,9 @@
}
}
- k = 0;
+
/* walls */
- while (1) {
+ for (k = 0; ; k++) {
voffset_curr = voffset_next = 0.0;
/* trace */
@@ -425,11 +428,16 @@
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;
}
}
@@ -484,7 +492,6 @@
if (k >= Points->n_points - 2)
break;
}
- k++;
}
if (type & (GV_POINT | GV_LINE)) {
More information about the grass-commit
mailing list