GeoTIFF to KMZ – Batch Conversion Methods

batchconvertgeotiff-tiffkmz

I have about 600 GeoTIFF map files, each about 140 mb in size that I'd like to convert to KMZ files so people can download them and use them with Garmin GPS units, Google Earth, etc.

Anyone know an easy way to batch process these, preferably converting the tiff image to a much smaller jpeg image as part of the process?

I've stumbled upon gdal_translate which I guess might be useful optimising the images into something smaller using the "-co COMPRESS=JPEG" option.

Best Answer

Recent versions of gdal_translate have support for KML Superoverlay. Although it is not yet documented on the GDAL website the following can be used:

gdal_translate.exe -of KMLSUPEROVERLAY c:\in.tif c:\out.kmz -co FORMAT=JPEG

This will save a tiled version in a kmz file using jpeg compression.

On windows you can automate using

forfiles /m *.tif /c "cmd /c gdal_translate.exe -of KMLSUPEROVERLAY @FILE @FNAME.kmz -co FORMAT=JPEG"

This assumes that the input files are in WGS84.