About the Author
Josie Wernecke,senior technical writer at Google, works with the experts who created KML’s first releases. She wrote The Inventor Mentor and The Inventor Toolmaker and coauthored The VRML 2.0 Handbook (with Jed Hartman), all published by Addison-Wesley.
Excerpt. © Reprinted by permission. All rights reserved.
"Learning to 'see geographically' means grasping an ever-changing world in an integrated way. It means getting to the heart of environmental and human problems. It involves balancing global and local understandings. It opens an opportunity to encompass themes vital to today's world: the working of the earth's natural systems, the increasingly problematic interaction between people and the physical environment, the nature of human social organisation with all its inequalities and struggles for power over people and nature."
From "Why Choose Geography?"
Geography Department, University of Liverpool
I took my only formal Geography class in the eighth grade from Mr. Granger, and I loved it. I'm intrigued by the different graphical styles of maps and continue to be amazed by the variety of information that can be shown geographically. By luck, two years ago I was assigned to a project at Google called KML, which has been as much fun as any work can be and as instructive as a year-long series of college seminars, lectures, and personal tutorials. KML stands for Keyhole Markup Language, and is a simple human-readable format originally used by Google Earth (and now by a host of other Earth browsers).
This book is an attempt to share the knowledge I've gained from the experts at Google. When I joined it, the KML team consisted of two engineers: Bent Hagemark and Michael Ashbridge ("Mash"). Bent and Mash's mission was to corral the existing KML into a formal XML schema, to create compelling examples that would represent good coding style, and to shepherd the language to its new and deserved status as an international standard. I was to create a website for KML and expand the existing documentation. I managed to complete that task, but it always felt as though I'd exposed only the tip of the iceberg. Well, here's The Iceberg.
The KML Handbook is also an effort to publicize some of the inspirational KML work by brilliant thinkers around the world---many of them technical experts in their own fields but completely new to XML, KML, and even to the basics of computer programming. They've discovered that KML brings raw numbers, arbitrary place names, and flat maps to life, and they've struggled and experimented to discover the hidden logic behind Google Earth's data format. I hope that, with this book at your side, there will be no more struggles.
This book is written for people who are curious about how to create customized presentations for an Earth browser such as Google Earth but have little or no experience with computer programming. It also contains information primarily of interest for "power users" who want to use the more advanced features of the language. The text suggests the level of complexity for each general topic, and the chapters follow a basic flow from relatively simple to more complex topics.
What You Should Know Before Reading This Book
This book assumes you are somewhat familiar with creating, storing, and loading files onto a computer and into a web browser and that you're connected to the Internet. Although it describes a few elements of HTML that are used in a placemark balloon, it does not attempt to provide an in-depth explanation of HTML. If you're new to HTML, you'll probably want to consult some additional resources on that subject. You do not need to know XML in order to use KML; this book teaches you the XML basics required to use KML.
If you want to set up a server to host KML files referenced in network links (Chapter 6), you'll also need to select a web server software package such as Apache or lighttpd and then install and configure the server according to the specific instructions for that product. Chapter 6 offers some basic information on this topic, but the details are best left to the individual product documentation.
What This Book Contains
Chapter 1, "A Quick Tour," provides an overview of the many different uses of KML, ranging from simple sets of placemarks to elaborate blogs and websites that use KML to make attractive, informative presentations of geographic data. This chapter describes a simple "Hello, Earth" example that illustrates the basic parts of a KML file.
Chapter 2, "Placemarks and Balloons," describes how to create custom icons and attractive ballon styles. It contains detailed information on how to specify colors in KML and how to create KMZ archives.
Chapter 3, "Geometry," goes into detail on specifying coordinates and altitude modes and also explains concepts related to geometry such as tessellation and extrusion. It includes examples and explanations of all geometry elements, including Models. It also shows you how to add elements describing the author and source of a KML file.
Chapter 4, "Styles and Icons," explains how to use shared styles and how to create all types of substyles: icon, label, line, polygon, ballon, and list substyles.
Chapter 5, "Overlays," describes how to create screen, ground, and photo overlays. Other topics covered here include the special processing required to add very large (gigapixel) photos to a photo overlay and how to specify a viewpoint using the Camera element.
Chapter 6, "Network Links," covers how to host KML files on a web server, where they can be refreshed periodically or processed by user-written scripts. It also introduces network link controls, which control certain aspects of the fetching network link.
Chapter 7, "Dynamic KML," provides detailed examples of the Update feature, which allows you to create, modify, and delete elements in KML files that have been previously fetched by a network link. This chapter also describes the time elements, which allow you to animate geometry in a KML file.
Chapter 8, "Dealing with Large Data Sets," contains important information on regions and custom data types. Regions are a powerful mechanism that allows you to control the conditions under which a given feature comes into view. If you're interested in creating a custom balloon style template for use throughout a KML presentation, be sure to read the section "Entity Replacement for Extended Data Elements."
Appendix A, "KML Reference," is an alphabetical reference that contains a brief description of every element and type in the KML standard, with syntax sections for all complex elements. This appendix describes the basic structure of a KML file and conventions of the language.
Appendix B, "Sky Data in KML," describes how to display astronomical data in an Earth browser. It includes the syntax for the "hint" used at the beginning of the KML file to alert the browser that the file contains sky data and also describes how to convert celestial coordinates for display in Google Earth and other "Earth" browsers.