SketchUp Wiki
(Adding categories)
No edit summary
 
Line 1: Line 1:
'''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.
+
'''Keyhole Markup Language''' (KML) is an XML markup language used in [[SketchUp]], [[Earth]] and [[3D Warehouse]]. It is an open format that can be used in many applications beyond Google. It comes in the KML and KMZ (Zipped version) formats.
   
KML is an [[wikipedia:XML|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 [[COLLADA|dae]] format.
+
KML is an [[wikipedia:XML|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 [[COLLADA|dae]] format.
   
KML and KMZ files are easy to create by hand. But of course [[SketchUp]] is needed for real 3D modeling.
+
KML and KMZ files are easy to create by hand. But of course [[SketchUp]] is needed for real 3D modeling.
   
   
Line 10: Line 10:
 
Export models from the [[3D Warehouse]] via [[SketchUp]].
 
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".
+
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".
+
Share models on the [[3D Warehouse]] from the menus "File > 3D Warehouse > Share Model".
   
 
== KMZ ==
 
== KMZ ==
   
The KMZ file is a [[wikipedia:ZIP (file format)|ZIP]] containing [[SketchUp Materials|image "textures"]], KML and [[COLLADA|COLLADA "dae"]] objects.
+
The KMZ file is a [[wikipedia:ZIP (file format)|ZIP]] containing [[SketchUp Materials|image "textures"]], KML and [[COLLADA|COLLADA "dae"]] objects.
   
 
An example KMZ file, [http://sketchup.google.com/3dwarehouse/details?mid=8a065d80fb1d679e7489bb64705f2d8d SID.kmz] contains
 
An example KMZ file, [http://sketchup.google.com/3dwarehouse/details?mid=8a065d80fb1d679e7489bb64705f2d8d SID.kmz] contains
Line 35: Line 35:
 
textures.txt
 
textures.txt
   
The KML file, <code>/doc.kml</code>, describes the use of the resources <code>[[COLLADA|/models/SID.dae]]</code> and <code>[[SketchUp Materials|/images/textures*.jpg]].
+
The KML file, <code>/doc.kml</code>, describes the use of the resources <code>[[COLLADA|/models/SID.dae]]</code> and <code>[[SketchUp Materials|/images/textures*.jpg]]. </code>
   
== KML for Google Maps ==
+
== <code>KML for Google Maps </code> ==
   
A limited subset of KML [http://maps.google.com/support/bin/answer.py?answer=41136&topic=1475 can be used with Google Maps]. [[SketchUp]] KMZs are not compatible with [http://maps.google.com/support/ Google Maps].
+
<code>A limited subset of KML [http://maps.google.com/support/bin/answer.py?answer=41136&topic=1475 can be used with Google Maps]. [[SketchUp]] KMZs are not compatible with [http://maps.google.com/support/ Google Maps]. </code>
   
== Dynamic Live Data ==
+
== <code>Dynamic Live Data </code> ==
   
KML is self updating using the [http://code.google.com/apis/kml/documentation/updates.html Update and Change] and [http://code.google.com/apis/kml/documentation/regions.html Regions] elements, and using the [http://code.google.com/apis/kml/documentation/kml_tags_21.html#networklinkcontrol NetworkLinkControl] element as in the example available for [http://earthquake.usgs.gov/research/data/google_earth.php Earth Quakes].
+
<code>KML is self updating using the [http://code.google.com/apis/kml/documentation/updates.html Update and Change] and [http://code.google.com/apis/kml/documentation/regions.html Regions] elements, and using the [http://code.google.com/apis/kml/documentation/kml_tags_21.html#networklinkcontrol NetworkLinkControl] element as in the example available for [http://earthquake.usgs.gov/research/data/google_earth.php Earth Quakes]. </code>
   
<?xml version="1.0" encoding="UTF-8"?>
+
<code> <?xml version="1.0" encoding="UTF-8"?>
 
<kml xmlns="http://earth.google.com/kml/2.0">
 
<kml xmlns="http://earth.google.com/kml/2.0">
 
<NetworkLinkControl>
 
<NetworkLinkControl>
Line 64: Line 64:
 
...
 
...
 
</Document>
 
</Document>
  +
</code>
   
The [http://code.google.com/apis/kml/documentation/kml_tags_21.html#networklink NetworkLink] element references the source of this file (itself).
+
<code>The [http://code.google.com/apis/kml/documentation/kml_tags_21.html#networklink NetworkLink] element references the source of this file (itself). </code>
   
=== Incremental updates ===
+
=== <code>Incremental updates </code> ===
   
For dynamic display, a KMZ with a 3D model wants to do incremental updates using the [http://code.google.com/apis/kml/documentation/updates.html Update and Change] and [http://code.google.com/apis/kml/documentation/regions.html Regions] techniques so the whole model KMZ package isn't reloaded.
+
<code>For dynamic display, a KMZ with a 3D model wants to do incremental updates using the [http://code.google.com/apis/kml/documentation/updates.html Update and Change] and [http://code.google.com/apis/kml/documentation/regions.html Regions] techniques so the whole model KMZ package isn't reloaded. </code>
   
The [http://code.google.com/apis/kml/documentation/regions.html 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.
+
<code>The [http://code.google.com/apis/kml/documentation/regions.html 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. </code>
   
See [http://groups.google.com/group/kml-support/web/kml-update-improvements this note] from KML Support for caveats.
+
<code>See [http://groups.google.com/group/kml-support/web/kml-update-improvements this note] from KML Support for caveats. </code>
   
== Links ==
+
== <code>Links </code> ==
   
* [http://earth.google.com/kml/index.html KML documentation]
+
* <code>[http://earth.google.com/kml/index.html KML documentation] </code>
* [http://code.google.com/apis/kml/documentation/ KML specification]
+
* <code>[http://code.google.com/apis/kml/documentation/ KML specification] </code>
* [http://groups.google.com/group/kml-support/ KML Support]
+
* <code>[http://groups.google.com/group/kml-support/ KML Support] </code>
* [[wikipedia:Google Earth]]
+
* <code>[[wikipedia:Google Earth]]</code>
 
[[Category:3D]]
 
[[Category:3D]]
 
[[Category:SketchUp]]
 
[[Category:SketchUp]]

Latest revision as of 03:25, 9 November 2017

Keyhole Markup Language (KML) is an XML markup language used in SketchUp, Earth and 3D Warehouse. It is an open format that can be used in many applications beyond Google. It comes in the KML and KMZ (Zipped version) formats.

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[]

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[]

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 []

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

Dynamic Live Data []

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 []

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 []