I have a world georeferenced raster (5m resolution, ~4000 x 4000 pixels) that I would like to display in google earth. I am looking for a simple and effective way to generate this kml file.

  • Using ArcGIS layer to KML outputs a kmz and resample the raster (I went as far as 3000 dpi, but quality is still pretty low)
  • Using GDAL raster2tile is slower than ArcGIS, but it also resample the image, yielding low quality output (I do not know how or if it is possible to tweak dpi or quality).
  • Using R maptools::GE_SpatialGrid function gave the best results so far, as it simply outputs a xml file specifying the extent of the raster. Though it does not display fully in Google Earth (no error message).

To sum it up, my preferred method would be to output a kml file, that would be entirely displayed in google earth. I like the kml idea of simply specifying an extent, it is easy to update the raster without any more processing.

You need to create SuperOverlays using the GDAL tools (gdal2tiles)

Creating SuperOverlays

enter image description here

continues here:

https://developers.google.com/kml/documentation/regions#superoverlays

Here is good guide for gdal2tiles and creating KML SuperOverlays:

https://developers.google.com/kml/articles/raster

  • Thank you, but as I said above, the resampling available with raster2tile (I've tried average, cubicspline and laczos) yield a blured image. Maybe it's because the original raster is quite high frequency (speckeled, if I can say). – Etienne Racine Mar 30 '12 at 16:50

It's a very easy task using the simplekml Python package. Here's a nice Ground Overlay example from its documentation:

import simplekml
kml = simplekml.Kml()
ground = kml.newgroundoverlay(name='GroundOverlay')
ground.icon.href = 'http://simplekml.googlecode.com/hg/samples/resources/smile.png'
ground.gxlatlonquad.coords = [(18.410524,-33.903972),(18.411429,-33.904171),
                              (18.411757,-33.902944),(18.410850,-33.902767)]
# or
#ground.latlonbox.north = -33.902828
#ground.latlonbox.south = -33.904104
#ground.latlonbox.east =  18.410684
#ground.latlonbox.west =  18.411633
#ground.latlonbox.rotation = -14
kml.save("GroundOverlay.kml")

Have you tried the MicroDEM? It's free, and I have heard it works great at this, but have not used it myself. http://www.usna.edu/Users/oceano/pguth/website/microdem/microdem.htm

I had the same problem today. Using the built-in Layer to KML tool and XTools didn't produce a nice image. But i brought in my georeferenced image into Global Mapper and it worked much better without any blurriness.

Edit: I created the KML/KMZ in Global Mapper. I loaded the JPG, then used File, Export, Export Web Format. I checked on the Super Overlay Setup option so that the KMZ will tile the output automatically to 1024x1024 pixels.

KML Export http://www.globalmapper.com/helpv11/Dialog_KMLRasterExportOptions.png

  • 1
    Did you create a KML is Global Mapper? or just view the data in Global Mapper? This is not clear from your answer. – Devdatta Tengshe Jul 8 '14 at 3:15

Converts my solution to a comment. Maybe more words makes it less trivial? Regardless, all these answers may work, but the SuperOverlay format is horrible, and the quads thing is pretty limiting/crude. I reverse engineered an output from OKMap... And you could use that, but I posted a script for ArcGIS here:Exporting 3GB ArcGIS Raster to KML without losing resolution?

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.