浏览代码

PyGRASS docs: Better explain difference between _cols and .info.cols (clarifies https://trac.osgeo.org/grass/changeset/71472)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71474 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 7 年之前
父节点
当前提交
c342313bac
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      lib/python/docs/src/pygrass_raster.rst

+ 13 - 1
lib/python/docs/src/pygrass_raster.rst

@@ -76,14 +76,26 @@ added to the file as the last row. ::
 
     >>> raster = reload(raster)
     >>> elev = raster.RasterRow('elevation')
-    >>> # the cols attribute is set from the current region only when the map is open
+    >>> # the private _cols attribute is set from the current region only when the map is open
+    >>> # the .info.cols attribute is set to total number of map cols only when the map is open
+    >>> # cols in .info.cols equals the number reported by r.info module
+    >>> elev._cols
     >>> elev.info.cols
     0
     >>> elev.open()
     >>> elev.is_open()
     True
+    >>> elev._cols
+    200
     >>> elev.info.cols
     1500
+    >>> elev._rows
+    300
+    >>> # number of available rows/cols also can be determined by len()
+    >>> len(elev)
+    300
+    >>> len(elev[0])
+    200
     >>> # we can read the elevation map, row by row
     >>> for row in elev[:5]: print(row[:3])
     [ 141.99613953  141.27848816  141.37904358]