[GRASS-SVN] r50092 - grass/branches/develbranch_6/vector/v.extrude
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 7 12:29:28 EST 2012
Author: neteler
Date: 2012-01-07 09:29:28 -0800 (Sat, 07 Jan 2012)
New Revision: 50092
Modified:
grass/branches/develbranch_6/vector/v.extrude/main.c
Log:
v.extrude: file descriptor can be zero (backport from trunk, r50082); backport of informative G_done_msg()
Modified: grass/branches/develbranch_6/vector/v.extrude/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.extrude/main.c 2012-01-07 17:29:17 UTC (rev 50091)
+++ grass/branches/develbranch_6/vector/v.extrude/main.c 2012-01-07 17:29:28 UTC (rev 50092)
@@ -42,11 +42,12 @@
struct Map_info In, Out;
struct line_pnts *Points;
struct line_cats *Cats;
+ struct bound_box map_box;
struct Cell_head window;
struct cat_list *Clist;
- int i, only_type, cat, ctype, fdrast = 0, areanum = 0;
+ int i, only_type, cat, ctype, fdrast = -1, areanum = 0;
int nelements;
int line, type;
int area, trace, centroid;
@@ -131,7 +132,7 @@
trace = (t_flag->answer) ? 1 : 0;
area = (only_type & GV_AREA) ? 1 : 0;
if (area && (only_type & GV_BOUNDARY)) {
- /* do not wrire wall twice -> disable boundary type */
+ /* do not write wall twice -> disable boundary type */
only_type &= ~GV_BOUNDARY;
}
@@ -342,12 +343,16 @@
Vect_set_comment(&Out, comment);
G_free(comment);
+ Vect_get_map_box(&Out, &map_box);
+
Vect_close(&In);
Vect_close(&Out);
Vect_destroy_line_struct(Points);
Vect_destroy_cats_struct(Cats);
+ G_done_msg("T: %f B: %f.", map_box.T, map_box.B);
+
exit(EXIT_SUCCESS);
}
@@ -396,7 +401,7 @@
voffset_dem = 0.0;
/* do not trace -> calculate minumum dem offset */
- if (fdrast && !trace) {
+ if (fdrast >= 0 && !trace) {
for (k = 0; k < Points->n_points; k++) {
voffset_curr = G_get_raster_sample(fdrast, &window, NULL,
Points->y[k], Points->x[k], 0,
@@ -420,7 +425,7 @@
voffset_curr = voffset_next = 0.0;
/* trace */
- if (fdrast && trace) {
+ if (fdrast >= 0 && trace) {
voffset_curr = G_get_raster_sample(fdrast, &window, NULL,
Points->y[k], Points->x[k], 0,
NEAREST);
@@ -492,6 +497,7 @@
nlines++;
if (type == GV_AREA) {
+ /* roof */
Vect_append_point(Points_roof, Points->x[k], Points->y[k],
Points->z[k] + objheight + voffset_curr);
}
More information about the grass-commit
mailing list