[SoC] [pyGRASS] Report #5

Pietro peter.zamb at gmail.com
Fri Jun 22 11:30:10 PDT 2012

Hi all!

The Raster classes (Row, RowIO, and Segment) seem to work, the RasterNUmpy
class is under development, at the moment it is partially working.

This week I did some benchmarks to test the speed of pygrass, and the results
are not bad. The purpose of the pygrass is not to substitute the r.mapcalc
module, but I want just compare the execution time.
Below I reported the execution time of add a number to a Raster
map,  using r.mapcal module, the RasterRow class, and the RasterSegment class:

Add a number:
r.mapcalc +2; 21.487251 sec/pass
RasterRow +2; 11.181928 sec/pass
RasterSeg +2; 14.730741 sec/pass

Test an if condition:
r.mapcalc if; 14.240596 sec/pass
RasterRow if; 14.753899 sec/pass
RasterSeg if; 19.982334 sec/pass

Test a function:
r.mapcalc sqrt; 16.495872 sec/pass
RasterRow sqrt; 18.591585 sec/pass
RasterSeg sqrt; 22.305732 sec/pass

You may find the code here:

git clone https://code.google.com/p/pygrass/

and you can run the benchmark code with:

python test/benchmark.py

As suggested by Martin Landa I added on the wiki page the project plan of the
GSoC moving from melange page.


And of course you can find the detail weekly report.


All the documentation of the raster classes is now available at:


As usual you can download, the weekly snapshot from here:


Questions, doubts, and criticism are welcome!

Best Regards,


More information about the SoC mailing list