Using KML to Display Scientific Data in Google

  • Slides: 26
Download presentation
Using KML to Display Scientific Data in Google. Earth By Jim Graham May, 2008

Using KML to Display Scientific Data in Google. Earth By Jim Graham May, 2008

Contents 1. 2. 3. How Google. Earth Works Display Excel Data in Google. Earth

Contents 1. 2. 3. How Google. Earth Works Display Excel Data in Google. Earth Creating KML Files for Google. Earth

Section 1: How Google. Earth Works

Section 1: How Google. Earth Works

How Google. Earth Works Web Server Local Computer Internet Satellite Images Spreadsheet Files Google.

How Google. Earth Works Web Server Local Computer Internet Satellite Images Spreadsheet Files Google. Earth KML Files

Google. Earth � Created by Denver-based company, Keyhole � An application that runs on

Google. Earth � Created by Denver-based company, Keyhole � An application that runs on your computer � GIS Services for various layers � A system that you can add data to � Commercially owned

File Formats � Common file formats: ◦ Word (*. doc) ◦ Power. Point (*.

File Formats � Common file formats: ◦ Word (*. doc) ◦ Power. Point (*. ppt) ◦ Excel (*. xls)

GIS File Formats � Shapefiles � Coverages � Geo. TIFF � Lots of others

GIS File Formats � Shapefiles � Coverages � Geo. TIFF � Lots of others � Is KML a GIS format?

Keyhole Markup Language (KML) � Small Graphics Markup Language (SGML) � Hyper. Text Markup

Keyhole Markup Language (KML) � Small Graphics Markup Language (SGML) � Hyper. Text Markup Language (HTML) � Extensible Markup Language (XML)

Keyhole Markup Language (KML) � Based on XML � Very simple, flexible format �

Keyhole Markup Language (KML) � Based on XML � Very simple, flexible format � Can be create very complex files � Not an industry standard (could change at any time, only works in Google. Earth) � KML Documentation: http: //code. google. com/apis/kml/docu mentation/ � Or search on ‘KML’ into Google

GIS Data � Rasters (photos) ◦ Satellite ◦ Aerial � Vector Data ◦ Points

GIS Data � Rasters (photos) ◦ Satellite ◦ Aerial � Vector Data ◦ Points ◦ Polylines/Paths ◦ Polygons

Play with KML � Add Placemark � Add Path to and from somewhere �

Play with KML � Add Placemark � Add Path to and from somewhere � Add Polygon around your school � Save As… KML files

Situation � KML is still very new � Shapefiles are the most common GIS

Situation � KML is still very new � Shapefiles are the most common GIS vector format � Converters are coming � Shapefiles are much more limited than KML files (i. e. it’s easy to go from Shapefile to KML, can be harder to go from KML to Shapefile)

Discussion Points � When should data be in a local file vs. on a

Discussion Points � When should data be in a local file vs. on a web server? � What are the possible futures for KML? Web Server Local Computer Internet

Section 2: Displaying Excel Data in Google. Earth � Problem: Display spreadsheet data in

Section 2: Displaying Excel Data in Google. Earth � Problem: Display spreadsheet data in Google. Earth � Solution: ◦ Use an Excel “Add-In” that converts data in spreadsheets to a KML file ◦ Open the KML file in Google. Earth

Excel Add-Ins � Actually Excel files that include “Macros” � Hidden in your “Add-In”

Excel Add-Ins � Actually Excel files that include “Macros” � Hidden in your “Add-In” folder

Write. To. KML Add. In 1. 2. 3. 4. 5. Install Write. To. KML

Write. To. KML Add. In 1. 2. 3. 4. 5. Install Write. To. KML Add-In to your system Make Write. To. KML available to Excel Add a custom tool to Excel Use the tool to save a KML file Make more interesting descriptions

Discussion Points � Discussion point: What type of data would you collect to make

Discussion Points � Discussion point: What type of data would you collect to make this work?

Section 3: Creating KML Files � The Write. To. KML Add-In is limited �

Section 3: Creating KML Files � The Write. To. KML Add-In is limited � Does not support: ◦ ◦ polygons and paths Graphics Icons Lots of other features of KML � http: //earth. google. com/kml/index. html

Creating KML Files � Simple text files without any formatting � Write in Note.

Creating KML Files � Simple text files without any formatting � Write in Note. Pad (Text. Edit on the Mac), not MS-Word or other “word-processor”

Getting Started 1. 2. 3. 4. 5. 6. Search on “KML” in Google Click

Getting Started 1. 2. 3. 4. 5. 6. Search on “KML” in Google Click on “KML Documentation Introduction” Click on “KML Tutorial” Scroll down to light blue boxes Copy everything in the box into a new Note. Pad file Save as “text. kml”

Drag KML file into Google. Earth � What is the approximate coordinate? � What

Drag KML file into Google. Earth � What is the approximate coordinate? � What is the name? � What is the description?

Writing KML Files � Open Google. Earth and Notepad � Steps: ◦ ◦ ◦

Writing KML Files � Open Google. Earth and Notepad � Steps: ◦ ◦ ◦ Edit in Note. Pad Save to a file on the desktop Double click on the file Click “Yes” to reload and view the file Repeat � Change name, description

“Simple” KML File with 1 Point <? xml version="1. 0" encoding="UTF-8"? > <kml xmlns="http:

“Simple” KML File with 1 Point <? xml version="1. 0" encoding="UTF-8"? > <kml xmlns="http: //earth. google. com/kml/2. 2"> <Document> <Placemark> <name>Name of the Placemark</name> <description> Description appears in the balloon </description> <Point> <coordinates>102. 595626, 14. 996729</coordinates> </Point> </Placemark> </Document> </kml>

Where to go from here � Multiple points ◦ Add “Document” tags” ◦ Add

Where to go from here � Multiple points ◦ Add “Document” tags” ◦ Add another point, save, view � Some fun stuff - Photos, paths, etc. � KML “Developer’s Guide” � KML Reference

Discussion Points � How would you use this in your classroom? � What types

Discussion Points � How would you use this in your classroom? � What types of data would kids find cool to put into Google. Earth?

What is it you just did? � Web server/client architecture � Spatial Data File

What is it you just did? � Web server/client architecture � Spatial Data File format: KML � Converting from Excel to KML � How to edit KML files