Using KML for Thematic Mapping

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

Notes on slide 1

Thank Michael/Google for inviting me Introduce myself This work is based on a MSc in GIS at University of Edinburgh Currenlty working as in UN Association of Norway Making data from UN organisations more accessible to the public Globalis

19 Favorites

Using KML for Thematic Mapping - Presentation Transcript

  1. Using KML for Thematic Mapping Bjørn Sandvik thematicmapping.org MSc in Geographical Information Science University of Edinburgh Project Manager at United Nations Association of Norway Tech Talk at Googleplex 12 December 2008
    • Thematic mapping techniques
      • Proportional symbol maps
      • Chart maps
      • Choropleth
      • 3-D prism maps
      • 3-D bar maps
      • Animated maps
    • Thematic Mapping Engine
    • Google Earth issues
    Outline Geo- browsers Thematic mapping techniques KML standard Public datasets Visualisations
  2. Proportional symbols
  3. Proportional symbols #1 Scaling image icons
  4.  
  5.  
  6.  
  7.  
  8.  
  9. Mathematical scaling of 2-D point symbols: symbolSize = power(value/maxValue; 1/2) * maxSize KML for proportional icon images <Style id='sharedStyle'> <IconStyle> <Icon> <href>files/symbol.png</href> </Icon> </IconStyle> <Style> KML <Placemark> <name>China</name> <Snippet>1,312,978,855 (2005)</Snippet> <styleUrl>#sharedStyle</styleUrl> <Style> <IconStyle> <color>e50066ff</color> <scale>7</scale> </IconStyle> </Style> <Point> <coordinates>106.514,33.42,0</coordinates> </Point> </Placemark> KML
  10. Problem: Size affected by viewport
  11. Not working in Google Maps
  12. Proportional symbols #2 Drawing regular polygons
  13.  
  14. Problem: Complicated! function kmlSymbolCalculator ( $longitude, $latitude, $radius, $vertices) { $EARTH_RADIUS_EQUATOR = 6378140.0; $RADIAN = 180 / pi(); $long = $longitude / $RADIAN; $lat = $latitude / $RADIAN; $f = 1/298.257; $e = 0.08181922; $kml = '<Polygon><outerBoundaryIs><LinearRing><coordinates>'; for ( $bearing = 45; $bearing <= 405; $bearing += 360/$vertices ) { $b = $bearing / $RADIAN; $R = $EARTH_RADIUS_EQUATOR * (1 - $e * $e) / pow( (1 - $e*$e * pow(sin($lat),2)), 1.5); $psi = $distance/$R; $phi = pi()/2 - $lat; $arccos = cos($psi) * cos($phi) + sin($psi) * sin($phi) * cos($b); $latA = (pi()/2 - acos($arccos)) * $RADIAN; $arcsin = sin($b) * sin($psi) / sin($phi); $longA = ($long - asin($arcsin)) * $RADIAN; $kml .= &quot; “ . round($longA,$this->coordDecimals) . &quot;,“ . round($latA,$this->coordDecimals); } $kml = '</coordinates></LinearRing><outerBoundaryIs></Polygon>'; return $kml; }
  15. Proportional symbols #3 Scaling 3-D Collada objects
  16.  
  17.  
  18. Mathematical scaling of 3-D point symbols: symbolSize = power(value/maxValue; 1/3) * maxSize Making proportional Collada objects Position Measure / scale Colorize Google SketchUp <Placemark> <name>China</name> <Snippet>1,312,978,855 (2005)</Snippet> <Model> <Link> <href>files/object.dae</href> </Link> <altitudeMode>absolute</altitudeMode> <Location> <longitude>106.514</longitude> <latitude>33.42</latitude> <altitude>0</altitude> </Location> <Scale> <x>140000</x> <y>140000</y> <z>140000</z> </Scale> </Model> </Placemark> KML
  19. Chart maps
  20.  
  21.  
  22.  
  23. Using Google Chart API in KML <Style id='sharedStyle'> <BalloonStyle> <text><![CDATA[ <img src='http://chart.apis.google.com/chart ?cht=p&chd=t:20,45,5 &amp;chd=t: $[chartValues] '> ]]></text> </BalloonStyle> </Style> KML <Placemark> <name>China</name> <Snippet>1,312,978,855 (2005)</Snippet> <styleUrl>#sharedStyle</styleUrl> <Style> <IconStyle> <scale>7</scale> <Icon> <href> http://chart.apis.google.com/chart?cht=p&chd=t:20,45,5&chs=300x150 &amp;chf=bg,s,ffffff00</href> </Icon> </IconStyle> </Style> <Point> <coordinates>106.514,33.42,0</coordinates> </Point> <ExtendedData> <Data name=&quot;chartValues&quot;> <value>20,45,5</value> </Data> </ExtendedData> </Placemark> KML
  24. Choropleth maps
  25.  
  26. Prism maps
  27.  
  28.  
  29.  
  30. Problem: Polygon holes
  31. KML used in prism maps Suggestion: <Placemark> <name>China</name> <Snippet>1,312,978,855 (2005)</Snippet> <styleUrl>#sharedStyle</styleUrl> <Style> <PolyStyle> <color>DC0066FF</color> </PolyStyle> </Style> <MultiGeometry> <Polygon> <extrude>1</extrude> <altitudeMode>absolute</altitudeMode> <outerBoundaryIs> <LinearRing> <coordinates> 110.72,20.06, 2000000 109.26,19.9, 2000000 108.63,19.28, 2000000 108.69,18.51, 2000000 110.05,18.38, 2000000 111.03,19.64, 2000000 (...) </coordinates> </LinearRing> </outerBoundaryIs> </Polygon> <Polygon> (...) </Polygon> </MultiGeometry> </Placemark> KML <Placemark> <name>China</name> <Snippet>1,312,978,855 (2005)</Snippet> <styleUrl>#sharedStyle</styleUrl> <Style> <PolyStyle> <color>DC0066FF</color> </PolyStyle> </Style> <MultiGeometry> <Polygon> <extrude>1</extrude> <altitude>2000000</altitude> <altitudeMode>clampToAltitude</altitudeMode> <outerBoundaryIs> <LinearRing> <coordinates> 110.72,20.06 109.26,19.9 108.63,19.28 108.69,18.51 110.05,18.38 111.03,19.64 (...) </coordinates> </LinearRing> </outerBoundaryIs> </Polygon> <Polygon> (...) </Polygon> </MultiGeometry> </Placemark> KML
  32. 3-D bar maps
  33. 3-D bars: One variable
  34. 3-D bars: Two variables
  35. Animated maps
  36.  
  37. Thematic Mapping Engine
  38. Thematic mapping parameters Web Interface PHP Library Web Processing Service KML/KMZ Thematic Mapping Engine Thematic Mapping Engine
  39.  
  40.  
  41.  
  42. Apache MySQL PHP Web server HTML / JavaScript Ext JS Google Earth API Web browser 1. Get list of indicators 2. Get list of available years 3. Make KML/KMZ document 4. Download KML/KMZ file How it works
  43. MySQL Data Connector Form Handler Database File Server Web server Web browser KML/KMZ files Web server infrastructure Thematic Mapping Engine
  44. include ('TME_MySQL_DataConnector.php'); include ('TME_Engine.php'); $dataConnector = new DataConnector(); $dataStore = $dataConnector->getDataStore(68, 2005, 0); $parameters = array( 'mapType’ => 'choropleth', 'indicator' => 68, 'year' => 2005, 'classification' => 'equal' ); $map = new ThematicMap($dataStore, $parameters); $file = $map->getKML(); Application Programming Interface (API)
  45. KML structure Add KML header Technique Choropleth Prism Bar Image Polygon Collada Type For each year For each feature Technique Choropleth Bar Image Polygon Collada Type Prism Add shared style Add shared style Add shared style Add shared style Colourise Collada object(s) Add style and feature Add style and feature Add style and feature Add style and feature Add style and feature Add link to Collada object Add map title and legend <Folder> <Placemark> </Placemark> </Folder> <kml> </kml> Symbol Symbol
  46. Map legends Unclassed Equal intervals Quantiles
    • Same icon size in different viewports
    • Clickable polygons (not ctrl-click!)
    • Clickable extruded polygons
    • Clickable Collada models
    • Support alternative base maps
    • Google Legend API
    Google Earth fix!
  47. thematic mapping.org

+ Bjorn SandvikBjorn Sandvik, 11 months ago

custom

6942 views, 19 favs, 23 embeds more stats

Tech talk at Googleplex 12 December 2008

More info about this document

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Go to text version

  • Total Views 6942
    • 5377 on SlideShare
    • 1565 from embeds
  • Comments 2
  • Favorites 19
  • Downloads 5
Most viewed embeds
  • 1428 views on http://blog.thematicmapping.org
  • 55 views on http://inigis.info
  • 29 views on http://terrimago.blogspot.com
  • 7 views on http://gisdk.blogspot.com
  • 7 views on http://webdidacticanova.blogspot.com

more

All embeds
  • 1428 views on http://blog.thematicmapping.org
  • 55 views on http://inigis.info
  • 29 views on http://terrimago.blogspot.com
  • 7 views on http://gisdk.blogspot.com
  • 7 views on http://webdidacticanova.blogspot.com
  • 5 views on http://static.slideshare.net
  • 5 views on http://www.gisiana.info
  • 5 views on http://gemtice.blogspot.com
  • 4 views on http://translate.googleusercontent.com
  • 3 views on http://googlegargle.blogspot.com
  • 3 views on http://www.webdidacticanova.blogspot.com
  • 2 views on http://feeds2.feedburner.com
  • 2 views on http://geolab21.blogspot.com
  • 1 views on http://74.125.91.132
  • 1 views on http://74.125.93.104
  • 1 views on http://74.125.39.132
  • 1 views on http://www.geolab21.blogspot.com
  • 1 views on http://74.125.95.132
  • 1 views on http://feeds.feedburner.com
  • 1 views on file://
  • 1 views on http://mizarmobile.blogspot.com
  • 1 views on http://209.85.173.113
  • 1 views on http://celoteh-senja.blogspot.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories