Procházet zdrojové kódy

v.db.select: better check feature type (-r flag)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49232 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa před 13 roky
rodič
revize
480a90191e
1 změnil soubory, kde provedl 8 přidání a 6 odebrání
  1. 8 6
      vector/v.db.select/main.c

+ 8 - 6
vector/v.db.select/main.c

@@ -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 @@ int main(int argc, char **argv)
 	    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))