I have an aerial image - almost 1.5 GB , GeoTIFF - and I have been trying to add it as a layer in GeoServer...

Adding the layer went successful, but the performance was very bad.

I tried to cache the layer using GeoWebCache, and the performance is still bad.

Any tips?

1 Answer 1


You need to tile the image and add overviews so that the whole image is never read into memory at the same time. GeoServer provides an image pyramid datastore for this purpose.

I wrote these notes describing how I set this up on my machine. The key step is to use GDAL to build the pyramid using the following command:

mkdir bmpyramid
gdal_retile.py -v -r bilinear -levels 8 -ps 2048 2048 -co \
"TILED=YES" -targetDir bmpyramid \


  • -v: verbose output, allows the user to see each file creation scroll by, thus knowing progress is being made (a big pyramid construction can take hours)
  • -r bilinear: use bilinear interpolation when building the lower resolution levels. This is key to get good image quality without asking GeoServer to perform expensive interpolations in memory
  • -levels 8: the number of levels in the pyramid
  • -ps 2048 2048: each tile in the pyramid will be a 2048x2048 GeoTIFF
  • -co “TILED=YES”: each GeoTIFF tile in the pyramid will be inner tiled
  • (Not used here) -co “COMPRESS=JPEG”: each GeoTIFF tile in the pyramid will be JPEG compressed (trades small size for higher performance, try out it without this parameter too)
  • -targetDir bmpyramid: build the pyramid in the bmpyramid directory. The target directory must exist and be empty
  • bmreduced.tiff: the source file

Utility notes for gdal_retile.py.

  • How can i get the gdal_retile.py (i'm running the geoserver under Windows XP) ?
    – Mathboy
    Mar 26, 2012 at 8:23
  • trac.osgeo.org/osgeo4w and follow the quick install instructions
    – Ian Turton
    Mar 26, 2012 at 8:38
  • Now i have a problem , i've created the tiles using gdal_retile.py tool , but i'm getting the following error from Geoserver while linking the layer with the tiles folder : Could not list layers for this store, an error occurred retrieving them: This plugin accepts only File, URL and String pointing to a file any suggestion?
    – Mathboy
    Mar 26, 2012 at 9:05
  • @iant, is the slash in this piece -co \ "TILED=YES" just allowing the instruction to span a linebreak in the command window?
    – elrobis
    Mar 26, 2012 at 14:25
  • 3
    Also, when using gdal_retile on Windows to process a high res, large-area raster, I recommend adding -useDirForEachRow. By default, retile puts all the tiles it creates in the same folder, and for large rasters, this creates a tremendous slowdown once it has about 350,000 tiles in the root folder. By contrast, -useDirForEachRow places the tiles for each row in their own folder below the tile root. This means a huge speed up on Windows. Before -useDirForEachRow a full-county image mosaic (6-inch) needed 2 months to run! After -useDir, the full process would complete overnight.
    – elrobis
    Mar 26, 2012 at 14:56

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.