[GRASS-SVN] r55926 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 20 02:38:56 PDT 2013


Author: zarch
Date: 2013-04-20 02:38:56 -0700 (Sat, 20 Apr 2013)
New Revision: 55926

Modified:
   grass/trunk/lib/python/pygrass/vector/basic.py
Log:
Add some new attributes to the BoxList

Modified: grass/trunk/lib/python/pygrass/vector/basic.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/basic.py	2013-04-20 09:36:19 UTC (rev 55925)
+++ grass/trunk/lib/python/pygrass/vector/basic.py	2013-04-20 09:38:56 UTC (rev 55926)
@@ -140,6 +140,17 @@
             for box in boxlist:
                 self.append(box)
 
+    @property
+    def ids(self):
+        return [self.c_boxlist.contents.id[i] for i in range(self.n_values)]
+
+    @property
+    def n_values(self):
+        return self.c_boxlist.contents.n_values
+
+    def have_boxes(self):
+        return bool(self.c_boxlist.contents.have_boxes)
+
     def __len__(self):
         return self.c_boxlist.contents.n_values
 



More information about the grass-commit mailing list