[gdal-dev] Control overview block size

Etienne B. Racine etiennebr at gmail.com
Tue Jun 10 10:28:18 PDT 2014


Indeed, thanks a lot Even. The OVR in GDAL_TIFF_OVR_BLOCKSIZE made me
believe it was only for external .ovr overviews.

Etienne


2014-06-10 8:48 GMT-04:00 Even Rouault <even.rouault at mines-paris.org>:

> Selon "Etienne B. Racine" <etiennebr at gmail.com>:
>
> > Hi List,
> >
> > Is there a way to control the block size of overviews and inspect that
> > block size from gdalinfo ?
> > I have a raster with 256x256 block size.
> > Band 1 Block=256x256 Type=Byte, ColorInterp=Red
> > Band 2 Block=256x256 Type=Byte, ColorInterp=Green
> > Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
> >
> > I'm trying to feed the images to a program that seemingly supports Tiffs
> > with internal overview of the same block size than the image.
> >
> > I've tried >gdaladdo --config BLOCKXSIZE 256 --config BLOCKYSIZE 256
> > image.tif 2 4 8 16 32
> > gdalinfo:
> > Band 1 Block=256x256 Type=Byte, ColorInterp=Red
> >   Overviews: 8655x5655, 4328x2828, 2164x1414, 1082x707, 541x354
> > Band 2 Block=256x256 Type=Byte, ColorInterp=Green
> >   Overviews: 8655x5655, 4328x2828, 2164x1414, 1082x707, 541x354
> > Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
> >   Overviews: 8655x5655, 4328x2828, 2164x1414, 1082x707, 541x354
> >
> > But I couldn't find a way to inspect the overview block size to confirm
> > they are 256x256 since I get the same results if I set BLOCKSIZE to 128.
> I
> > suspect these options are ignored in gdaladdo.
>
> The right name is GDAL_TIFF_OVR_BLOCKSIZE. See
> http://gdal.org/frmt_gtiff.html
>
> >
> > Any way I can 1) control the overview block size and 2) inspect the block
> > size ?
>
> Not directly with gdalinfo.
> With Python :
>
> from osgeo import gdal
> ds = gdal.Open('your.tif')
> print(ds.GetRasterBand(1).GetOverview(0).GetBlockSize())
>
>
>
> >
> > Thanks for your help,
> > Etienne
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140610/e00b03c5/attachment-0001.html>


More information about the gdal-dev mailing list