Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

336 Part IV — Google Earth Hacks


FIGURE17-9: Setting the View for a placemark.

Generating a KMZ File


Generating a plain KML file is fine when either the information or the icons and other data
are available freely on the Internet. However, there are times when you want to create a stan-
dalone file that incorporates the KML with the icons, images, and any other files that make
your Google Earth file.

The format is quite straightforward. It is simply a Zip file that contains the KML and images.
For clarity, you should use the following format:

doc.kml:The main KML file.

images/:A directory for icons and photos to be included in the file.

Within the KML, you can refer to files directly according to this structure. For example, a
photo could be included in the description for a placemark using this:
<img src=”images/DSC01155.JPG”>

You can use any appropriate Zip-compatible software. From a Unix or Linux machine (includ-
ing Mac OS X) with a command-line client, you could use the following, for example:
$ zip -r Pompeii.kmz doc.kml images/
Free download pdf