[GRASS-SVN] r58828 - grass/branches/develbranch_6/raster/r.contour

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 1 13:01:33 PST 2014


Author: neteler
Date: 2014-02-01 13:01:33 -0800 (Sat, 01 Feb 2014)
New Revision: 58828

Modified:
   grass/branches/develbranch_6/raster/r.contour/main.c
Log:
r.contour: write attributes in one commit (speed-up, backport trunk r58804)

Modified: grass/branches/develbranch_6/raster/r.contour/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.contour/main.c	2014-02-01 21:01:14 UTC (rev 58827)
+++ grass/branches/develbranch_6/raster/r.contour/main.c	2014-02-01 21:01:33 UTC (rev 58828)
@@ -212,7 +212,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]);
@@ -224,6 +227,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