[gdal-dev] Error when trying to compress a TIFF file

Even Rouault even.rouault at spatialys.com
Tue Aug 26 08:34:23 PDT 2014


Selon Hanlie Pretorius <hanlie.pretorius at gmail.com>:

> Hi Even,
>
> Thanks, the gdaldo command made a huge difference to the speed with
> which QGIS works with the raster.
>
> The image looks a bit shoddy, though, even when zoomed out. It
> improved when I set the quality to 100 and the file is still a tenth
> of the original size.

You can try adding -r average or -r cubic when computing overviews with gdaladdo
to improve a bit their quality.

>
> Would it help to create more levels in the overview and, if so, at
> which end should I add the levels?

Your full-res image is around 30000 x 30000.
With a max overview of factor 16 as in the below command, you have an image of
approximate size 1800x1800, which is still a bit big
Targetting 256x256 for the smallest overview would bring you instantaneous
opening in QGIS. So 30000 / 256 = 117.XXXX, round that to 128. So use "2 4 8 16
32 64 128".

>
> Hanlie
>
> 2014-08-26 16:25 MGT+02:00, Even Rouault <even.rouault at spatialys.com>:
> > Hanlie,
> >
> > The warning "VRTSourceRasterBand::iRatserIO() called recursively on the
> > same
> > band" is bug http://trac.osgeo.org/gdal/ticket/5468
> > It is due to the statistics computation on the intermediate VRT file
> > (implementation detail), but shouldn't influence on the image itself
> > You can run afterward "gdalinfo -stats Test_8bit_JPEG_Compr.TIF" to compute
> > statistics on the result TIF.
> >
> > The slowness in QGIS is not surprising since JPEG takes time to
> > decompressing,
> > especially for big images, that are not tiled and have no overviews. What
> > could
> > help is to add -co TILED=YES on the gdal_translate command line.
> > And then run "gdaladdo --config COMPRESS_OVERVIEW JPEG
> > Test_8bit_JPEG_Compr.TIF
> > 2 4 8 16" on the result to create overviews.
> >
> > Even
> >
>


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list