[GRASS-SVN] r55658 - grass-addons/grass7/raster/r.agent/libagent

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 8 06:14:10 PDT 2013


Author: mic
Date: 2013-04-08 06:14:10 -0700 (Mon, 08 Apr 2013)
New Revision: 55658

Modified:
   grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
render parsevectorlayer useful

Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py	2013-04-08 13:09:34 UTC (rev 55657)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py	2013-04-08 13:14:10 UTC (rev 55658)
@@ -105,9 +105,10 @@
             for v in layer.values():
                 # TODO do they all look like this??
                 if len(v) == 4 and v[0] == v[3]:
-                    x = ( v[1] - self.region["s"] ) / self.region["ewres"]
-                    y = ( v[1] - self.region["s"] ) / self.region["nsres"]
-                    vectors.append([x, y])
-                    self.layers[layername][y][x] = value
+                    p = self.stringcoordinate(v[1],v[2])
+                    p = ( p[0] - self.region["s"] ) / self.region["nsres"]
+                    p = ( p[1] - self.region["w"] ) / self.region["ewres"]
+                    vectors.append(p)
+                    self.layers[layername][p[0]][p[1]] = value
         return vectors
 



More information about the grass-commit mailing list