Keyhole KMZ / KML Export

Format Description

Keyhole Markup Language (KML) is an XML notation for expressing geographic annotation and visualization within Internet-based, two-dimensional maps and three-dimensional Earth browsers. KML was developed for use with Google Earth, which was originally named Keyhole Earth Viewer. It was created by Keyhole Inc, which was acquired by Google in 2004. KML is an international standard of the Open Geospatial Consortium. Google Earth was the first program able to view and graphically edit KML files. Other projects such as Marble have also started to develop KML support.. [this is an excerpt from the Wikipedia KML page ].

KML-documents may contain geospatial data either in vector or raster form. Vector objects like points, lines, polygons and entire models in the COLLADA format (DAE) are defined as "Placemark" elements; airborne and satellite imagery are modeled as "groundOverlay" elements.

Besides the geometry, Placemark elements may involve name, description, predefined style, angle and distance of view, a time stamp, but also other data e.g. from a geoinformation system. The same holds for GroundOverlay elements, where instead of the geometry a coordinates section has to be defined for georeferencing.

Please refer to the Keyhole KML reference page for the full format description.

CityEngine at the time just supports the use of KMZ / KML for three dimensional models referring to a Collada DAE file, where KML determines geographic position, orientation and scale of that model.

Specific Export Options for KMZ / KML

In addition to the general export options, Keyhole KMZ / KML adds the following switches:

Option Description
Altitude Mode Controls what altitude tags are written to the kml/kmz files
clampToGround: Aligns the object to the ground, altitude is ignored.
absolute: ignores the actual ground elevation. Note that here the ground elevation and the altitude have to coincide precisely.
Write Compressed Files If set, the written KML file is put into a KMZ archive file along with the other needed files like the DAE file(s) and texture images.
Heading Correction ArcGlobe, Google Earth and other earth browsers interpret the Collada DAE file's content differently: for the case of Google Earth the Heading Correction switch has to be turned on for having correct results.
Vertex Indexing Choose between indexed polygon vertices or separated vertex copies per polygon.
Placemark Locations Exact spatial references per model: Unprojects placemark locations per shape. Recommended for unconnected objects (such as buildings) for bigger areas.
Optimized Model placement: Optimizes placemark locations to ensure correct relative positions (unprojection only in the lead shape, other shapes are referenced relatively). Recommended for connected objects (such as streets) over small areas.

Use the KML export presets Google Earth Compatibility or Arc Globe Compatibility to set recommended options for these programs.

CityEngine's KML Output

When saving some selected objects by the name "MyPlacemarks", the exporter will write the file "MyPlacemarks.kml"; next to it, there will be a folder named MyPlacemarks.kml-files containing the associated DAE file and textures. Here is what the KML file will look like:

Example KML File Output

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"> <Document> <name>MyPlacemarks</name> <Folder> <Placemark> <name>aPlacemark</name> <Model> <altitudeMode>clampToGround</altitudeMode> <Location> <longitude>-75.17193217718045</longitude> <latitude>39.95381194059072</latitude> <altitude>10.82616576552391</altitude> </Location> <Orientation> <heading>0.0</heading> <tilt>0.0</tilt> <roll>0.0</roll> </Orientation> <Scale> <x>1.0</x> <y>1.0</y> <z>1.0</z> </Scale> <Link> <href>MyPlacemarks.kml-files/aPlacemark.dae</href> </Link> </Model> </Placemark> <Placemark> <name>anotherPlacemark</name> ... </Placemark> ... </Folder> <Document> </kml>

Further Reading

Copyright ©2008-2016 Esri R&D Center Zurich. All rights reserved.