advanced kml

50
Advanced KML Bent Hagemark May 29, 2008

Upload: googletectalks

Post on 12-May-2015

5.179 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Advanced Kml

Advanced KML

Bent HagemarkMay 29, 2008

Page 2: Advanced Kml

Overview

OGC StandardKML ArchitectureAdvanced featuresFuture enhancement

Page 3: Advanced Kml

OGC Standard

Page 4: Advanced Kml

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

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

KML Architecture

Page 7: Advanced Kml

KML Architecture

ObjectFeatureGeometryStyleLinkExtension mechanism

Page 8: Advanced Kml

Object

most complex elementsid="ID"targetId="ID" for UpdateAbstractXxxObjectExtensionGroupkml:AbstractObjectGroup (8.1)

Page 9: Advanced Kml

Feature

left panel entry: name, snippet, visibilityballoonstyleviewpoint, flyTocustom datakml:AbstractFeatureGroup (9.1)

Page 10: Advanced Kml

Feature: concrete elements

PlacemarkNetworkLinkContainer: Document, FolderOverlay: GroundOverlay, PhotoOverlay, ScreenOverlay

Page 11: Advanced Kml

Geometry

2d or 3dextrudetessellatekml:AbstractGeometryGroup (10.1)

Page 12: Advanced Kml

Geometry: concrete elements

Point (icon)LineString, LinearRingPolygonModel (textured 3d)MultiGeometry

Page 13: Advanced Kml

Style

shared style (6.4)inline stylestyle resolutionkml:AbstractStyleSelectorGroup (12.1)

Page 14: Advanced Kml

Style: concrete elements

StyleStyleMapstyleUrlSubStyle: BalloonStyle, ListStyle, ColorStyleColorStyle: IconStyle, LabelStyle, LineStyle, PolyStyle

Page 15: Advanced Kml

Link

hrefnetwork-shared stylenetwork-shared schemaimages, 3d models, more KMLballoonascription

Page 16: Advanced Kml

Link: concrete elements

NetworkLink/Link/hrefOverlay/Icon/hrefModel/Link/hrefstyleUrlschemaUrlhtml:img src="..."html:a href="..."atom:link

Page 17: Advanced Kml

Extension mechanism

ExtendedData/DataDocument/Schema, ExtendedData/SchemaDataExtendedData/XMLXSD extension mechanism

Page 18: Advanced Kml

XML and JavaScript

same model (same system!)code.google.com/apis/kml/documentationcode.google.com/apis/earth

Page 19: Advanced Kml

Advanced features

Page 20: Advanced Kml

Review: Basic features

PlacemarkOverlayFolderStyleNetworkLink

Page 21: Advanced Kml

Advanced features

RegionTimeUpdateExtendedData

Page 22: Advanced Kml

Region

Feature LODvisibility transitionsmillions of pointsSuperOverlay

Page 23: Advanced Kml

Region: any Feature

Placemark: visibilityNetworkLink: fetchOverlay: fetch of image and visibilityDocument/Folder: cascade

Page 24: Advanced Kml

Region: simple effects

simple Lodpop in and outfadeclean swap with fade

Page 25: Advanced Kml

Region: Example 1: simple Lod

<Placemark> <Region> <Lod> <minLodPixels>128</minLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>

<Point>...</Point>

</Placemark>

Page 26: Advanced Kml

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

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

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

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

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

Region: "RbNL" Google Earth layers

Rumsey Historical MapsGigapan/Gigapxl PhotosYouTubeBooksNewsWeather

Page 32: Advanced Kml

Region: SuperOverlay

"RbNL" of GroundOverlaysExamples:

Google Earth Weatherdisaster imagery

Page 33: Advanced Kml

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

Time

FeatureTimeStampTimeSpanExample: Google Earth Weather

Page 35: Advanced Kml

Time: tips and tricks

TimeStamp for PointsTimeStamp: geographically non-coincidentTimeSpan for OverlaysTimeSpan: geographically coincidentContainers cascadecheckHideChildren

Page 36: Advanced Kml

Update

ChangeCreateDeleteExample: Santa

Page 37: Advanced Kml

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

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

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

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

ExtendedData: Example: Weather

<Placemark> <name>...</name> <styleUrl>http://.../style.kml#sunny</styleUrl> <ExtendedData>...</ExtendedData> <Point>...</Point></Placemark>

Page 42: Advanced Kml

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

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

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

ExtendedData: tips and tricks

ExtendedData/Datathe comment trick

Page 46: Advanced Kml

Future enhancement

Page 47: Advanced Kml

Future enhancement

ExtendedDataXSD extension mechanismOGC SWG

Page 48: Advanced Kml

Demo

Page 49: Advanced Kml

code.google.com/apis/kml

Page 50: Advanced Kml