MapGuide RFC 4 - KML Support

This page contains an change request (RFC) for MapGuide Open Source. More MapGuide RFCs can be found on the MapGuide RFCs page.

=Status=


 * Submission Date:
 * Last Modified Date:
 * Author: Chris Claydon
 * RFC Status: As designed, this was implemented before the RFC process was put in place. This document serves as documentation.
 * Implementation Status: completed
 * Voting History:
 * Assigned PSC guide(s):

=Overview=

Google Earth allows external data to be overlaid upon its own vast collection of satellite imagery and vector graphics. It does this by supporting KML - an XML-based format that can be used to define how external vector and raster data may be dynamically loaded and displayed within the Google Earth application.

=Motivation=

By integrating MapGuide with Google Earth, we provide a compelling way for users to visualize their data in relation to the planet as a whole. In addition to satellite imagery, Google provides a large amount of useful content, such as road networks, points of interest, voting districts etc. By serving up MapGuide data via KML (and its compressed form, KMZ) we allow users to incorporate their specific data set with Google's.

So, for example, if a MapGuide data set contained information about underground pipes and sewers, this information could be overlaid on a satellite image showing individual streets and houses. This would greatly facilitate the process of estimating exactly which homes and streets would be affected by any maintenance required on those pipes.

=Funding/Resources=

Resources supplied by Autodesk.

=Proposed Changes=

A new service will be added to MapGuide that supports three request types - GetMapKml, GetLayerKml and GetFeaturesKml.

GetMapKml is designed to be the single point of user-initiated contact with the server. It takes the following parameters:

OPERATION = GetMapKml

VERSION = 1

MAPDEFINITION = 

DPI =  (defaults to 96)

FORMAT = KML, KMZ or XML

This request can be made from a URL link in a web page. It generates a KML document representing the requested map definition. This document contains one NetworkLink element for each layer in the map. Google Earth uses these elements to make GetLayerKml requests back to MapGuide to retrieve further dynamic data for each layer.

If the format is KMZ, the KML document is compressed inside a zip file before being returned in the response. The mime types returned for KML and KMZ responses cause Google Earth to start up automatically and display the content of the document. If the requested format is XML, the mime type returned is text/xml, and the text of the KML document is typically displayed directly in the browser window.

GetLayerKml is designed to be called only by Google Earth. Its format may change in order to accomodate future enhancements to our KML support. It is therefore not recommended to call this operation directly. It supports the following parameters:

OPERATION = GetLayerKml

VERSION = 1

LAYERDEFINITION = 

DPI =  (defaults to 96)

FORMAT = KML, KMZ or XML

BBOX =  the current map extent in WGS84 lat/lon coordinates

WIDTH = the current map width in pixels

HEIGHT = the current map height in pixels

The KML generated by the GetMapKml request populates the first 5 of these parameters, and the link is formatted in such a way that Google Earth provides the BBOX, WIDTH and HEIGHT parameters corresponding to its current view.

GetLayerKml returns a KML document containing a  element corresponding to each scale range supported by the layer that is currently visible.  elements are used to instruct Google Earth only to request data via these links when the current scale falls within the scale range and when the current map extent intersects the extent of the data.

GetFeaturesKml is designed to be called only by Google Earth. Its format may change in order to accomodate future enhancements to our KML support. It is therefore not recommended to call this operation directly. It supports the following parameters:

OPERATION = GetFeaturesKml

VERSION = 1

LAYERDEFINITION = 

DPI =  (defaults to 96)

FORMAT = KML, KMZ or XML

BBOX =  the current map extent in WGS84 lat/lon coordinates

WIDTH = the current map width in pixels

HEIGHT = the current map height in pixels

GetFeaturesKml returns the actual content to be rendered on the map. For feature layers, a KML document is returned that contains the features represented in vector format, plus style information such as the color, line width etc. For raster layers, the raster image is returned in PNG format. Drawing layers (from DWF files) will not be supported (yet).

=Implications=

This section allows discussion of the repercussions of the change, such as whether there will be any breakage in backwards compatibility, if documentation will need to be updated, etc.

=Test Plan=

How the proposed change will be tested, if applicable. New unit tests should be detailed here???