2

I've got a ImageMosaic (GeoServer) created from 4 band *.sid files. Images become transparent around the outer edges of *.sid files . When 4-th band is removed with gdal_translate -b 1 -b 2 -b 3 -of /X/Y.sid /X/Y_2.sid (gdal of course says Warning: The target file has a 'sid' extension, which is normally used by the MrSID driver, but the requested output driver is GTiff. Is it really what you want? link to a question about this)

When gdal translates sid to geotiff the images are displayed as expected but overhead storage required for geotiff files is unwanted.

1

A bit older GDAL versions required the use of -of parameter (notice: with the format name, for example -of PNG) or otherwise it used GeoTIFF as the default format. You can check your version with gdalinfo --version.

However, you have given .sid as the extension of the output file and because MrSID driver is read only then any GDAL version will use GeoTIFF as a fall back.

It is a common but wrong belief that TIFF is uncompressed and therefore filesize is big. You can read about many available compression options from the documentation https://gdal.org/drivers/raster/gtiff.html.

Have a try with this command and the image size should be about the same as with MrSID. You may face other problems if your original images are rotated and alpha band is actually needed for taking care about the transparency.

gdal_translate -b 1 -b 2 -b 3 -of GTiff -co tiled=yes -co compress=JPEG -co photometric=YCBCR /X/Y.sid /X/Y_2.tif
2
  • Command you provided did remove alpha band and decreased .tif file size. Since you did not mention a way to strip unwanted band from .sid and still keep .sid format that means there are no other way other than obtaining license for MrSID
    – user157137
    Jan 28 '20 at 8:12
  • By writing that MrSID driver is "read-only" I also meant that the driver is "no-write".
    – user30184
    Jan 28 '20 at 8:20

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.