[gdal-dev] nearblack on multi GB images very slow

Darafei "Komяpa" Praliaskouski me at komzpa.net
Fri Mar 12 13:25:24 PST 2021


You need to count tiles in the row, not pixels.

ceil(126015/128)*3*8*128*128 = 387 118 080 = half a gigabyte.


On Sat, Mar 13, 2021 at 12:08 AM <Matt.Wilkie at yukon.ca> wrote:

> > You need to enlarge cache size (GDAL_CACHEMAX) so that it can fit the
> uncompressed tiles of one single row of your image.
>
>
>
> Oh, ok. What’s the formula for that? A single row of pixels X num bands X
> bit-depth? Or Block-size X bands X depth?
>
>
>
> Given a source of:
>
>
>
> Size is 126015, 68149
>
> Band 1 Block=128x128 Type=Byte, ColorInterp=Red
>
> Band 2 Block=128x128 Type=Byte, ColorInterp=Green
>
> Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
>
>
>
> The math would be:
>
>
>
> 126015*3*8=3024360 bytes
>
>             3024360/1024= 2,954 KB
>
>
>
> Or:
>
>
>
> 126015*3*8*128*128=4E10 bytes
>
> 4E10/1024/1024= 3,8147 MB
>
>
>
> ?
>
>
>
> -Matt
>
>
>


-- 
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210313/707ee1e4/attachment.html>


More information about the gdal-dev mailing list