|
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
|
|
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 @@ int main(int argc, char *argv[])
|
|
|
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 @@ int main(int argc, char *argv[])
|
|
|
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,12 +229,15 @@ int main(int argc, char *argv[])
|
|
|
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) {
|