[GRASS-SVN] r45101 - grass/trunk/vector/v.transform

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 20 10:56:45 EST 2011


Author: martinl
Date: 2011-01-20 07:56:45 -0800 (Thu, 20 Jan 2011)
New Revision: 45101

Modified:
   grass/trunk/vector/v.transform/main.c
Log:
v.transform: fix dim of output vector map, be more verbose


Modified: grass/trunk/vector/v.transform/main.c
===================================================================
--- grass/trunk/vector/v.transform/main.c	2011-01-20 13:44:05 UTC (rev 45100)
+++ grass/trunk/vector/v.transform/main.c	2011-01-20 15:56:45 UTC (rev 45101)
@@ -1,4 +1,3 @@
-
 /****************************************************************************
 *
 * MODULE:       v.transform
@@ -224,9 +223,10 @@
 
     /* open vector maps */
     Vect_open_old2(&Old, vold->answer, "", field->answer);
+    Vect_open_new(&New, vnew->answer, Vect_is_3d(&Old) || tozero_flag->answer ||
+		  strcmp(zshift->answer, "0.0") || strcmp(zscale->answer, "1.0") || 
+		  strcmp(zrot->answer, "0.0") ? WITH_Z : WITHOUT_Z);
 
-    Vect_open_new(&New, vnew->answer, Vect_is_3d(&Old) || zshift->answer);
-
     /* copy and set header */
     Vect_copy_head_data(&Old, &New);
 
@@ -311,24 +311,24 @@
     trans_params[IDX_ZSCALE] = atof(zscale->answer);
     trans_params[IDX_ZROT] = atof(zrot->answer);
 
+    G_important_message(_("Tranforming features..."));
     transform_digit_file(&Old, &New, Coord.name[0] ? 1 : 0,
 			 ztozero, swap_flag->answer, trans_params,
 			 table->answer, columns_name, Vect_get_field_number(&Old, field->answer));
 
+    G_important_message(_("Copying attributes..."));
     if (Vect_copy_tables(&Old, &New, 0))
         G_warning(_("Failed to copy attribute table to output map"));
     Vect_close(&Old);
     Vect_build(&New);
 
-    if (G_verbose() > G_verbose_std()) {
-	Vect_get_map_box(&New, &box);
-	G_message(_("\nNew vector map <%s> boundary coordinates:"),
-		  vnew->answer);
-	G_message(_(" N: %-10.3f    S: %-10.3f"), box.N, box.S);
-	G_message(_(" E: %-10.3f    W: %-10.3f"), box.E, box.W);
-	G_message(_(" B: %6.3f    T: %6.3f"), box.B, box.T);
-    }
-
+    Vect_get_map_box(&New, &box);
+    G_verbose_message(_("New vector map <%s> boundary coordinates:"),
+		      vnew->answer);
+    G_verbose_message(_(" N: %-10.3f    S: %-10.3f"), box.N, box.S);
+    G_verbose_message(_(" E: %-10.3f    W: %-10.3f"), box.E, box.W);
+    G_verbose_message(_(" B: %6.3f    T: %6.3f"), box.B, box.T);
+    
     /* print the transformation matrix if requested */
     if (print_mat_flag->answer)
       print_transform_matrix();



More information about the grass-commit mailing list