Explorar o código

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 %!s(int64=12) %!d(string=hai) anos
pai
achega
ec4ad24abb
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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)