Upload
googletectalks
View
5.179
Download
4
Tags:
Embed Size (px)
Citation preview
Advanced KML
Bent HagemarkMay 29, 2008
Overview
OGC StandardKML ArchitectureAdvanced featuresFuture enhancement
OGC Standard
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"
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
KML Architecture
KML Architecture
ObjectFeatureGeometryStyleLinkExtension mechanism
Object
most complex elementsid="ID"targetId="ID" for UpdateAbstractXxxObjectExtensionGroupkml:AbstractObjectGroup (8.1)
Feature
left panel entry: name, snippet, visibilityballoonstyleviewpoint, flyTocustom datakml:AbstractFeatureGroup (9.1)
Feature: concrete elements
PlacemarkNetworkLinkContainer: Document, FolderOverlay: GroundOverlay, PhotoOverlay, ScreenOverlay
Geometry
2d or 3dextrudetessellatekml:AbstractGeometryGroup (10.1)
Geometry: concrete elements
Point (icon)LineString, LinearRingPolygonModel (textured 3d)MultiGeometry
Style
shared style (6.4)inline stylestyle resolutionkml:AbstractStyleSelectorGroup (12.1)
Style: concrete elements
StyleStyleMapstyleUrlSubStyle: BalloonStyle, ListStyle, ColorStyleColorStyle: IconStyle, LabelStyle, LineStyle, PolyStyle
Link
hrefnetwork-shared stylenetwork-shared schemaimages, 3d models, more KMLballoonascription
Link: concrete elements
NetworkLink/Link/hrefOverlay/Icon/hrefModel/Link/hrefstyleUrlschemaUrlhtml:img src="..."html:a href="..."atom:link
Extension mechanism
ExtendedData/DataDocument/Schema, ExtendedData/SchemaDataExtendedData/XMLXSD extension mechanism
XML and JavaScript
same model (same system!)code.google.com/apis/kml/documentationcode.google.com/apis/earth
Advanced features
Review: Basic features
PlacemarkOverlayFolderStyleNetworkLink
Advanced features
RegionTimeUpdateExtendedData
Region
Feature LODvisibility transitionsmillions of pointsSuperOverlay
Region: any Feature
Placemark: visibilityNetworkLink: fetchOverlay: fetch of image and visibilityDocument/Folder: cascade
Region: simple effects
simple Lodpop in and outfadeclean swap with fade
Region: Example 1: simple Lod
<Placemark> <Region> <Lod> <minLodPixels>128</minLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>
<Point>...</Point>
</Placemark>
Region: Example 2: pop in and out
<Placemark> <Region> <Lod> <minLodPixels>128</minLodPixels> <maxLodPixels>512</maxLodPixels> </Lod> <LatLonAltBox>...</LatLonAltBox> </Region>
<Point>...</Point>
</Placemark>
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>
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>
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>
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
Region: "RbNL" Google Earth layers
Rumsey Historical MapsGigapan/Gigapxl PhotosYouTubeBooksNewsWeather
Region: SuperOverlay
"RbNL" of GroundOverlaysExamples:
Google Earth Weatherdisaster imagery
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
Time
FeatureTimeStampTimeSpanExample: Google Earth Weather
Time: tips and tricks
TimeStamp for PointsTimeStamp: geographically non-coincidentTimeSpan for OverlaysTimeSpan: geographically coincidentContainers cascadecheckHideChildren
Update
ChangeCreateDeleteExample: Santa
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>
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>
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>
ExtendedData
FeatureData: untyped dataSchema and SchemaData: typed data"<xs:any>": any XMLballoon templating with shared styleExample: Google Earth Weather(Metadata deprecated)
ExtendedData: Example: Weather
<Placemark> <name>...</name> <styleUrl>http://.../style.kml#sunny</styleUrl> <ExtendedData>...</ExtendedData> <Point>...</Point></Placemark>
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>
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>
ExtendedData: Example: weather
FeatureData: untyped dataSchema and SchemaData: typed data"<xs:any>": any XMLballoon templating with shared styleExample: Google Earth Weather(Metadata deprecated)
ExtendedData: tips and tricks
ExtendedData/Datathe comment trick
Future enhancement
Future enhancement
ExtendedDataXSD extension mechanismOGC SWG
Demo
code.google.com/apis/kml