[GRASS-SVN] r41110 - grass/trunk/vector/lidar/v.surf.bspline

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 19 03:30:15 EST 2010


Author: mmetz
Date: 2010-02-19 03:30:13 -0500 (Fri, 19 Feb 2010)
New Revision: 41110

Modified:
   grass/trunk/vector/lidar/v.surf.bspline/main.c
Log:
sync to v.surf.* modules in trunk

Modified: grass/trunk/vector/lidar/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/lidar/v.surf.bspline/main.c	2010-02-19 08:12:51 UTC (rev 41109)
+++ grass/trunk/vector/lidar/v.surf.bspline/main.c	2010-02-19 08:30:13 UTC (rev 41110)
@@ -63,7 +63,7 @@
     struct GModule *module;
     struct Option *in_opt, *in_ext_opt, *out_opt, *out_map_opt, *passoE_opt,
 	*passoN_opt, *lambda_f_opt, *type_opt, *dfield_opt, *col_opt;
-    struct Flag *cross_corr_flag, *spline_step_flag;
+    struct Flag *cross_corr_flag, *spline_step_flag, *withz_flag;
 
     struct Reg_dimens dims;
     struct Cell_head elaboration_reg, original_reg;
@@ -97,6 +97,11 @@
     spline_step_flag->description =
 	_("Estimate point density and distance for the input vector points within the current region extends and quit");
 
+    withz_flag = G_define_flag();
+    withz_flag->key = 'z';
+    withz_flag->description = _("Use z coordinates for approximation (3D vector maps only)");
+    withz_flag->guisection = _("Settings");
+
     in_opt = G_define_standard_option(G_OPT_V_INPUT);
 
     in_ext_opt = G_define_standard_option(G_OPT_V_INPUT);
@@ -148,10 +153,7 @@
     lambda_f_opt->guisection = _("Settings");
 
     dfield_opt = G_define_standard_option(G_OPT_V_FIELD);
-    dfield_opt->description =
-	_("If set to 0, z coordinates are used. (3D vector only)");
-    dfield_opt->answer = "0";
-    dfield_opt->gisprompt = "old_layer,layer,layer_zero";
+    dfield_opt->answer = "1";
     dfield_opt->guisection = _("Settings");
 
     col_opt = G_define_option();
@@ -227,13 +229,16 @@
     bspline_field = Vect_get_field_number(&In, dfield_opt->answer);
     bspline_column = col_opt->answer;
 
-    /* check availability of z values
-     * column option overrrides 3D z coordinates */
-    if (!Vect_is_3d(&In) && (bspline_field <= 0 || bspline_column == NULL))
-	G_fatal_error(_("Need either 3D vector or layer and column with z values"));
-    if (bspline_field > 0 && bspline_column == NULL)
-	G_fatal_error(_("Layer but not column with z values given"));
+    /* check availability of z values */
+    if (withz_flag->answer && !Vect_is_3d(&In)) {
+	G_fatal_error(_("Input vector is not 3D, can not use z coordinates"));
+    }
+    else if (!withz_flag->answer && (bspline_field <= 0 || bspline_column == NULL))
+	G_fatal_error(_("Both layer and column with z values must be given"));
 
+    if (withz_flag->answer)
+	bspline_field = 0;
+
     /* Estimate point density and mean distance for current region */
     if (spline_step_flag->answer) {
 	double dens, dist;



More information about the grass-commit mailing list