[GRASS-SVN] r52238 - grass/trunk/vector/v.surf.bspline
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 27 03:43:33 PDT 2012
Author: hamish
Date: 2012-06-27 03:43:33 -0700 (Wed, 27 Jun 2012)
New Revision: 52238
Modified:
grass/trunk/vector/v.surf.bspline/main.c
grass/trunk/vector/v.surf.bspline/v.surf.bspline.html
Log:
cosmetic changes and subregion debug dump to vector ascii
Modified: grass/trunk/vector/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/v.surf.bspline/main.c 2012-06-27 08:24:50 UTC (rev 52237)
+++ grass/trunk/vector/v.surf.bspline/main.c 2012-06-27 10:43:33 UTC (rev 52238)
@@ -225,7 +225,7 @@
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 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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);
Modified: grass/trunk/vector/v.surf.bspline/v.surf.bspline.html
===================================================================
--- grass/trunk/vector/v.surf.bspline/v.surf.bspline.html 2012-06-27 08:24:50 UTC (rev 52237)
+++ grass/trunk/vector/v.surf.bspline/v.surf.bspline.html 2012-06-27 10:43:33 UTC (rev 52238)
@@ -35,7 +35,7 @@
<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 @@
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 @@
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 @@
<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 @@
<br>
Roberto Antolin
+
<h2>REFERENCES</h2>
Brovelli M. A., Cannata M., and Longoni U.M., 2004, LIDAR Data
@@ -161,4 +165,5 @@
Determination of Digital Terrain Models. Proceedings of Jornadas de SIG Libre,
Girona, España. CD ISBN: 978-84-690-3886-9 <br>
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>
More information about the grass-commit
mailing list