[GRASS-SVN] r58707 - grass/trunk/scripts/v.rast.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 13 10:40:43 PST 2014


Author: martinl
Date: 2014-01-13 10:40:43 -0800 (Mon, 13 Jan 2014)
New Revision: 58707

Modified:
   grass/trunk/scripts/v.rast.stats/v.rast.stats.py
Log:
v.rast.stats: speed-up - use db transactions


Modified: grass/trunk/scripts/v.rast.stats/v.rast.stats.py
===================================================================
--- grass/trunk/scripts/v.rast.stats/v.rast.stats.py	2014-01-13 18:40:05 UTC (rev 58706)
+++ grass/trunk/scripts/v.rast.stats/v.rast.stats.py	2014-01-13 18:40:43 UTC (rev 58707)
@@ -224,6 +224,7 @@
                       zones = rastertmp, percentile = percentile, sep = ';')
 
     first_line = 1
+    f.write("BEGIN TRANSACTION\n")
     for line in p.stdout:
 	if first_line:
 	    first_line = 0
@@ -250,6 +251,7 @@
 		i += 1
 
 	f.write(" WHERE %s=%s;\n" % (fi['key'], vars[0]))
+    f.write("COMMIT\n")
 
     p.wait()
     f.close()



More information about the grass-commit mailing list