Browse Source

Add a method to return a Bbox object of the region

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54592 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 12 years ago
parent
commit
ec4ad24abb
1 changed files with 7 additions and 1 deletions
  1. 7 1
      lib/python/pygrass/gis/region.py

+ 7 - 1
lib/python/pygrass/gis/region.py

@@ -221,4 +221,10 @@ class Region(object):
     def set_default(self):
         self.adjust()
         if libgis.G_put_window(self.c_region) < 0:
-            raise GrassError("Cannot change region (WIND 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)