[GIS] gdal_translate KMLSUPEROVERLAY creates blank black image

gdal-translate

I am trying to convert a geotiff to kmz file to view in GE. The geotiff is 878,720 KB. Using a 'regular kml' – the resolution is very low in GE. Having read around – it seems as conversion to a superoverlay is the best method?

I have chosen to use gdal_translate above other methods (e.g. MapTiler or Arc's tool that costs) because I have been using the GDAL python library already and I am trying to automate the entire process.

To test, I type into UNIX:

gdal_translate -of KMLSUPEROVERLAY filepath/2010_full_mosaic.tif filepath/2010_full_mosaic.kmz

A kml file is created….but on loading it into GE it is blank (black) – although extent/projection appear correct.

Would anyone be able to advise what I may have done wrong? When using the gdalinfo command, I am provided the following details:

Driver: GTiff/GeoTIFF
Files: Filepath/2010_full_mosaic.tif
       Filepath/2010_full_mosaic.tif.ovr
       Filepath/2010_full_mosaic.tif.aux.xml
Size is 10572, 22630
Coordinate System is:
PROJCS["WGS 84 / UTM zone 36S",
    GEOGCS["WGS 84",
         DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",33],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32736"]]
Origin = (390313.896406000014395,8164584.107470000162721)
Pixel Size = (25.000000000000000,-25.000624509551976)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  390313.896, 8164584.107) ( 31d58'18.28"E, 16d35'54.43"S)
Lower Left  (  390313.896, 7598819.975) ( 31d56'22.37"E, 21d42'38.47"S)
Upper Right (  654613.896, 8164584.107) ( 34d26'57.65"E, 16d35'45.40"S)
Lower Right (  654613.896, 7598819.975) ( 34d29'41.00"E, 21d42'26.42"S)
Center      (  522463.896, 7881702.041) ( 33d12'49.09"E, 19d 9'27.96"S)
Band 1 Block=10572x1 Type=Float32, ColorInterp=Gray
 Overviews: 5286x11315, 2643x5658, 1322x2829, 661x1415, 331x708, 166x354

Becky

Best Answer

Depending on the type of the input tif file, it may be necessary to add

-expand rgb

to the gdal_translate line. I found this to be necessary when converting BSB charts which start off with an indexed image. The KMLSUPEROVERLAY (at least in my case) was writing JPG images for each tile which do not support indexed colormaps.

Related Question