[SoC] pyGRASS: Report #1

Pietro peter.zamb at gmail.com
Fri May 25 10:57:12 EDT 2012


Hi all!

as reported in the new web page [0] of the pyGRASS project, at the moment you
can interact with a raster map in this way (read-only): ::

    # import the raster function
    >>> import obj
    # instantiate a Raster
    >>> dtm = obj.Raster('dtm')
    # open the raster in read mode 'r'
    >>> dtm.open()
    # get access
    >>> for row in dtm[:5]: print(row[:3])
    [718.0910034179688, 717.8709716796875, 717.551025390625]
    [718.0910034179688, 717.8709716796875, 717.551025390625]
    [718.0910034179688, 717.8709716796875, 717.551025390625]
    [718.0910034179688, 717.8709716796875, 717.551025390625]
    [718.0910034179688, 717.8709716796875, 717.551025390625]
    >>> dtm[5][:3]
    [718.051025390625, 717.7310180664062, 717.4210205078125]
    >>> dtm.close()

Any hint or suggestion are welcome! The Raster class use only the grass ctypes
library.

This report and the following ones will be available to the wiki page [1].

[0] http://code.google.com/p/pygrass/
[1]
http://grass.osgeo.org/wiki/GRASS_SoC_Ideas_2012/High_level_map_interaction#Weekly_reports


More information about the SoC mailing list