[cig-commits] r15443 - cs/spatialdata-0.1/trunk/spatialdata/spatialdb/generator

brad at geodynamics.org brad at geodynamics.org
Wed Jul 8 13:24:00 PDT 2009


Author: brad
Date: 2009-07-08 13:24:00 -0700 (Wed, 08 Jul 2009)
New Revision: 15443

Modified:
   cs/spatialdata-0.1/trunk/spatialdata/spatialdb/generator/Shaper.py
Log:
Switched to using multiquery().

Modified: cs/spatialdata-0.1/trunk/spatialdata/spatialdb/generator/Shaper.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/spatialdb/generator/Shaper.py	2009-07-08 20:13:28 UTC (rev 15442)
+++ cs/spatialdata-0.1/trunk/spatialdata/spatialdb/generator/Shaper.py	2009-07-08 20:24:00 UTC (rev 15443)
@@ -104,12 +104,9 @@
 
     self.db.queryVals([self.dbValue])
     v = numpy.zeros( (1,), dtype=numpy.float64)
-    vals = numpy.zeros( (nlocs,), dtype=numpy.float64)
+    vals = numpy.zeros( (nlocs, 1), dtype=numpy.float64)
     err = numpy.ones( (nlocs,), dtype=numpy.int32)
-    for i in xrange(nlocs):
-      e = self.db.query(v, locs[i,:], cs)
-      vals[i] = v[0]
-      err[i] = e
+    self.db.multiquery(vals, err, locs, cs)
     vals = numpy.reshape(numpy.array(vals), -1)
     default = self.defaultValue*numpy.ones( vals.shape, dtype=numpy.float64)
     mask = numpy.zeros( vals.shape, dtype=numpy.float64)



More information about the CIG-COMMITS mailing list