Files and Spreadsheets

image of bride and groom books

image courtesy Genista at filckr.com


Google Earth File Type

Data you enter into Google Earth can be saved in two ways:

  1. KML: Is a list of all the things Google Earth needs to know to display or rendering a screen view, you can remember it by thinking of the 'L' as representing List.
  2. KMZ: Is a zip (hence the 'Z') file containing a KML file and all the image files that need to be displayed.

If you save a map with overlay images stored on your hard drive as a KML and send it to someone else it won't display properly as Google Earth will be looking on their hard drive for your files. A KMZ gets around this problem, so except for advanced uses you should always save your work as KMZ.

iDevice icon Reflection
Which is generally larger in file size, KML or KMZ?

KML in Depth

So far you have produced and saved Google Earth files without coming into contact directly with the KML/Z files themselves. It is relatively easy to write a KML file from scratch:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Beach?</name>
<visibility>0</visibility>
<description>Site of the ill fated &apos;beach under spaghetti junction&apos; project, brummies were due to have a artificial beach to relax on at this location.</description>
<LookAt>
<longitude>-1.867419748522526</longitude>
<latitude>52.5094147456571</latitude>
<altitude>0</altitude>
<range>467.7852480732495</range>
<tilt>57.74514479446758</tilt>
<heading>24.17590779917229</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<Point>
<coordinates>-1.867741666666667,52.50909722222222,0</coordinates>
</Point>
</Placemark>
</kml>
IDevice Icon Activity

1] Copy the above text, find 'My Places' in the Places column > right click > paste.

2] You should see a placemark appear in the places column. Double click it to fly in to see its position.

3] Right click the placemark in the Places column > copy. 

4] Open the windows notepad (Start > All programs > Accessories > Notepad ) and select Edit > Paste.  You should see the code that created the placemark. 

5] Alter the numbers in the coordinates, copy the result and repaste from windows notepad as per [1] to see what effect the changes have.


When to Use KML

Although its possible to write KML from scratch using the rules on how to put it together , its usually much easier to either produce files using Google Earth itself or to use a scripting language such as PHP, python or C++. Its beyond this set of materials to consider such production, however, it's possible to use a google spreadsheet to produce KML as in the video below.

 



This is a good way of quickly producing placemarks with high quality formatting in the pop up balloons. You will need a google account to use the facility

 

 

Further Reading

Google documentation of KML

A video on Quick and Dirty KML a little long but has some good advanced ideas