Browse Source

d.vect: -z flag works for all vector types

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47492 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
1702d10acb
2 changed files with 12 additions and 7 deletions
  1. 6 2
      display/d.vect/lines.c
  2. 6 5
      display/d.vect/main.c

+ 6 - 2
display/d.vect/lines.c

@@ -76,7 +76,11 @@ int display_lines(struct Map_info *Map, int type, struct cat_list *Clist,
 	G_warning(_("Unable to display lines by id, topology not available. "
 		    "Please try to rebuild topology using "
 		    "v.build or v.build.all."));
-	return 1;
+    }
+
+    if (z_color_flag && !Vect_is_3d(Map)) {
+	G_warning(_("Vector map is not 3D. Unable to colorize features based on z-coordinates."));
+	z_color_flag = 0;
     }
 
     var_size = size;
@@ -191,7 +195,7 @@ int display_lines(struct Map_info *Map, int type, struct cat_list *Clist,
 	}
 
 	/* z height colors */
-	if (z_color_flag && Vect_is_3d(Map)) {
+	if (z_color_flag) {
 	    struct bound_box box;
 	    double zval;
 	    struct Colors colors;

+ 6 - 5
display/d.vect/main.c

@@ -355,7 +355,7 @@ int main(int argc, char **argv)
 
     zcol_flag = G_define_flag();
     zcol_flag->key = 'z';
-    zcol_flag->description = _("Colorize polygons according to z height");
+    zcol_flag->description = _("Colorize features according to z-coordinate");
     zcol_flag->guisection = _("Colors");
 
     sqrt_flag = G_define_flag();
@@ -525,13 +525,14 @@ int main(int argc, char **argv)
     D_save_command(G_recreate_command());
     D_close_driver();
 
-    G_done_msg(" ");
-
     Vect_close(&Map);
     Vect_destroy_cat_list(Clist);
 
-    if (stat != 0)
+    if (stat != 0) {
+	G_fatal_error(_("Rendering failed"));
 	exit(EXIT_FAILURE);
-
+    }
+    
+    G_done_msg(" ");
     exit(EXIT_SUCCESS);
 }