[GRASS-user] How GRASS loads raster images into memory?

Pietro Zambelli peter.zamb at gmail.com
Fri Aug 16 07:51:47 PDT 2013

On Friday 16 Aug 2013 18:08:53 Andranik Hayrapetyan wrote:
> Good day,
> I would like to understand how GRASS loads raster images into memory to
> perform calculations on them.
> Does it load the entire image into memory and only then do the calculation
> on them, or it loads image into memory by portions sequentially?

As far as I know, there are no functions in the C-API of GRASS to load the 
whole raster map into the memory... And in general is not a good idea...

You can read/write a raster row by row with:


Then exist the Raster RowIO that provide a row cache to avoid to read several 
time always the same row from the hard disk.


And last but not least the Raster Segment, that split the map not by row but 
in several tiles and provide a tile cache, allowing to open a map in 
read-write mode.




More information about the grass-user mailing list