[GRASS-user] read raster by block...
Glynn Clements
glynn at gclements.plus.com
Sat Oct 9 03:42:46 EDT 2010
Leonardo Hardtke wrote:
> I made a gdal-phyton script that reads big images (a 230 images
> timeseries 4000x4000 px) by blocks, something like
> data = band.ReadAsArray(j, i, xBlSize, yBlSize)
> someone knows how to do that in a Grass-phyton script (or has a better idea! )?
GRASS operates row-by-row. If you need to operate upon tiles, I
suggest using grass.script.array and NumPy to restructure it.
If you only need to hold a few rows in memory at a time, it would be
feasible to process it row-by-row. On a 64-bit system, it might even
be feasible to just use grass.script.array to map all 230 maps at
once.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user
mailing list