Browse Source

cosmetic changes and subregion debug dump to vector ascii

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52238 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 13 years ago
parent
commit
1dcda12aec
2 changed files with 34 additions and 14 deletions
  1. 27 12
      vector/v.surf.bspline/main.c
  2. 7 2
      vector/v.surf.bspline/v.surf.bspline.html

+ 27 - 12
vector/v.surf.bspline/main.c

@@ -225,7 +225,7 @@ int main(int argc, char *argv[])
     if (!(dvr = G__getenv2("DB_DRIVER", G_VAR_MAPSET)))
 	G_fatal_error(_("Unable to read name of driver"));
 
-    /* Setting auxiliar table's name */
+    /* Set auxiliary table's name */
     if (vector) {
 	if (G_name_is_fully_qualified(out_opt->answer, xname, xmapset)) {
 	    sprintf(table_name, "%s_aux", xname);
@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
 	    G_fatal_error(_("No database connection for driver <%s> is defined. Run db.connect."),
 			  dvr);
 	if (P_Drop_Aux_Table(driver, table_name) != DB_OK)
-	    G_fatal_error(_("Old auxiliar table could not be dropped"));
+	    G_fatal_error(_("Old auxiliary table could not be dropped"));
 	db_close_database_shutdown_driver(driver);
     }
 
@@ -320,8 +320,9 @@ int main(int argc, char *argv[])
     /* vector output */
     if (vector && !map) {
 	if (strcmp(dvr, "dbf") == 0)
-	    G_fatal_error(_("Sorry, <%s> driver is not allowed for vector output in this module. "
-			   "Try with a raster output or other driver."), dvr);
+	    G_fatal_error(_("Sorry, the <%s> driver is not compatible with "
+			  "the vector output of this module. "
+			  "Try with raster output or another driver."), dvr);
 
 	Vect_check_input_output_name(in_opt->answer, out_opt->answer,
 				     G_FATAL_EXIT);
@@ -362,7 +363,7 @@ int main(int argc, char *argv[])
 	db_CatValArray_init(&cvarr);
 	Fi = Vect_get_field(&In, bspline_field);
 	if (Fi == NULL)
-	    G_fatal_error(_("Cannot read field info"));
+	    G_fatal_error(_("Cannot read layer info"));
 
 	driver_cats = db_start_driver_open_database(Fi->driver, Fi->database);
 	/*G_debug (0, _("driver=%s db=%s"), Fi->driver, Fi->database); */
@@ -398,7 +399,7 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("No database connection for driver <%s> is defined. "
 			"Run db.connect."), dvr);
 
-    /* Create auxiliar table */
+    /* Create auxiliary table */
     if (vector) {
 	if ((flag_auxiliar = P_Create_Aux4_Table(driver, table_name)) == FALSE) {
 	    P_Drop_Aux_Table(driver, table_name);
@@ -435,12 +436,11 @@ int main(int argc, char *argv[])
 	if (seg_mb < 3)
 	    G_fatal_error(_("Memory in MB must be >= 3"));
 
-	if (mask_opt->answer ) {
+	if (mask_opt->answer)
 	    seg_size = sizeof(double) + sizeof(char);
-	}
-	else {
+	else
 	    seg_size = sizeof(double);
-	}
+
 	seg_size = (seg_size * SEGSIZE * SEGSIZE) / (1 << 20);
 	segments_in_memory = seg_mb / seg_size + 0.5;
 	G_debug(1, "%d %dx%d segments held in memory", segments_in_memory, SEGSIZE, SEGSIZE);
@@ -635,6 +635,21 @@ int main(int argc, char *argv[])
 	    G_debug(1, "Interpolation: \t\tSOUTH:%.2f",
 		    elaboration_reg.south);
 
+#ifdef DEBUG_SUBREGIONS
+	    fprintf(stdout, "B 5\n");
+	    fprintf(stdout, " %.11g %.11g\n", elaboration_reg.east, elaboration_reg.north);
+	    fprintf(stdout, " %.11g %.11g\n", elaboration_reg.west, elaboration_reg.north);
+	    fprintf(stdout, " %.11g %.11g\n", elaboration_reg.west, elaboration_reg.south);
+	    fprintf(stdout, " %.11g %.11g\n", elaboration_reg.east, elaboration_reg.south);
+	    fprintf(stdout, " %.11g %.11g\n", elaboration_reg.east, elaboration_reg.north);
+	    fprintf(stdout, "C 1 1\n");
+	    fprintf(stdout, " %.11g %.11g\n", (elaboration_reg.west + elaboration_reg.east) / 2,
+					      (elaboration_reg.south + elaboration_reg.north) / 2);
+	    fprintf(stdout, " 1 %d\n", subregion);
+#endif
+
+
+
 	    /* reading points in interpolation region */
 	    dim_vect = nsplx * nsply;
 	    observ_ext = NULL;
@@ -902,10 +917,10 @@ int main(int argc, char *argv[])
 	else
 	    P_Aux_to_Vector(&In_ext, &Out, driver, table_name);
 
-	/* Dropping auxiliar table */
+	/* Drop auxiliary table */
 	G_debug(1, "%s: Dropping <%s>", argv[0], table_name);
 	if (P_Drop_Aux_Table(driver, table_name) != DB_OK)
-	    G_fatal_error(_("Auxiliar table could not be dropped"));
+	    G_fatal_error(_("Auxiliary table could not be dropped"));
     }
 
     db_close_database_shutdown_driver(driver);

+ 7 - 2
vector/v.surf.bspline/v.surf.bspline.html

@@ -35,7 +35,7 @@ between observation points--can greatly increase processing time.
 
 <p>Moreover, the maximum number of splines for each direction at each time is
 fixed, regardless of the spline step length. As the total number of splines used
-increases (i.e., with small spline step lengths), the region is automatically
+increases (i.e., with small spline step lengths), the region is automatically split
 into subregions for interpolation. Each subregion can contain no more than
 150x150 splines. To avoid subregion boundary problems, subregions are created to
 partially overlap each other. A weighted mean of observations, based on point
@@ -72,6 +72,7 @@ the true point value and the estimated from the interpolation for a fixed series
 of <b><i>lambda_i</i></b> values. No vector nor raster output will be created
 when cross-validation is selected. 
 
+
 <h2>EXAMPLES</h2>
 
 <h3>Basic interpolation</h3>
@@ -129,6 +130,7 @@ this reason, vector map output "<b><i>output=</i></b>" is not permitted with the
 DBF driver. There are no problems with the raster map output from the DBF
 driver.
 
+
 <h2>SEE ALSO</h2>
 
 <em><a
@@ -136,6 +138,7 @@ href="http://grass.osgeo.org/grass64/manuals/html64_user/v.surf.idw.html">v.surf
 <a
 href="http://grass.osgeo.org/grass64/manuals/html64_user/v.surf.rst.html">v.surf.rst</a></em>
 
+
 <h2>AUTHORS</h2>
 
 Original version in GRASS 5.4: (s.bspline.reg)
@@ -145,6 +148,7 @@ Maria Antonia Brovelli, Massimiliano Cannata, Ulisse Longoni, Mirko Reguzzoni
 <br>
 Roberto Antolin
 
+
 <h2>REFERENCES</h2>
 
 Brovelli M. A., Cannata M., and Longoni U.M., 2004, LIDAR Data
@@ -161,4 +165,5 @@ dati LIDAR, Rivista dell'Agenzia del Territorio, n. 3-2003, pp. 11-22
 Determination of Digital Terrain Models. Proceedings of Jornadas de SIG Libre,
 Girona, Espa&ntilde;a. CD ISBN: 978-84-690-3886-9 <br>
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>