2

I am trying to understand how tiles overviews and levels interact using GDAL so i know how to use it appropriate and optimize my rasters to use either in QGIS and/or geoserver.

So just to verify my understanding. TILED=YES (using ex gdal_translate). Tiles the internal file structure of instead of reading it linear. OVERVIEWS (using gdaladdo). Creates a pyramids. Can be created on individual GeoTiff or on a vrt. My main issue is to understand levels.

For example

gdaladdo -ro -r 
--config COMPRESS_OVERVIEW JPEG 
--config PHOTOMETRIC_OVERVIEW YCBCR 
--config INTERLEAVE_OVERVIEW PIXEL 
––config GDAL_TIFF_OVR_BLOCKSIZE 256 
--config JPEG_QUALITY_OVERVIEW 75 
mosaic.vrt 2 4 8 16 32 

Say I have a mosaic with aerial images for a large region, say a country.
What levels should I use to be able to render the entire country fast (as a guideline)? What does 32 mean and how do I know where to stop? 64, 128? and how does it relate to the blocksize to use?

But if I understand correctly using these pyramids in geoserver would not work as it cannot read vrt files. Then I need to tile them with gdal_retile?

2
  • 1
    2 4 8 means that pixel size is 2x, 4x, 8x bigger than the native. GDAL nowadays stops at reasonable level, with older versions user should set levels manually so that the last one shows the whole image with something like 200x200 pixels or so.
    – user30184
    Commented Jul 23, 2020 at 21:20
  • So if you work with a raster with high resolution that were high, say 10cm that would require more levels to cover the extent compare to 10m resolution (covering the same extent).
    – geogrow
    Commented Jul 24, 2020 at 10:44

1 Answer 1

1

It depends how big your last level of overviews is.

Is it a 100000x100000 pixel image? Then it would probably be too big to be useful (a client or server using the file would need to read quite a few bytes to generate its image or analysis). Is it 1000x1000? Then it would be ready to use for zoomed-out views.

The resolution corresponding with the level depends on your input. If your input is 512000x512000, then level 8 would be 64000x64000. If it was 10000x10000, then level 8 would be 1250x1250.

Modern GDAL will generate all reasonable levels if you just leave out the level numbers in your commandline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.