[GRASS-SVN] r49232 - grass/trunk/vector/v.db.select

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 14 03:20:00 EST 2011


Author: martinl
Date: 2011-11-14 00:20:00 -0800 (Mon, 14 Nov 2011)
New Revision: 49232

Modified:
   grass/trunk/vector/v.db.select/main.c
Log:
v.db.select: better check feature type (-r flag)


Modified: grass/trunk/vector/v.db.select/main.c
===================================================================
--- grass/trunk/vector/v.db.select/main.c	2011-11-14 08:19:18 UTC (rev 49231)
+++ grass/trunk/vector/v.db.select/main.c	2011-11-14 08:20:00 UTC (rev 49232)
@@ -8,7 +8,7 @@
  *               
  * PURPOSE:      Print vector attributes
  *               
- * COPYRIGHT:    (C) 2005-2009 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2005-2009, 2011 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that
@@ -230,11 +230,13 @@
 	    Vect_cidx_find_all(&Map, Vect_get_field_number(&Map, field_opt->answer), -1, cat, list_lines);
 	    for (i = 0; i < list_lines->n_values; i++) {
 		line = list_lines->value[i];
-		area = Vect_get_centroid_area(&Map, line);
-		if (area > 0) {
-		    if (!Vect_get_area_box(&Map, area, line_box))
-			G_fatal_error(_("Unable to get bounding box of area %d"),
-				      area);
+		if (Vect_get_line_type(&Map, line) == GV_CENTROID) {
+		    area = Vect_get_centroid_area(&Map, line);
+		    if (area > 0) {
+			if (!Vect_get_area_box(&Map, area, line_box))
+			    G_fatal_error(_("Unable to get bounding box of area %d"),
+					  area);
+		    }
 		}
 		else {
 		    if (!Vect_get_line_box(&Map, line, line_box))



More information about the grass-commit mailing list