Explorar el Código

Add a new method to the Bbox class that return a tuple with the bbox values.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56333 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli hace 12 años
padre
commit
b27134f2b8
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      lib/python/pygrass/vector/basic.py

+ 12 - 0
lib/python/pygrass/vector/basic.py

@@ -129,6 +129,18 @@ class Bbox(object):
                 ('east', self.east), ('west', self.west),
                 ('top', self.top), ('bottom', self.bottom)]
 
+    def nsewtb(self, is3d=False):
+        """Return a list
+
+        If is3d parameter is False return only:
+        north, south, east, west
+        """
+        if is3d:
+            return (self.north, self.south, self.east, self.west,
+                    self.top, self.bottom)
+        else:
+            return (self.north, self.south, self.east, self.west)
+
 
 class BoxList(object):
     """Instantiate a BoxList class to create a list of Bounding Box"""