advanced kml
DESCRIPTION
Bent Hagemark (Google)This session will cover advanced techniques in KML for displaying data and creating dynamic presentations. We'll show how to to use Region to display very large datasets without clutter and without compromising performance. We'll also look at how time features can be used to add animation effects and how NetworkLinkControl and Update can be used to make dynamic KML presentations.Watch a video at http://www.bestechvideos.com/2008/09/07/google-i-o-2008-advanced-kmlTRANSCRIPT
![Page 1: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/1.jpg)
Advanced KML
Bent HagemarkMay 29, 2008
![Page 2: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/2.jpg)
Overview
OGC StandardKML ArchitectureAdvanced featuresFuture enhancement
![Page 3: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/3.jpg)
OGC Standard
![Page 4: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/4.jpg)
OGC KML 2.2
April 14, 2008Standard: 07-147r2Abstract Test Suite: 07-134r2100% "Google" KML 2.2 compatiblexmlns="http://www.opengis.net/kml/2.2"
![Page 5: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/5.jpg)
OGC KML 2.2
www.opengeospatial.org/standards/kmlschemas.opengis.net/kml/2.2.0/ogckml22.xsdcode.google.com/apis/kmlcode.google.com/apis/kml/documentation/kmlreference.html
![Page 6: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/6.jpg)
KML Architecture
![Page 7: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/7.jpg)
KML Architecture
ObjectFeatureGeometryStyleLinkExtension mechanism
![Page 8: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/8.jpg)
Object
most complex elementsid="ID"targetId="ID" for UpdateAbstractXxxObjectExtensionGroupkml:AbstractObjectGroup (8.1)
![Page 9: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/9.jpg)
Feature
left panel entry: name, snippet, visibilityballoonstyleviewpoint, flyTocustom datakml:AbstractFeatureGroup (9.1)
![Page 10: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/10.jpg)
Feature: concrete elements
PlacemarkNetworkLinkContainer: Document, FolderOverlay: GroundOverlay, PhotoOverlay, ScreenOverlay
![Page 11: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/11.jpg)
Geometry
2d or 3dextrudetessellatekml:AbstractGeometryGroup (10.1)
![Page 12: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/12.jpg)
Geometry: concrete elements
Point (icon)LineString, LinearRingPolygonModel (textured 3d)MultiGeometry
![Page 13: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/13.jpg)
Style
shared style (6.4)inline stylestyle resolutionkml:AbstractStyleSelectorGroup (12.1)
![Page 14: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/14.jpg)
Style: concrete elements
StyleStyleMapstyleUrlSubStyle: BalloonStyle, ListStyle, ColorStyleColorStyle: IconStyle, LabelStyle, LineStyle, PolyStyle
![Page 15: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/15.jpg)
Link
hrefnetwork-shared stylenetwork-shared schemaimages, 3d models, more KMLballoonascription
![Page 16: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/16.jpg)
Link: concrete elements
NetworkLink/Link/hrefOverlay/Icon/hrefModel/Link/hrefstyleUrlschemaUrlhtml:img src="..."html:a href="..."atom:link
![Page 17: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/17.jpg)
Extension mechanism
ExtendedData/DataDocument/Schema, ExtendedData/SchemaDataExtendedData/XMLXSD extension mechanism
![Page 18: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/18.jpg)
XML and JavaScript
same model (same system!)code.google.com/apis/kml/documentationcode.google.com/apis/earth
![Page 19: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/19.jpg)
Advanced features
![Page 20: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/20.jpg)
Review: Basic features
PlacemarkOverlayFolderStyleNetworkLink
![Page 21: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/21.jpg)
Advanced features
RegionTimeUpdateExtendedData
![Page 22: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/22.jpg)
Region
Feature LODvisibility transitionsmillions of pointsSuperOverlay
![Page 23: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/23.jpg)
Region: any Feature
Placemark: visibilityNetworkLink: fetchOverlay: fetch of image and visibilityDocument/Folder: cascade
![Page 24: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/24.jpg)
Region: simple effects
simple Lodpop in and outfadeclean swap with fade
![Page 25: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/25.jpg)
Region: Example 1: simple Lod
<Placemark> <Region> <Lod> <minLodPixels>128</minLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>
<Point>...</Point>
</Placemark>
![Page 26: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/26.jpg)
Region: Example 2: pop in and out
<Placemark> <Region> <Lod> <minLodPixels>128</minLodPixels> <maxLodPixels>512</maxLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>
<Point>...</Point>
</Placemark>
![Page 27: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/27.jpg)
Region: Example 3: clean swap
<Placemark id="coarse"> <Region> <Lod> <!-- minLodPixels defaults to 0 --> <maxLodPixels>256</maxLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>
<Point>...</Point> <!-- "come look here" -->
</Placemark>
![Page 28: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/28.jpg)
Region: Example 3: clean swap
<Placemark id="fine"> <Region> <Lod> <minLodPixels>256</minLodPixels> </Lod> <!-- maxLodPixels defaults to -1 "infinite" --> <LatLonAltBox>...</LatLonAltBox> </Region>
<Polygon>...</Polygon> <!-- more detail -->
</Placemark>
![Page 29: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/29.jpg)
Region: NetworkLink
<NetworkLink> <Region> <Lod> <minLodPixels>256</minLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region> <Link> <href>load-when-viewer-close-enough.kml</href> <viewRefreshMode>onRegion</viewRefreshMode> </Link></NetworkLink>
![Page 30: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/30.jpg)
Region: "RbNL" and tools
cascade of Region-based NetworkLinksKML Layerscode.google.com/p/regionator
csvregionator.py - CSV -> RbNLplacemarks.py - KML -> RbNLchecklinks.py - walks RbNLcheckregions.py - checks RbNL Regions
code.google.com/p/libkml
![Page 31: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/31.jpg)
Region: "RbNL" Google Earth layers
Rumsey Historical MapsGigapan/Gigapxl PhotosYouTubeBooksNewsWeather
![Page 32: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/32.jpg)
Region: SuperOverlay
"RbNL" of GroundOverlaysExamples:
Google Earth Weatherdisaster imagery
![Page 33: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/33.jpg)
Region: tips and tricks
focus on Lod, especially minLodPixelsminLodPixels most likely > 128
Region with any Feature including ScreenOverlayminLodPixels = 1/2 wid/ht of image tile
256x256 image -> minLodPixels 128512 is 1/4 a typical screen
![Page 34: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/34.jpg)
Time
FeatureTimeStampTimeSpanExample: Google Earth Weather
![Page 35: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/35.jpg)
Time: tips and tricks
TimeStamp for PointsTimeStamp: geographically non-coincidentTimeSpan for OverlaysTimeSpan: geographically coincidentContainers cascadecheckHideChildren
![Page 36: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/36.jpg)
Update
ChangeCreateDeleteExample: Santa
![Page 37: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/37.jpg)
Update: Change
<!-- original fetched with NetworkLink --><kml xmlns="www.opengis.net/kml/2.2"> <Folder> <Placemark id="p1"> <name>Point @ 3,-4.2</name> <description>My movable Point</description> <styleUrl>#some-style</styleUrl> <Point> <extrude>true</extrude> <coordinates>3,4.2</coordinates> </Point> </Placemark> </Folder></kml>
![Page 38: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/38.jpg)
Update: Change
<kml><NetworkLinkControl><Update> <Change> <Placemark targetId="p1"> <name>Point @ 3,-4.2</name> <Point> <coordinates>3,4.2</coordinates> </Point> </Placemark> </Change></Update></NetworkLinkControl></kml>
![Page 39: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/39.jpg)
Update: NetworkLinkControl and cookie
<kml><NetworkLinkControl> <!-- name=value compat with cgi parsing --> <cookie>count=123</cookie> <Update> <Change> <Placemark targetId="p1"> <Point> <coordinates>[coords for 123]</coordinates> </Point> </Placemark> </Change> </Update></NetworkLinkControl></kml>
![Page 40: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/40.jpg)
ExtendedData
FeatureData: untyped dataSchema and SchemaData: typed data"<xs:any>": any XMLballoon templating with shared styleExample: Google Earth Weather(Metadata deprecated)
![Page 41: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/41.jpg)
ExtendedData: Example: Weather
<Placemark> <name>...</name> <styleUrl>http://.../style.kml#sunny</styleUrl> <ExtendedData>...</ExtendedData> <Point>...</Point></Placemark>
![Page 42: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/42.jpg)
ExtendedData: Example: Weather
<!-- style.kml --><Style id="sunny"> <IconStyle> <Icon><href>sunny.jpg</href></Icon> </IconStyle> <LabelStyle>...</LabelStyle> <BalloonStyle> <text> <!-- 50 entities replaced in one template --> ...<td>$[01_Temperature]</td>... </text> </BalloonStyle></Style>
![Page 43: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/43.jpg)
ExtendedData: Example: Weather
<ExtendedData> <Data name="location"> <value>Shillong, IN as of 2008-05-28 17:00</value> </Data> <Data name="00_Temperature"> <value>80°F / 27°C</value> </Data> <Data name="00_Phrase"> <value>Haze</value> </Data></ExtendedData>
![Page 44: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/44.jpg)
ExtendedData: Example: weather
FeatureData: untyped dataSchema and SchemaData: typed data"<xs:any>": any XMLballoon templating with shared styleExample: Google Earth Weather(Metadata deprecated)
![Page 45: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/45.jpg)
ExtendedData: tips and tricks
ExtendedData/Datathe comment trick
![Page 46: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/46.jpg)
Future enhancement
![Page 47: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/47.jpg)
Future enhancement
ExtendedDataXSD extension mechanismOGC SWG
![Page 48: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/48.jpg)
Demo
![Page 50: Advanced KML](https://reader034.vdocument.in/reader034/viewer/2022042613/5466f973b4af9f5d3f8b55bf/html5/thumbnails/50.jpg)