language for managing three-dimensional geospatial data in Google Earth. ... Google Earth and XML-based languages for geographic domains to visualize and.
10 Google Earth and XML: Advanced Visualization and Publishing of Geographic Information Emmanuel Stefanakis* and Kostas Patroumpas** * Department of Geography / Harokopio University of Athens, Greece ** Department of Electrical and Computer Engineering / National Technical University of Athens, Greece
Abstract The description and exchange of geospatial data using XML-based languages is currently a common practice. Two of the most widely adopted formats are the Geography Markup Language (GML) and Google’s Keyhole Markup Language (KML). Google Earth has very quickly become a popular Web based mapping software. In this chapter, we consider and elaborate a three step approach to visualize and publish geospatial data. Firstly, geospatial data are modeled in GML; secondly GML data are converted to KML; and thirdly KML data are published on the Web and visualized with Google Earth.
10.1 Introduction Google Earth is a software product that changes dramatically the way the general public views the world. It provides a rich set of satellite, aerial image, and map data for the entire globe. Users may zoom in, tilt, display maps, images, 3-D structures, and fly over the landscape effortlessly. Additionally, they may add their own data and make it available to other people. Integrating data is accomplished through the generation of a KML (Keyhole Markup Language) file, which can be published on the Web. KML is an XML-based language for managing three-dimensional geospatial data in Google Earth. KML files are often distributed as KMZ, i.e., zipped KML files. Another XML-based format to describe and exchange geographic information (GI) is GML (Geography Markup Language). GML has been developed and maintained by the Open Geospatial Consortium (OGC). GML is rapidly becoming a de facto standard in the GI open source community. In the last couple of years, many geographers and other geoscientists have used Google Earth and XML-based languages for geographic domains to visualize and 143
144 Emmanuel Stefanakis and Kostas Patroumpas
Geographic Information (GI)
Step 1
Geographic Markup Language (GML) Step 2
GML2KML Convertion
Keyhole Markup Language (KML)
Step 3
Google Earth
Fig. 10.1 The three step approach to visualize and publish geographic data on the Web.
publish their data on the Web. The main reason for this trend is twofold: (a) these tools are available for free; and (b) the underlying concepts are simple so users without special programming skills can learn them easily after a short training. Figure 10.1 presents an approach to visualize and publish geographic data using Google Earth and XML-based formats. This approach consists of three steps. In Step 1, geographic information (GI) is modeled in GML. In Step 2, GML data is converted to KML data. In Step 3, KML data are published on the Web and visualized in Google Earth. The scope of this Chapter is to provide a short presentation of the components involved in the configuration depicted in Figure 1. Specifically, Section 2 presents the main features of Google Earth. Section 3 describes the XML-based languages for geographical domains, focusing on GML and KML. Section 4 introduces a simple tool to convert GML data to KML data. Finally, Section 5 concludes the discussion by summarizing some thoughts on the role of Google Earth and XML in contemporary Internet mapping technology; and the presentation of our current activities at Harokopio University of Athens towards the generation of effective visualizations of geospatial data.
10.2 Google Earth Google Earth is a Web based mapping software (also characterized as a virtual globe program) that portrays a visually accurate representation of the entire Earth surface using satellite images, aerial photographs and GIS data (Google Earth 2007, Brown 2006, Gibson and Erle 2006, Wikipedia 2007). It is available on the Web in a free-of-charge version. Versions with enhanced capabilities are also available for professionals for an added fee. Google Earth was initially developed by Keyhole, Inc. under the name Earth Viewer. In 2004 Google acquired Keyhole and renamed the product Google Earth in 2005. Since then, a free-of-charge version has been available on personal computers
Google Earth and XML: Advanced Visualization and Publishing 145 running MS Windows 2000 or XP, Mac OS X 10.3.9 or later, and Linux Kernel 2.4 or later. In June 2006, Google Earth Release 4 was launched. Google Earth provides images and photographs that cover the entire globe. They are taken sometime during the last three years and are updated on a rolling basis. The resolution varies from place to place. In general, Google Earth allows the user to see major geographic features and man-made development such as towns and major roads. For most of the major cities in US, Canada, Western Europe, and UK the resolution is high enough (15cm to 1m) to reveal details for individual buildings and even cars and humans. Additionally, 3D buildings are represented for 38 US cities and some outside the US. Google Earth also incorporates digital terrain model (DTM) data, which makes the 3D view of the Earth’s surface possible. The coordinate system used is the standard WGS84 datum. All images and photographs are geo-referenced to this system. All terrain data and GIS data are also stored and represented in this datum. Data provided by Google Earth is mainly retrieved from Google Maps and several satellite and aerial datasets (including private Keyhole images). Google Maps is a Web map server (such as MapQuest or Yahoo!Maps) maintained by Google that provides high-resolution satellite imagery and aerial photography, international street-level datasets, and many map-based services. Through the Google Maps API the full Google Maps can be readily embedded on an external Web site for free. This API along with others and the Web 2.0 technologies lead to an expansion of the so-called mapping mashups. Mashup is a website or Web application that uses content from more than one source to create a completely new Web service. As for the DTM data provided by Google Earth, it is mainly collected by NASA’s Shuttle Radar Topography Mission. The basic functionality of Google Earth may be summarized as follows. Users may browse to a location: (a) by searching on addresses (this is available in US, Canada and Western Europe only); (b) by entering the WGS84 coordinates; or (c) by using the mouse. Then users can zoom in/out, tilt or rotate around this location. The user may then turn on various layers of mapping information (GIS data) such as roads, borders, recreational areas, lodging, etc.; or ask for driving directions and measure distances. Users may also add (using user-friendly interface toolboxes) their own points of interest (named placemarks) and other vector/raster data including 3D objects/models (designed in a companion free software named Google SketchUp), either manually or automatically (by loading them from digital files or connecting to a GPS receiver). Finally, users may attach to their own objects or customized hypertext documents written in html. At any time, users may save, print or e-mail and make available to others what is displayed on the screen. All data imported by the user are saved in an XML-based language (eXtensible Markup Language), called KML (Keyhole Markup Language) (KML 2007). KML files may then be distributed to others either in a zipped form, named KMZ files.
146 Emmanuel Stefanakis and Kostas Patroumpas KML shares some of the same structural grammar as GML (Geography Markup Language) and it is rapidly becoming a de facto standard. A KML file contains the coordinates of the place of interest plus a basic description and other information (e.g., the camera viewpoint). It also encodes all individual objects added by the user. The format must conform to the appropriate version of KML Specifications (currently version 2.1, see KML 2007). Google Earth has very quickly become the most popular Web based software for mapping. Similar products are also available. Commonly, they all fall under the term virtual globe (Wikipedia 2007). A virtual globe is a 3D software model or representation of the Earth or another world (e.g., the moon, Mars, etc.). There exist several types of virtual globes. Some of them aim to provide an accurate representation of the Earth surface through very detailed tiles of geospatial data; while others provide a simplified graphical depiction instead. Virtual globes are also categorized into two groups: (a) the offline virtual globes, which are standalone programs (e.g., MS MapPoint, MS Encarta); and (b) the online virtual globes, which retrieve and display geospatial data (mainly satellite images and aerial photographs) which is available on the Web. Some representative online virtual globes apart from Google Earth are: (a) the Virtual Globe developed by SINTEF Applied Mathematics; (b) the World Wind developed by NASA; and (c) the Virtual Earth developed by Microsoft.
10.3 XML-based Languages for Geographical Domains The scope of this Section is to provide a short introduction of the XML-based languages for geographical domains, focusing on Geography Markup Language (GML) and Keyhole Markup Language (KML). 10.3.1 eXtensible Markup Language XML (eXtensible Markup Language) is a widely accepted format for describing and exchanging data. It has been developed and maintained by the World Wide Web Consortium (W3C 2007). XML has the following features, which made it so widely accepted by the Web community: (a) it is portable; (b) it utilizes Unicode; (c) it is platform independent; (d) it is human readable (it is a pure and editable text); (e) it is extensible (extra info can be added to a format without breaking applications based on previous versions); and (f) it is well supported; in fact, a large number of off-the-self tools for processing XML documents exist. XML can be seen as a W3C standard to complement HTML (HyperText Markup Language, see W3C 2007). HTML describes how data is presented on Web browsers.
Google Earth and XML: Advanced Visualization and Publishing 147 On the other hand, XML describes the content (data) and ignores how this data will appear on a Web browser. In other words, XML is an application profile or restricted form of SGML (Standard Generalized Markup Language – ISO 8879 – see W3C 2007) and has designed to become a universal format for structured documents and data on the Web. XML syntax, as mentioned already, it is a textual representation of data. The basic component in XML is the element. Element is a piece of text bounded by matching tags, e.g., Peterson. An XML document is a single root element. Elements may be nested and cross-referenced using unique identifiers. This last feature is accomplished through the notion of attributes, since XML allows the association of attributes with elements. XML is a growing set of modules, which have been approved by W3C. Some of them are (many others exist and can be found at W3C 2007): XML1.0: it is the specification that defines what “tags” and “attributes” are. Xlink: it describes a standard way to add hyperlinks to an XML file. • Xpointer and XFragments: they describe how to point to pieces of data inside an XML document. • CSS: it is the style sheet language (it is applicable to XML as it is to HTML) • XSL: it is an advanced language for expressing style sheets. • XSLT: it is a transformation language used for rearranging, adding, deleting tags and attributes. • XML Query: it is a powerful query language for information extraction from XML files. • DOM: it is a standard set of function calls for manipulating XML (and HTML) files from a programming language. • DTD, XSD (XML Schemas): they are specifications to precisely define the structure, content and semantics of XML documents. Although XML has been designed to support the exchange of data through Web documents, it has many features of a database; and all relevant technologies built to manage XML documents can be considered as parts of a Database Management System (DBMS) on the Web (Abiteboul et al. 2000, Stefanakis 2002).
10.3.2 Geography Markup Language XML has been initially built to support traditional applications (such as office and banking). Very quickly, it has been extended to support applications involving nontraditional data (e.g., spatial, biological, chemical). The urgent needs to describe and exchange geographic data on the Web led to the generation of geographic formats based on XML. The most representative example is Geography Markup Language
148 Emmanuel Stefanakis and Kostas Patroumpas (GML), first published in 1999 (GML2 is available since 2000; GML3 is available since 2003), by the Open Geospatial Consortium (OGC 2007). Although many encoding standards for geographic information (GI) are available (e.g., COGIF, SAIF, DLG, SDTS), GML has been widely adopted by the GI community. The main reasons for this are: (a) GML is a simple text based encoding; (b) it is based on a common model of geography (OGC Abstract Specification, see OGC 2007) developed and agreed by the vast majority of leading GIS vendors; and (c) it is based on XML. Therefore, GML inherits the following valuable features from XML: • it provides a method to verify data integrity (through XMLSchema or DTD) • it can be read and edited using a simple text editor (also several XML editors exist, e.g., XML Spy) • it can be queried using a large number of effective XML languages (e.g., XML-Query, XSL) • it is easy to transform (using XSLT or any programming language such as Java or C++), and • it is a widely adopted public standard (a wide variety of commercial/free ware tools for XML exist; this leads to an open geographic information). As mentioned above, GML is based on the OGC Abstract Model of Geography (OGC, 2007). Based on this model a feature (entity) is a list of properties and geometry. A feature property is the usual feature name, its type and its value description. Feature geometry is a compound of the basic geometric building blocks (e.g., points, lines, curves, surfaces and polygons). In GML3 spatial relationships, 3D geometry and time can be modeled as well. GML consists of three base schemas, which are handled as packages: (a) the Geometry Schema (geometry.xsd), which include geometry type definitions; (b) the Feature Schema (feature.xsd), which supports feature collections as feature types; and (c) the XLink Schema, which provides the Xlink attributes and supports the linking functionality. A particular geographic domain is described by the appropriate GML Application Schema, which incorporates the base GML schemas (geometry, feature and Xlink schemas). Additionally, the GML Application Schema: (a) defines its own (new) feature types, which must be sub-typed from GML types; (b) defines new geometry properties, which also must be sub-typed from GML types; and (c) declares a target namespace, i.e., a mechanism to keep element names distinct. 10.3.3 Keyhole Markup Language Another XML-based language, which has been widely used during the last couple of years, is Keyhole Markup Language (KML). As mentioned in Section 2, the main
Google Earth and XML: Advanced Visualization and Publishing 149 reason its popularity is that KML is used as the basic format for managing threedimensional geospatial data in Google Earth. As KML is based on XML standard, it uses a tag-based structure with nested elements and attributes. The root element is named Object and has an identifier. In version 2.1 (KML 2007), Object element has six extensions to the following abstract elements: Feature, Geometry, ColorStyle, StyleSelector, TimePrimitive and SchemaField. Geometry elements may accommodate the types of Point, Line String, Linear Ring, Polygon, Multi Geometry and Model. A KML file specifies in XML based format a set of features for display in Google Earth. These features are placemarks, polygons, images, three-dimensional models, textual description, etc. Each place is always accompanied by a longitude and latitude, while other properties such as tilt, heading and altitude define the “camera view” and make the map display more specific.
10.4 Converting Simple GML Features into KML objects Apart from the geometric definition of spatial features, KML also has to specify their graphical representation on map, i.e., symbology, style and general map appearance (viewpoint, tilt etc.). These latter characteristics are usually not specified for GML features, since the principal objective of GML semantics is to fully describe geographic entities, without paying any particular attention on their cartographic rendering. This task is left to geographic applications (e.g., viewers) or other representations (SVG) that are able to display GML-encoded entities. Several converters to KML from GIS industry standards, such as ESRI shapefiles, MapInfo maps, CAD DXF, etc. are already available on the Web or through third-party applications. However, to the best of our knowledge, no such converter exists for GML features generated from Oracle Spatial. In addition, should this utility be used for data received from the Web-based platform iSQL*Plus offered by Oracle, then it has to handle proper formatting of query results. Oracle Spatial offers a function (SDO_UTIL.TO_GMLGEOMETRY), which can be used to transform any geometric entity from Oracle into a GML fragment compliant to OGC GML specifications. This function returns its result in plain text format (i.e., a possibly long string of characters). We have developed a utility named iSQL2KML that is able to transform such GML features received from a remote Oracle Spatial server (via iSQL*Plus interface) into KML-conforming objects. More specifically, some of main features currently supported from iSQL2KML include: • Conversion of basic geometric shapes: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon can all be handled.
150 Emmanuel Stefanakis and Kostas Patroumpas • Default style definitions are used for rendering line curves (red color with a width of 4 pixels) and areas (random color for the interior and red color for the outline). • Input features are treated as belonging to the same layer, but there is no constraint that all of them should have the same geometric type. For example, the converter can handle a mixture of polygons, lines and points all contained in the same XML file. • Input records should have an associated geographic object; otherwise, the respective entity will still be included in the resulting KML file, but obviously cannot be visible on map. • Original data should be referenced in long/lat WGS84 coordinates, in order to be properly displayed in GoogleEarth. Conversion concludes without error, even if original coordinates have a different datum, but obviously the result cannot be shown on top of GoogleEarth maps that are natively georeferenced in WGS84. • A short description is generated for each object in the KML file. Any other alphanumeric attributes present in the GML schema are directly copied into the KML file without modification. Therefore, all spatial and descriptive information of the original XML file is fully retained in KML format. iSQL2KML utility is freely downloadable for Windows and Linux platforms (iSQL2KML Converter 2007). In both cases, this converter can be executed from command line (i.e., MS-DOS in the case of Windows) and the only parameters required from users are the file names for input (GML/XML) and output (KML). A Java-based graphical interface will soon be released for free. Finally, a variant (GML2KML) of this converter is under development for generic GML files and shares many of the characteristics of iSQL2KML. A demo version of this latter utility is also freely available (GML2KML Converter 2007).
10.5 Discussion XML-based formats already dominate the GI community. GML is commonly used to describe and exchange data in various geographic domains. In parallel, Google Earth is undoubtedly a software package that changes dramatically the way the general public views the world. A KML community exists (visit the KML Community Forum at KML 2007); it is wide and varied. Casual users create KML files to placemark their homes or document their journeys. Scientists use KML to provide detailed mappings of resources, models, and trends. Professionals, such as planners, and agencies, such as in real estate, use KML to propose construction and visualize plans. Students, teachers and organizations use KML to explore current and historic people, places, and events.
Google Earth and XML: Advanced Visualization and Publishing 151 Taking into consideration the capabilities and popularity of Google Earth and KML, we launched a series of projects to generating and publishing a set of University Campus Maps at Harokopio University of Athens (Stefanakis 2006). Three projects are currently under development: • Project 1: Mapping the university campus infrastructures and services on Google Earth. • Project 2: Mapping the routes to the university campus from nodal points in the city of Athens on Google Earth. • Project 3: Mapping the services in the University Campus neighborhood on Google Earth. The generated campus maps are intended for use by the university students, staff members, and visitors (researchers, Erasmus students, etc). It is worth mentioning that currently (January 2007) the University Campus and its neighborhood are mapped in high resolution (approx. 61 cm) on Google Earth. All projects above have been undertaken by undergraduate geography students without special skills in programming. Before they start, they have got a short training in HTML and XML basics, as well as in Google Earth Plus Interface/ Functionality and KML specifications. This training has proved sufficient for them to accomplish each of the project objectives. Obviously, Google Earth and similar products/tools (e.g., Google Maps API, Yahoo!Maps, MS Virtual Earth, etc.) affect significantly the way GIScience is taught and introduced to undergraduates; especially in those disciplines with emphasis on geoinformatics. In the future, we plan to generate other types of visualizations using similar approaches and build tools that automate the process of mapping geospatial data sets (available in various repositories/formats) to KML. The converters presented in Section 4 are the first outcomes of our efforts.
References Abiteboul, S., Buneman, P., and Suciu, D., 2000. Data on the Web: From Relations to Semi-Structured Data and XML. Morgan-Kaufmann. Brown, M.C. (2006). Hacking Google Maps and Google Earth. Wiley. Gibson, R., and Erle, S. (2006). Google Maps Hacks : Tips & Tools for Geographic Searching and Remixing (Hacks). O’Reilly Media. GML2KML Converter 2007. [Online] Retrieved January 31, 2007 from http://www. dbnet.ece.ntua.gr/~kpatro/tools/kml Google Earth (2007) Google Earth [Online]. Retrieved January 31, 2007 from http://earth.google.com
152 Emmanuel Stefanakis and Kostas Patroumpas iSQL2KML Converter 2007. [Online] Retrieved January 31, 2007 from http://www. dbnet.ece.ntua.gr/~kpatro/tools/kml KML 2007. Keyhole Markup Language [Online] Retrieved January 31, 2007 from http://earth.google.com/kml/ OGC, 2007. OpenGeospatial Consortium (OGC) [Online] Retrieved January 31, 2007 from http://www.opengis.org/ Stefanakis, E. (2002) Geographic Databases and XML. Lecture notes at the 1st eduGI.net Summer School, Muenster, Germany,August 1st, 2002. Retrieved Jan 31, 2007 from http://www.dbnet.ece.ntua.gr/~stefanak/eduginet/1st_summer_school_eduginet/ Summer_School02_6p.pdf Stefanakis, E., 2006. Building university campus maps on Google Earth. In the Proceedings of the 4rd International Conference on Geographic Information Science (GIScience 2006), ifgi-Prints, Muenster, Germany, Sept. 20-23, 2004. W3C, 2007. World Wide Web Consortium (W3C) [Online] Retrieved January 31, 2007 from http://www.w3c.org/ Wikipedia (2007). Wikipedia – The free Encyclopedia [Online]. Search keywords: Google Earth, KML, Virtual Globes, Google Maps. Retrieved January 31, 2007 from http://en.wikipedia.org