Recently I got the City of Surrey 2010 orthographs in MrSID format using a portable hard drive. MrSID is an imagery format that is highly compressed and in this case has a 20:1 compression ratio. Even with this high compression ratio, the orthographs are still nearly 9 GB.
1. Get some software
The biggest downside to MrSID is that it is patented and requires specialized software only available from LizardTech to process. The program we want is MrSID Decode, available at no cost for Windows, Linux and Solaris. In this case we want the Linux release, which we download and extract.
After extracting, we go to linux64 and extract another tarball. We ultimately want to end up in linux64/GeoExpressCLUtils-8.0.0.3065/bin
We then add this directory to the path and LD_LIBRARY_PATH with setenv PATH `pwd`:$PATH; setenv LD_LIBRARY_PATH `pwd`
The second piece of software we need is gdal.
2. Convert to GeoTIFF
We navigate to the directory where the MrSID is saved and then run mrsidgeodecode on it. This has a few options, but the key one is -wf
. Without this option, it will loose the georeferencing.
Combining all of this, we run mrsidgeodecode -wf -i Surrey_10cm_utm10_2010.sid -o Surrey_10cm_utm10_2010.tif
and wait. This process takes a few hours, and ends up with a 166 GB GeoTIFF.
3. Tiling the GeoTIFF
To be usable, we want to tile the GeoTIFF so you can view a small area without reading the complete file. To do this, we use gdal_translate -of GTiff -co "TILED=YES" Surrey_10cm_utm10_2010.tif Surrey_10cm_utm10_2010_tiled.tif
.
Once this has completed, we can delete the untiled GeoTIFF.
4. Adding overviews.
Depending on what we’re doing, we might want to add overviews. This will improve performance when viewing the GeoTIFF zoomed out. We do this with gdaladdo -r gauss Surrey_10cm_utm10_2010_tiled.tif 2 4 8 16 32 64