[GRASS-SVN] r47917 - in grass/trunk/lib/vector: Vlib diglib
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 28 04:51:14 EDT 2011
Author: martinl
Date: 2011-08-28 01:51:14 -0700 (Sun, 28 Aug 2011)
New Revision: 47917
Modified:
grass/trunk/lib/vector/Vlib/box.c
grass/trunk/lib/vector/diglib/box.c
Log:
vlib: Vect_get_line_box(): set T/B to PORT_DOUBLE_MAX for 2D data
Modified: grass/trunk/lib/vector/Vlib/box.c
===================================================================
--- grass/trunk/lib/vector/Vlib/box.c 2011-08-28 08:49:56 UTC (rev 47916)
+++ grass/trunk/lib/vector/Vlib/box.c 2011-08-28 08:51:14 UTC (rev 47917)
@@ -213,12 +213,7 @@
Line = Plus->Line[line];
if (Line == NULL) { /* dead */
- Box->N = 0;
- Box->S = 0;
- Box->E = 0;
- Box->W = 0;
- Box->T = 0;
- Box->B = 0;
+ G_zero(Box, sizeof(struct bound_box));
return 0;
}
else {
@@ -263,7 +258,7 @@
dig_boxlist_add(list, line, bbox);
if (dig_find_line_box(Plus, list) == 0)
- G_fatal_error(_("Could not find line box"));
+ G_fatal_error(_("Unable to find bbox for featured %d"), line);
Box->N = list->box[0].N;
Box->S = list->box[0].S;
@@ -274,6 +269,11 @@
}
}
+ if (!Vect_is_3d(Map)) {
+ Box->T = PORT_DOUBLE_MAX;
+ Box->B = -PORT_DOUBLE_MAX;
+ }
+
return 1;
}
Modified: grass/trunk/lib/vector/diglib/box.c
===================================================================
--- grass/trunk/lib/vector/diglib/box.c 2011-08-28 08:49:56 UTC (rev 47916)
+++ grass/trunk/lib/vector/diglib/box.c 2011-08-28 08:51:14 UTC (rev 47917)
@@ -26,12 +26,7 @@
int i;
if (Points->n_points <= 0) {
- Box->N = 0;
- Box->S = 0;
- Box->E = 0;
- Box->W = 0;
- Box->T = 0;
- Box->B = 0;
+ G_zero(Box, sizeof(struct bound_box));
return 0;
}
More information about the grass-commit
mailing list