Google Earth user function for ENVI
posted Sun 24 Sep 2006 by Michael Galloy under ENVI, Information design
There have been suggestions recently that Google Earth is a “powerful tool” for science. Some disagree. At least one amateur used Google Earth to find an asteroid impact crater.
I just wanted to give context to imagery viewed in ENVI (similar to my Google Maps user function). mg_write_kml produces a KML file and an image suitable for viewing in Google Earth. The KML file includes lat/lon information to locate the image. The user function is only one file: mg_write_kml (docs).
Let me know if you use Google Earth for science and if this user function is useful for you.
Usage of mg_write_kml is bit more complicated than mg_google_lookup, but still straightforward:
- Download
mg_write_kmland put it in ENVI’s “save_add” directory. - Open an image with map info in ENVI.
- Display the image.
- In the menu for the display window, select Tools > Write KML file for Google Earth.
- After you select an output filename,
mg_write_kmlwill write the KML and TIFF files. - Open the KML file in Google Earth.

October 18th, 2006 at 10:57 am
Here’s another example of using Google Earth for scholarship.
January 28th, 2008 at 10:19 am
Hi Michael,
Thanks for your good ENVI codes.
Concerning the MG_WRITE_KML user function, it seems that it doesn’t work with ENVI 4.4. Does it exist a new release of it which would work with ENVI 4.4 ? Thanks.
Matthew
January 28th, 2008 at 10:43 am
No, that is the latest version. Unfortunately, I don’t have an ENVI license any longer.
But, check out this post on comp.lang.idl-pvwave. I haven’t used it, but it looks promising.