Hello list,
wich is the fastest approach to access in reading a writing sparse cells of a raster map?
For every couple of (row,col) not in sequential order do I have to read the entire corrisponding row and then get the rigth col ? Or maybe i have to use an fseek to get the cell at the rigth position in the raster file? Or is there a fastest way?
Thanks, Max
_____________________________________________________
Ing. Massimiliano Cannata
SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch
Massimiliano Cannata wrote:
wich is the fastest approach to access in reading a writing sparse cells
of a raster map?
For every couple of (row,col) not in sequential order do I have to read
the entire corrisponding row and then get the rigth col ?
Yes.
Or maybe i
have to use an fseek to get the cell at the rigth position in the raster
file? Or is there a fastest way?
If the raster data is compressed (which is the default), you have to
at least decompress everything up to the cell you want.
If you need random access, either use the segment library, or write
your own equivalent, i.e. read in the entire map and write it to a
temporary file (or store it in memory) in a format which is more
appropriate for your access pattern.
--
Glynn Clements <glynn@gclements.plus.com>