Wikia

SketchUp Wiki

KML

Talk0
74pages on
this wiki

Keyhole Markup Language (KML) and its KMZ is the network or transfer file format for SketchUp, Earth and 3D Warehouse. It is an open format that can be used in many applications beyond Google.

KML is an XML format that describes the integration of mixed media into an application like Earth. KMZ is a container file for KML and its media objects. Inside a KMZ file, a 3D model is in the dae format.

KML and KMZ files are easy to create by hand. But of course SketchUp is needed for real 3D modeling.


Exporting Edit

Export models from the 3D Warehouse via SketchUp.

Export KML/KMZ files from SketchUp from the menus "File > Export > 3D Model" and then choose file type "Google Earth KMZ".

Share models on the 3D Warehouse from the menus "File > 3D Warehouse > Share Model".

KMZ Edit

The KMZ file is a ZIP containing image "textures", KML and COLLADA "dae" objects.

An example KMZ file, SID.kmz contains

 doc.kml
 models
 models/SID.dae
 images
 images/texture0.jpg
 images/texture1.jpg
 images/texture2.jpg
 images/texture3.jpg
 images/texture4.jpg
 images/texture5.jpg
 images/texture6.jpg
 images/texture7.jpg
 images/texture8.jpg
 textures.txt

The KML file, /doc.kml, describes the use of the resources /models/SID.dae and /images/textures*.jpg.

KML for Google Maps Edit

A limited subset of KML can be used with Google Maps. SketchUp KMZs are not compatible with Google Maps.

Dynamic Live Data Edit

KML is self updating using the Update and Change and Regions elements, and using the NetworkLinkControl element as in the example available for Earth Quakes.

 <?xml version="1.0" encoding="UTF-8"?>
 <kml xmlns="http://earth.google.com/kml/2.0">
 <NetworkLinkControl>
   <minRefreshPeriod>60</minRefreshPeriod>
 </NetworkLinkControl>
 <Document>
   <name>USGS Real-time Earthquakes</name>
...
   <NetworkLink>
     <name>Earthquake Epicenters</name>
     <open>0</open>
     <Url>
       <href>http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-age_src.kmz</href>
       <refreshMode>onInterval</refreshMode>
       <refreshInterval>300</refreshInterval>
     </Url>
   </NetworkLink>
...
 </Document>

The NetworkLink element references the source of this file (itself).

Incremental updates Edit

For dynamic display, a KMZ with a 3D model wants to do incremental updates using the Update and Change and Regions techniques so the whole model KMZ package isn't reloaded.

The Regions feature allows streaming large datasets for a smooth view. Viewing can begin before the entire file is completely downloaded. Level of detail improves as the streaming download continues.

See this note from KML Support for caveats.

Links Edit

Around Wikia's network

Random Wiki