About KML Files

What is KML?

Keyhole Markup Language (KML) is an XML-based language schema for visualizing geographic annotation on two-dimensional maps and three-dimensional Earth browsers.

The KML file specifies a set of features (placemarks, images, 3D models, textual descriptions, etc.) for display in a KML application. The most common of these is Google Earth, but there are a number of other 3D earth browsers and viewers which implement the KML encoding.

Each place located by the KML file uses a minimum of a longitude and a latitude. If additional data is provided, the view can be more specific - for example a "camera view" uses further details such as such as tilt, heading and altitude. Enriched KML files are often distributed as KMZ files, which are zipped KML files with a .kmz extension. When a KMZ file is unzipped, a single "doc.kml" is found along with any overlay and icon images referenced in the KML.


You need a KML viewer

Google Earth iconThe first step to using any KML file is to have an application or browser plug-in which is capable of handling this file format.

We'll use Google Earth as the example here. Google Earth is currently available for PCs running Windows 2000, XP, or Vista, for Mac OS X 10.3.9 and above, for Linux, and for FreeBSD. Google Earth is also available as a browser plug-in for Firefox, and IE6 and higher.

Additionally, your browser needs to have JavaScript enabled. [Learn more about enabling JavaScript in your browser.]


How to use a KML file

KML file

When you click on link to get a KML file for the first time, your browser may not know how to handle this file format, and will simply offer you the opportunity to download it. This means you'd then need to locate the .KML file on the computer's desktop (or wherever you have set the default download folder to be) and double click on that file to launch Google Earth.

A few easy steps will increase the efficiency of the browser in knowing how to hand this KML file off to the correct application and auto-open it for you. Some browsers store specific preferences or properties which track this file type association (Firefox, Opera, Netscape). Other browsers do not store this, but instead rely on the computer's operating system to track this file type association. (Internet Explorer, Safari)

Here's how to adjust your settings...


For Firefox on a PC or MAC (version 3 documented here)

Once you've downloaded an initial KML file, do the following;

Within the Firefox browser on the PC, look under the TOOLS menu and select OPTIONS.
(on the Mac go under the FIREFOX menu and select PREFERENCES)

select the action

Within the dialog window which opens, click on the APPLICATIONS icon to show the content types and their associated actions.

Scroll through the list of content files and locate the listing for KML. (Hint: It won't be there if you have not yet downloaded a KML file)

Click on the ACTION associated with that content type and in the offered pull down list, select "use other" .

In the SELECT HELPER APPLICATION dialogue box which opens, browse to locate the Google Earth application and OPEN/SELECT it.


always do this

From now on, Firefox will will know how to handle KML files...

If you want to do this automatically, the next time you click on a KML file in Firefox, take the second to also check off the "do this automatically from now on" check box.






For Internet Explorer (version 7 documented here)

IE uses your Windows OS system files to make file type associations, so for IE to remember to always use Google Earth for KML files, (or to change the program that opens a KML type of file, if you've associated something different), you need to make this association within Windows itself, not within IE. If you double-click a file in Windows and it opens in the wrong software program, follow these steps to choose the program you would prefer that file use. You can change this setting for an individual file, or you can tell Windows to open all files of that same type in the software program you choose.

Also - please note - On the PC, Google Earth runs best in DirectX mode - it's suggested to install DirectX 9.0c or higher from the Microsoft Download Center. If you do not yet have an updated install of ActiveX, you'll need to update this as well . (most current PCs have this as default)


Get Info Dialog box

For Safari (version 3 documented here)

Safari obeys the preferences in the LaunchServices of the Mac OS, rather than making its own MIME list of these file type relationships. Since the Finder already has a mechanism by which to change those associations in LaunchServices, there's no place within Safari preferences to change that.

Download the KML file. (Safari downloads it to your desktop by default).

Safari will now automatically handle KML files correctly the next time you encounter one.



For Opera on a PC or MAC (version 9 documented here)

Within the Opera browser on the PC, look under the TOOLS menu and select OPTIONS.
(on the Mac go under the OPERA menu and select PREFERENCES)

opera preferences

Within the dialog window which opens, click on the ADVANCED tab and select "downloads" from the column of preferences that can be edited.

Scroll through the list of file extensions to locate the listing for KML and click on the EDIT button to assign a MIME type. (If KML is not there in the File Extension list, use the ADD button)


opera-set MIME

In the FILE TYPE dialog box which opens, enter the MIME type for the KML extension...

HINT: Opera expects that you will provide both the MIME type and the FILE EXTENSION in the Preferences setup: Google Earth reads KML and KMZ files.

The MIME type for KML files is application/vnd.google-earth.kml+xml

The MIME type for KMZ files is application/vnd.google-earth.kmz



Next, click on "OPEN WITH OTHER APPLICATION" then use CHOOSE to locate the Google Earth application and OPEN/SELECT it.




opera-remember choices

From now on, Opera will will know how to handle KML files... If you want it to launch Google Earth automatically, the next time you click on a KML file in OPERA, take the second to also check off the "remember this choice " check box.






For Netscape (version 9 documented here)

Netscape behaves the same as Firefox and Opera.


On a Linux system

Browsers not discussed will likely follow one of the previously listed routines... or you can search your browser's home page for support information about associating file types with applications.





Google Earth TM image
Need More Help with Google Earth?
Excellent Google Earth Help files and documentation are available.

Google Earth User Guide
Getting Started
General Information
Installing and Uninstalling
System Requirements