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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 13 01:08:58 PDT 2013


Author: zarch
Date: 2013-06-13 01:08:58 -0700 (Thu, 13 Jun 2013)
New Revision: 56688

Modified:
   grass/trunk/lib/python/pygrass/vector/__init__.py
Log:
Add a method to VectorTopo class to access directly to the geometry feature through the cat.

Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py	2013-06-13 08:05:32 UTC (rev 56687)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py	2013-06-13 08:08:58 UTC (rev 56688)
@@ -384,6 +384,13 @@
         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. ::
 



More information about the grass-commit mailing list