Browse Source

pygrass vector: Added simple area.centroid test

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66078 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 9 years ago
parent
commit
89056fc197
1 changed files with 9 additions and 1 deletions
  1. 9 1
      lib/python/pygrass/vector/__init__.py

+ 9 - 1
lib/python/pygrass/vector/__init__.py

@@ -396,8 +396,16 @@ class VectorTopo(Vector):
             Area(1) 12.0
             Area(2) 8.0
             Area(4) 8.0
-            >>> test_vect.close()
 
+            >>> areas = [area for area in test_vect.viter('areas')]
+            >>> for area in areas:
+            ...     print(area.centroid().cat)
+            3
+            3
+            3
+            3
+
+            >>> test_vect.close()
         """
         if vtype in _GEOOBJ.keys():
             if _GEOOBJ[vtype] is not None: