[GRASS-SVN] r56683 - grass/trunk/lib/python/pygrass/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 11 05:33:38 PDT 2013


Author: zarch
Date: 2013-06-11 05:33:37 -0700 (Tue, 11 Jun 2013)
New Revision: 56683

Modified:
   grass/trunk/lib/python/pygrass/raster/abstract.py
Log:
Fix bug get_value method, row and col were inverted.

Modified: grass/trunk/lib/python/pygrass/raster/abstract.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/abstract.py	2013-06-11 09:25:22 UTC (rev 56682)
+++ grass/trunk/lib/python/pygrass/raster/abstract.py	2013-06-11 12:33:37 UTC (rev 56683)
@@ -399,11 +399,11 @@
         """
         if not region:
             region = Region()
-        x, y = functions.coor2pixel(point.coords(), region)
-        if x < 0 or x > region.cols or y < 0 or y > region.rows:
+        row, col = functions.coor2pixel(point.coords(), region)
+        if col < 0 or col > region.cols or row < 0 or row > region.rows:
             return None
-        line = self.get_row(int(x))
-        return line[int(y)]
+        line = self.get_row(int(row))
+        return line[int(col)]
 
     @must_be_open
     def has_cats(self):



More information about the grass-commit mailing list