[GRASS-SVN] r58804 - grass/trunk/raster/r.contour
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 29 11:13:24 PST 2014
Author: martinl
Date: 2014-01-29 11:13:24 -0800 (Wed, 29 Jan 2014)
New Revision: 58804
Modified:
grass/trunk/raster/r.contour/main.c
Log:
r.contour: write attributes in one commit (speed-up)
Modified: grass/trunk/raster/r.contour/main.c
===================================================================
--- grass/trunk/raster/r.contour/main.c 2014-01-29 18:10:41 UTC (rev 58803)
+++ grass/trunk/raster/r.contour/main.c 2014-01-29 19:13:24 UTC (rev 58804)
@@ -193,7 +193,10 @@
n_cut = atoi(cut->answer);
contour(lev, nlevels, Map, z_array, Wind, n_cut);
+ G_message(_("Writing attributes..."));
/* Write levels */
+
+ db_begin_transaction(Driver);
for (i = 0; i < nlevels; i++) {
sprintf(buf, "insert into %s values ( %d, %e )", Fi->table, i + 1,
lev[i]);
@@ -205,6 +208,7 @@
G_fatal_error(_("Unable to insert new record: '%s'"), db_get_string(&sql));
}
}
+ db_commit_transaction(Driver);
db_close_database_shutdown_driver(Driver);
More information about the grass-commit
mailing list