[GRASS-SVN] r54592 - grass/trunk/lib/python/pygrass/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 11 08:38:13 PST 2013


Author: zarch
Date: 2013-01-11 08:38:12 -0800 (Fri, 11 Jan 2013)
New Revision: 54592

Modified:
   grass/trunk/lib/python/pygrass/gis/region.py
Log:
Add a method to return a Bbox object of the region

Modified: grass/trunk/lib/python/pygrass/gis/region.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/region.py	2013-01-11 16:38:02 UTC (rev 54591)
+++ grass/trunk/lib/python/pygrass/gis/region.py	2013-01-11 16:38:12 UTC (rev 54592)
@@ -221,4 +221,10 @@
     def set_default(self):
         self.adjust()
         if libgis.G_put_window(self.c_region) < 0:
-            raise GrassError("Cannot change region (WIND file).")
\ No newline at end of file
+            raise GrassError("Cannot change region (WIND file).")
+
+    def bbox(self):
+        from pygrass.vector.basic import Bbox
+        return Bbox(north=self.north, south=self.south,
+                    east=self.east, west=self.west,
+                    top=self.top, bottom=self.bottom)
\ No newline at end of file



More information about the grass-commit mailing list