0

I have a DTM file, and my goal is to load it up onto Google Earth as a color relief map, with the colors gradient at levels I chose. I have successfully done this with RAS MAP using HEC RAS software, but I have been unable to simply export to Google Earth.

Using QGIS I have been able to make a contour map that does the bare minimum of what I need, but the contours are far apart, and the kml file slows down Google Earth a painful amount.

I have scowered the internet, but have not yet found a viable solution.

Looking for original answer, or answers to assist the RAS Mapper or QGIS path I have already taken.

  • Can you tell us the steps you've tried in QGIS? It should be possible to bring a DTM into QGIS, style/color it as you wish, and export the rendered version it as either a KML/KMZ (ground overlay), or as a GeoTiff (make sure you export as RGB rendered) that can be imported into Google Earth Pro. – Christiaan Adams May 2 at 14:51
  • Yes! Layer->Add Layer -> New Raster Layer-> and select DTM.Next I double-click on layer in the layer window, and go to Symbology. I select Singleband psudeocolor, and color my my intervals accordingly. I hit apply, and see the result. Next I try to export and save as, but KML does not seem to be an option, although this is the recommended method I have found. Not sure if I am missing an important intermediary step. – evet2364 May 2 at 15:03
0

KML was originally designed for vector data (points/lines/polygons), and many software tools will only export vector data as KML, which is why you don't always see the option in QGIS. In this case, it sounds like you want to get a raster dataset into KML for viewing in Google Earth. This can be done using a feature called Image Overlay (or in KML terms: GroundOverlay), which takes an image file and defines where on the globe it should be positioned. You should be able to create this by exporting a GeoTiff (image file with embedded coordinate data) from QGIS, and importing it into Google Earth Pro, which will convert to KML (or KMZ) for you.

In QGIS...

  • Import your DTM data as a raster layer and style it as you wish.
  • Right-click on the layer and select Export > Save As to bring up the dialog titled "Save Raster Layer as...".
  • Select Output mode: Rendered Image. (IMPORTANT - this creates the 3-band RGB image needed by Earth)
  • Format: GeoTiff
  • File name: Choose a name and location to save to.
  • CRS: "EPSG:4326 - WGS 84". See note on projections below.
  • Extent: use the default extent of layer, unless you want to set it differently.
  • Resolution: usually use the defaults. Select Columns if you want to set the exact pixel height and width of the image if desired. See note on sizes below.
  • No data values: you may need to set these if you have areas of no data that you wish to keep as transparent in the image. This can be tricky, but try it if needed.
  • Save the GeoTiff to your computer.

In Google Earth Pro...

  • Import the GeoTiff into Earth Pro. Use File > Open or File > Import, and select the filetype "GeoTIFF". If you use drag & drop to import (usually faster), then make sure that the import dialog that comes up is for a "New Image Overlay" and not for a "New Photo Overlay". If it tries to create a Photo Overlay, then your GeoTiff file does not contain correct georeferencing info.
  • If your image is bigger than a certain size, then Earth will provide options to import just a part of it, or to create a "KML SuperOverlay". See note on image sizes below.
  • In the "New Image Overlay" dialog, edit the name, transparency, description, and any other settings you wish to change.
  • Click OK to create your image overlay, which will appear as a new item in your Places list.

If you wish to save & share the KML/KMZ file...

  • If you created a single image overlay, and not a SuperOverlay, then right-click on the item in your Places list and select "Save Place As..."
  • In the save dialog, select file type KMZ, give it a file name & location, and save to your computer. A KMZ is a compressed zip archive that bundles together the necessary KML as well as the image file, making it easy to share and open in Earth.
  • If you created a SuperOverlay, it's harder to share, as you'll need to find where it saved it on your hard drive, and copy/share the entire folder.

Note on projections - It shouldn't matter what projection your QGIS Project and data layer use, so long as you export to "EPSG:4326 - WGS 84". But if you see any projection or positioning issues in Earth, then it's best to do all this with both the dataset and project coordinate reference systems set to WGS84 (EPSG:4326). I almost always set my project and re-project my data to EPSG:4326 to avoid unexpected projection issues.

Notes on image sizes, superoverlays, etc. - Google Earth can only overlay images up to a certain size, depending on the graphics capacity of your computer. To see the max size in Earth Pro, go to Help menu > About Google Earth, and look for "Maximum Texture Size". Most machines will support around 4096x4096 or 8192x8192 pixels max, though some will support higher. Older/weaker machines may only support upto 2048x2048 pixel images. So if you want to make sure that anyone can view your KML/KMZ, then you'll want to limit the image size to 2048 max dimension, though for most modern machines, 4096 should be fine. You can control the image size when exporting from QGIS, though be aware that reducing from the defaults may make your image in Earth lower resolution than the original data. Now, when you import, Earth will detect the image size, and if it's too big, it will offer some options:

  • Crop: this will let you import just a part of the image, but at full resolution. This is good for testing what the full res looks like. It creates a standard, single-image Image Overlay KML.
  • Scale: this will import the full image but will scale it down to a reasonable size, so you will loose resolution. This creates a standard, single-image Image Overlay KML.
  • Create Super Overlay... - This will take your large image and chop it up into tiles, with one low res tile to display when zoomed out, four tiles at the next zoom/resolution level, and continuing in a pyramid of tiles down to the full resolution tiles at the bottom. Viewing it in Earth, everything works automatically to load just the correct tiles (necessary location and zoom/resolution) for the place & zoom you're looking at. It does this with a folder of folders containing pairs of KML files and images for each tile. This is a powerful tool, but is harder to share or incorporate into other Earth/KML projects.

Hope that helps. Good luck!

  • Is there a way to keep the elevation data? When I view in HEC RAS, any point I click on the rendered image with display the elevation data. I lose this when converting to Geotiff. In addition, the image overlay is disturbed by the 3D view, which I was also hoping to make it adapt to in GE. Thank you Christiaan- I was able to get the image itself into GE. The "output rendered" setting seems to be what I was missing. – evet2364 May 2 at 16:51

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.