I'm using geoserver 2.9.0 to display our orthography. I've managed to get the MrSID file displaying properly however it's very slow. From what i've read to increase the performance I should convert to a GeoTIFF that is tiled and has overviews. My first step is to decode the MrSID file and save it as a geoTIFF. I do that with the following command:

mrsidgeodecode -i Mosaic_10cm_3TM.sid -o Mosaic_10cm_3TM.tif -of tifg -progress timer

*mrsidgeodecode is from lizardtech: https://www.lizardtech.com/gis-tools/tools-and-utilities#hs_cos_wrapper_widget_1460663711843

Here are some samples from the imagery served by geoserver over WMS:

MrSID Building (Original): MrSID white building GeoTIFF Building (Converted): GeoTiff White building with colourful artifacts MrSID RV Dealer (Original): http://i.stack.imgur.com/JIbuu.jpg

GeoTIFF RV Dealer (Converted): http://i.stack.imgur.com/C54es.jpg

Following the decode process I use the following GDAL commands to build the raster into a file that is much more performant:

REM -- Reproject GeoTif from EPSG:3780 to EPSG:3776 (http://www.gdal.org/gdalwarp.html)
gdalwarp -s_srs EPSG:3780 -t_srs EPSG:3776 -r bilinear -multi -wm 4096 -of GTiff Mosaic_10cm_3TM.tif Mosaic_10cm_3TM_EPSG3776.tif

REM -- Tile GeoTif (http://www.gdal.org/gdal_translate.html)
gdal_translate -of GTiff -co TILED=YES -co BIGTIFF=YES Mosaic_10cm_3TM_EPSG3776.tif Mosaic_10cm_3TM_EPSG3776_tiled.tif

REM -- Add Geotif Overviews (http://www.gdal.org/gdaladdo.html)
gdaladdo --config BIGTIFF_OVERVIEW YES --config GDAL_TIFF_OVR_BLOCKSIZE 256 -r gauss Mosaic_10cm_3TM_EPSG3776_tiled.tif 2 4 8 16 32 64

All of these GDAL commands work and create an image that is much more performant but because the decode process creates the colourful artifacts they remain present throughout.

Oddly enough however when I create an ImagePyramid with the following command (using the source that contains the colourful artifacts *created by mrsiddecode):

gdal_retile -v -r bilinear -levels 6 -ps 2048 2048 -targetDir pyramid Mosaic_10cm_3TM.tif

I get an image that is nearly identical to the original MrSID file: http://i.stack.imgur.com/4aB3T.jpg

Any help removing the colourful artifacts or converting the data in a different way as to not produce the artifacts would be great!


This appears to be an issue with Geoserver and the nodata values in the GeoTIFF file. Opening the file in QGIS an Geoviewer displays the white areas as expected. I have not been able to get Geoserver to display this image properly, however, I've found that creating an image pyramid is both faster and does not produce the colourful artifacts.

When I compared the output from gdalinfo on both the .tif decoded from mrsid and a tile image created from the pyramid command the only difference I found was In the Band Information. The decoded .tif has NoData Value=255 for each band (Red, Green, Blue) while the pyramid tile has no NoData value at all.

I'm guessing i'd be able to fix that with gdal_edit specifically:

gdal_edit -unsetnodata Mosaic_10cm_3TM.tif

but i've been unsuccessful in my attempts.

Instead i've found doing the following to be the most performant and visually functional option:

REM -- Convert MrSID to Raw GeoTif
mrsidgeodecode -i Mosaic_10cm_3TM.sid -o Mosaic_10cm_3TM.tif -of tifg -progress timer

REM -- Reproject GeoTif from EPSG:3780 to EPSG:3776 (http://www.gdal.org/gdalwarp.html)
gdalwarp -s_srs EPSG:3780 -t_srs EPSG:3776 -r bilinear -multi -wm 4096 -of GTiff Mosaic_10cm_3TM.tif Mosaic_10cm_3TM_EPSG3776.tif

REM -- Create Geotif Pyramid with 6 levels and 2048x2048 tiles (http://www.gdal.org/gdal_retile.html)
mkdir pyramid_compressed
gdal_retile -v -r bilinear -levels 6 -ps 2048 2048 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co JPEG_QUALITY=85 -targetDir pyramid_compressed Mosaic_10cm_3TM_EPSG3776.tif

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.