I have ~1.7 GB JP2 Buckeye that I want to serve out from Geoserver; I'd like to have it tiled so that the client won't have to redraw everytime they zoom into the map. My current understanding is that the best way to serve this is by building an Image Pyramid out of this so Geoserver can dish it out--however I think the only way to build the pyramid is by using a GeoTiff.

So I have started converting that <2 GB JP2 file (using gdalwarp) and currently I'm at 30% and the file size >13 GB which is HUGE. Plus if I go ahead and build the pyramid out of that file, I feel like the total size of this one file is going to be massive.

Is there a better way that I should serve this data? Ideally I should be using around the same amount of harddrive space as the JP2 but if I'm missing something, I welcome corrections and explanations so I can understand.

UPDATE cmd line used:

gdalwarp -t_srs "EPSG:3857" -multi source.jp2 output.tif

UPDATE per the suggestion of @iant to load up the bugger as a layer (attempted to add it as JP2K (Direct) Coverage Format Raster Data Source), i got the following error:

Could not list layers for this store, an error occurred retrieving them: Dimensions (width=111200 height=118200) are too large
  • 1
    can you add your gdal_warp command line? I would use something like gdal_translate \ -co COMPRESS=JPEG \ -co PHOTOMETRIC=YCBCR \ -co TILED=YES \ 5255C.tif 5255C_JPEG_YCBCR.tif
    – Ian Turton
    Feb 16 '16 at 13:34
  • Are you sure overviews are the best way to go? "JPEG2000 format does not support creation of GDAL overviews since the format is already considered to be optimized for "arbitrary overviews" as per the gdal docs. I'd rather go with a tile cache
    – Kersten
    Feb 16 '16 at 13:37
  • 2
    I'd go with a compressed tiled tif with overviews added - see blog.cleverelephant.ca/2015/02/…
    – Ian Turton
    Feb 16 '16 at 13:38
  • 1
    see gis.stackexchange.com/questions/169395/… for discussion on _translate and jp2
    – Ian Turton
    Feb 16 '16 at 13:44
  • 1
    I edited my answer, you should not be lost with it any more.
    – user30184
    Feb 16 '16 at 14:48

please, follow iant suggestion about the jpep compressed (big)tiff with jpeg compressed overviews.

I would not go for serving jp2 directly unless you can use kakadu or ecw sdk. I have not had time to look into the new openjpeg decoder.


So based on the comments on the question and the answer, I did the following:

Reprojecting from jp2 so that wouldn't make massive tif file (38gb from 1.7gb jp2) or take FOREVER

gdalwarp -t_srs EPSG:3857 -multi -srcnodata 0 -dstnodata 0 -of vrt source.jp2 output.vrt

Make jpeg compressed tif per suggestion

gdal_translate -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co TILED=YES output.vrt output.tif

Build image overlays of tif created above

gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL -r average -ro output.tif 2 4 8 16
  • what about gdal_translate for a 4-band jp2, where nodata is stored in the alpha? @simogeo
    – bjmarra
    Dec 6 '19 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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