瀏覽代碼

Add some new attributes to the BoxList

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55926 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 12 年之前
父節點
當前提交
61f595adb0
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      lib/python/pygrass/vector/basic.py

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

@@ -140,6 +140,17 @@ class BoxList(object):
             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