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

Darafei "Komяpa" Praliaskouski me at komzpa.net
Fri Mar 12 11:09:51 PST 2021


You need to enlarge cache size (GDAL_CACHEMAX) so that it can fit the
uncompressed tiles of one single row of your image.

On Fri, Mar 12, 2021 at 9:50 PM mhw-at-yg <matt.wilkie at gov.yk.ca> wrote:

> I have a lot of multi GB images that are unfortunately jpeg-in-geotiff
> encoded before nodata was properly defined. As a result they all suffer
> from
> the jagged edges problem.
> <http://osgeo-org.1560.x6.nabble.com/file/t192661/WVpPW.png>
>
> I've defined a method for adding a nodata mask side-car file that works
> around this:
>
> https://gis.stackexchange.com/questions/387877/add-a-nodata-mask-or-alpha-band-to-read-only-image/
>
>  * Create a working copy de-collared image with a mask file
>  * Rename the mask file to match original
>  * Remove working copy
>
> Windows command line syntax:
>
> :::
> nearblack -o xxx.tif -setmask in_image.tif
> move xxx.tif.msk in_image.tif.msk
> del xxx.*
> :::
>
> Unfortunately nearblack is unusable on large images. With a source image of
> 3.9 GB (126015 x 68149 pixels, 3 channels) it was only at 35% after 17
> hours. I forgot about the process and rebooted my machine so I don't know
> how long it would taken to complete, if it would have finished at all.
>
> I used gdal_retile to break the source into 4096x4096 tiles and ran
> nearblack on those. It finished in under 2 hours for the entire set of 527
> files, but i can't use the result because the tiles aren't georeferenced
> (see other thread). That problem aside, the experiment demonstrates much
> optimization is possible.
>
> Any advice on how else I might solve this?
>
>
>
>
>
>
>
> -----
> -Matt
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
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/20210312/a9f259fd/attachment-0001.html>


More information about the gdal-dev mailing list