Jelajahi Sumber

Add a method to VectorTopo class to access directly to the geometry feature through the cat.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56688 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 12 tahun lalu
induk
melakukan
c7eac4c04e
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      lib/python/pygrass/vector/__init__.py

+ 7 - 0
lib/python/pygrass/vector/__init__.py

@@ -384,6 +384,13 @@ class VectorTopo(Vector):
         libvect.Vect_rewind(self.c_mapinfo)
 
     @must_be_open
+    def cat(self, cat_id):
+        """Return a list of geometry features with category == cat_id.
+        """
+        return self.read(libvect.Vect_get_line_cat(self.c_mapinfo,
+                                                   cat_id, self.layer))
+
+    @must_be_open
     def read(self, feature_id):
         """Return a geometry object given the feature id. ::