[gdal-dev] ReadRaster memory hit
Nicolas Cadieux
nicolas.cadieux at archeotec.ca
Tue Mar 12 05:49:00 PDT 2019
Thanks again Even,
Is there a way I can test for this data organization and warn the user? I know very little about this aspect but I enjoy the learning curve.
As a follow up (if I may abuse!), I have one file with thousands points and one raster with hundreds of bands, both huge.
I have been querying the raster using the geotransform parameters one band at a time using a pool of workers “p.imap()” to call a function (python 2.7). This way, I can multithread 6 bands at a time.
Would it be a better approach to loop through the 200 bands inside this function? So basically, is it faster to loop the 200 bands or to loop the thousands of points one band at a time inside this function?
Merci, Your wisdom and help is always appreciated!
Nicolas
> Le 12 mars 2019 à 07:58, Even Rouault <even.rouault at spatialys.com> a écrit :
>
>> On mardi 12 mars 2019 01:56:34 CET Nicolas Cadieux wrote:
>> Hi,
>>
>> I am writing a python script and I need to read certain pixels form a huge
>> Hyperspectral images with over 200 band. If I use the method below from
>> the tutorial, if I understand correctly, memory hits will only come from
>> what I place in the buffer? In this case, only one line of pixels?
>> Therefore, even if the raster is huge, only that one line of pixels will
>> actually be in memory?
>
> In theory yes, but that might depend on the driver and actual data
> organization. If the data is pixel-interleaved, then the driver might buffer
> the data for the line for all the bands of the raster, even if you request
> reading just one like you do.
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
More information about the gdal-dev
mailing list