KML Introduction - Importing Points to Google Earth
A Placemark is one of the most commonly used features in Google Earth. It marks a position on the Earth's surface, using a yellow pushpin as the icon. For our example, we will use the Yellowstone Earthquake data with which we worked so much at the beginning of the semester. Here is the Yellowstone Earthquake file.
The structure of this file breaks down as follows:
An XML header. This is line 1 in every KML file. No spaces or other characters can appear before this line.
A KML namespace declaration. This is line 2 in every KML 2.2 file.
A Placemark object that contains the following elements:
A name that is used as the label for the Placemark
A description that appears in the "balloon" attached to the Placemark
A Point that specifies the position of the Placemark on the Earth's surface (longitude, latitude, and optional altitude)
http://arrowsmith410-598.asu.edu/Lectures/Lecture25/eq4.kml
Basically it is the same as above, we just repeat the placemark tag, changing the location and attributes:
<Placemark>
<name> 3.4 </name>
<description> <![CDATA[<h1>Yellowstone EQs</h1><p><font color="red">Year = 1973.00 Depth = 10.00 Mag = 3.40.</font></p>]]></description>
<styleUrl>#dot</styleUrl>
<Point>
<coordinates>-110.46,44.47,0</coordinates>
</Point>
</Placemark>
Another feature you may want to test drive in Google Earth is the ground overlays.
These are images (in BMP, GIF, TIFF, TGA, and PNG formats) can be "draped" over the landscape.
We will again use the Yellowstone Earthquake data to demonstrate how some of our images we have made can be imported into Google Earth.
Remember our color image of mean earthquake depth:
The first thing we need to think about is "how do we georeference our image".
We will need to define the EXACT bounding box for the image.
To make this easier, I will constrain my figure to the borders of my axis.
We used the following script to generate the figure above: mean_depth_pcolor.m
From this script, we learn that the bounding box of the figure is:
East: -109.99
West: -110.99
North: 44.92
South: 44.02
Place the figure in Google Earth as a ground overlay
New tags for overlays that were not in the last section.
A GroundOverlay object contains the following new elements:
An Icon contains href which links the image for the overlay.
A LatLonBox specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.
Turn on the earthquakes to fill out our points and overlay
ArcGIS 9.3 includes export and conversion to KML. You can find the functionality under ArcToolBox->Conversion Tools->To KML->Map to KML:
This tool converts a map file (MXD file) to a kmz. The scale setting tells it to show the image at that scale and larger (i.e., more zoomed in). Making a single composite image collapses layers in the MXD file to a single image in the KML file.