[GRASS-SVN] r36428 - in grass/trunk: lib/rst/interp_float vector/v.surf.rst

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 19 13:26:38 EDT 2009


Author: martinl
Date: 2009-03-19 13:26:38 -0400 (Thu, 19 Mar 2009)
New Revision: 36428

Modified:
   grass/trunk/lib/rst/interp_float/init2d.c
   grass/trunk/lib/rst/interp_float/interpf.h
   grass/trunk/vector/v.surf.rst/main.c
Log:
v.surf.rst: flag 'z' added


Modified: grass/trunk/lib/rst/interp_float/init2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/init2d.c	2009-03-19 17:13:04 UTC (rev 36427)
+++ grass/trunk/lib/rst/interp_float/init2d.c	2009-03-19 17:26:38 UTC (rev 36428)
@@ -43,7 +43,7 @@
 			  FILE * t1, FILE * t2, FILE * t3, FILE * t4, FILE * t5, FILE * t6,	/* temp files for writing interp. values */
 			  FILE * dev,	/* pointer to deviations file */
 			  struct TimeStamp *ts, int c,	/* cross validation */
-			  char *wheresql	/* SQL WHERE */
+			  const char *wheresql	/* SQL WHERE */
     )
 {
     params->fdinp = inp;

Modified: grass/trunk/lib/rst/interp_float/interpf.h
===================================================================
--- grass/trunk/lib/rst/interp_float/interpf.h	2009-03-19 17:13:04 UTC (rev 36427)
+++ grass/trunk/lib/rst/interp_float/interpf.h	2009-03-19 17:26:38 UTC (rev 36428)
@@ -86,7 +86,7 @@
 		       char *, char *, char *, char *, char *, char *,
 		       double, double, double, int, double, double,
 		       FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *,
-		       struct TimeStamp *, int, char *);
+		       struct TimeStamp *, int, const char *);
 
 void IL_init_func_2d(struct interp_params *, int (*)(), int (*)(), int (*)(),
 		     int (*)(), double (*)(), int (*)(), int (*)());

Modified: grass/trunk/vector/v.surf.rst/main.c
===================================================================
--- grass/trunk/vector/v.surf.rst/main.c	2009-03-19 17:13:04 UTC (rev 36427)
+++ grass/trunk/vector/v.surf.rst/main.c	2009-03-19 17:26:38 UTC (rev 36428)
@@ -138,7 +138,7 @@
     } parm;
     struct
     {
-	struct Flag *deriv, *cprght, *cv;
+	struct Flag *deriv, *cprght, *cv, *withz;
     } flag;
 
 
@@ -168,11 +168,14 @@
 	_("Output partial derivatives instead of topographic parameters");
     flag.deriv->guisection = _("Outputs");
 
+    flag.withz = G_define_flag();
+    flag.withz->key = 'z';
+    flag.withz->description = _("Use z coordinates for approximation");
+    flag.withz->guisection = _("Parameters");
+    
     parm.input = G_define_standard_option(G_OPT_V_INPUT);
 
     parm.field = G_define_standard_option(G_OPT_V_FIELD);
-    parm.field->description =
-	_("If set to 0, z coordinates are used. (3D vector only)");
     parm.field->answer = "1";
     parm.field->guisection = _("Selection");
 
@@ -255,7 +258,7 @@
     parm.zcol->type = TYPE_STRING;
     parm.zcol->required = NO;
     parm.zcol->description =
-	_("Name of the attribute column with values to be used for approximation (if layer>0)");
+	_("Name of the attribute column with values to be used for approximation");
     parm.zcol->guisection = _("Parameters");
 
     parm.fi = G_define_option();
@@ -414,11 +417,7 @@
 	&& (slope == NULL) && (aspect == NULL) && (devi == NULL)
 	&& (cvdev == NULL))
 	G_warning(_("You are not outputting any raster or vector maps"));
-
-    if (parm.wheresql->answer != NULL) {
-	if (field < 1)
-	    G_fatal_error(_("'layer' must be > 0 for 'where'."));
-    }
+    
     cond2 = ((pcurv != NULL) || (tcurv != NULL) || (mcurv != NULL));
     cond1 = ((slope != NULL) || (aspect != NULL) || cond2);
     deriv = flag.deriv->answer;
@@ -599,7 +598,8 @@
 		    IL_crstg, IL_write_temp_2d);
 
     totsegm =
-	IL_vector_input_data_2d(&params, &Map, field, zcol, scol,
+	IL_vector_input_data_2d(&params, &Map, flag.withz ? 0 : field,
+				zcol, scol,
 				info, &xmin, &xmax,
 				&ymin, &ymax, &zmin, &zmax, &NPOINT, &dmax);
     if (totsegm <= 0) {



More information about the grass-commit mailing list