65
Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Embed Size (px)

Citation preview

Page 1: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Incorporating Google Maps and Google Earth into your Remote Sensing Applications

J. FreemantleOARS Technical Meeting,Dec 11, 2006

Page 2: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Outline

Overview of Google EarthSimple examples using keyhole markup language (kml)Using the Google Maps/Earth APISome community examplesQuestions?

Page 3: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Earth

Client/Server ApplicationFree for basic versionWorks on Windows (2000/XP), Mac OS 10.3.9, Linux

Page 4: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 5: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Earth Overview

Satellite and Airborne Imagery 1-3 years oldSpatial resolution in countryside < 15 m. Major US cities less than 1-2 feet (20-40 cm).Parts of Manhattan (Fulton Co.) 10 cm!

Page 6: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

York University

Page 7: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Newmarket

Page 8: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Low vs high res. data (Aurora)

Page 9: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Toronto

Page 10: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

New York City (20 cm)

Page 11: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

New York City (10 cm)

Page 12: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

10 and 20 cm images compared

Page 13: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Primary Data (roads etc)

Page 14: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Boundary Errors

Page 15: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Why Google?

Its free!!!Generally up to dateLarge user communityDeveloper/programmer friendlyEasy to learnPlatform independentIts cool!

Page 16: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Assumptions/Caveats

Check the fine print of End User License (EUL) for your situation.Google Earth 4.0 (Beta), free version.Public/Private data? (choose wisely).

Page 17: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple Examples using KML

PointPicturesTracksOverlaysLinks to external data

Page 18: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Warning Code Examples!

Page 19: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Keyhole Markup Language (kml)

Xml grammar and file format for describing geographic features in google earth/maps

PointsLinesPolygonsModelslinks

Page 20: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Keyhole Markup Language (KML)

KML files can be shared.KMZ files are a compressed version of KML files.Google Earth processes kml files like web browsers process html files.

Page 21: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Kml example: Simple point

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Placemark> <name>OARS Meeting</name> <description><![CDATA[Incorporating Google Maps and Google Earth into your Remote Sensing Applications <br>Presented by Jim Freemantle <br>Dec 11, 2006 7:00 pm <br>Room 129 Chemistry Building, York University, Toronto. <br>]]></description> <Point id="khPoint616"> <coordinates>-79.508,43.773225,0</coordinates> </Point></Placemark></kml>

Page 22: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple Point

Page 23: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple Point

Page 24: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple point, with link

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Placemark> <name>OARS Meeting</name> <description><![CDATA[Incorporating Google Maps and Google Earth into your Remote Sensing Applications <br><a href=“http://www.oars.on.ca/meetings.php”> details </a><br>]]></description> <Point id="khPoint616"> <coordinates>-79.508,43.773225,0</coordinates> </Point></Placemark></kml>

Page 25: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple point with link

Page 26: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple point, with image

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Placemark> <name>OARS Meeting</name> <description><![CDATA[Incorporating Google Maps and Google Earth into your Remote Sensing Applications <br><a href=“http://www.oars.on.ca/meetings.php”> details </a><br><img src="c:/documents and settings/user/my documents/my pictures/jim_pic.jpg"/>]]></description> <Point id="khPoint616"> <coordinates>-79.508,43.773225,0</coordinates> </Point></Placemark></kml>

Page 27: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Simple point with image

Page 28: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Track<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Document> <name>t0490f13</name> <Placemark>

<name>t0490f13</name><description><![CDATA[Flight Line 13 tape 490 CASI 2001 <br>]]></description> <LineString><coordinates>-68.8911,48.79734,2470.74 -68.8947,48.79449,2471.35 </coordinates><coordinates> -68.9127, 48.78028,2466.96,-68.9164,48.77747,2469.82 </coordinates> </LineString> </Placemark></Document></kml>

Page 29: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Track

Page 30: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Track

Page 31: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

Page 32: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

RequirementsGPS device Camera with EXIF format jpg files and internal clockSoftware to sync gps track with time of photoSoftware to create google earth file (.kml)

Page 33: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

GPS Devices Used

Sony GPS-SC1 ($129.00)

Garmin Forerunner 201Runners GPS ($159.00)

Page 34: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

Software UsedGPSBabel (NMEA to GPX)GPS Image Tracker (Sony) (Not required)iTag

Page 35: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

Page 36: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

Page 37: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

GeoTagging

Page 38: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Overlays

Getting your georeferenced data into Google Earth

Need georeferenced dataManually imported, as a jpg image, and matched to Google Earth

Page 39: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Overlays

Page 40: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Overlays

Page 41: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Links

ImagesExternal websites via urlDatabases

Page 42: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Track with link<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Document> <name>t0489f06</name> <Placemark>

<name>t0489f06</name><description><![CDATA[Flight Line 06 tape 489 CASI 2001 <br><a href="http://www.aerocan.net/tapedb.xml#489"> Link to Flight Log </a> <br>]]></description> <LineString><coordinates>-68.8911,48.79734,2470.74 -68.8947,48.79449,2471.35 </coordinates><coordinates> -68.9127, 48.78028,2466.96,-68.9164,48.77747,2469.82 </coordinates> </LineString> </Placemark></Document></kml>

Page 43: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Track with link

Page 44: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Point with link<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.0"><Placemark> <name>Waskesiu</name> <description><![CDATA[Aeronet Sites Worldwide<br><a href="http://aeronet.gsfc.nasa.gov/cgi-bin/ type_one_station_opera_v2_new?site=Waskesiu&nachal=2&aero_water=0&level=1 &if_day=0&year_or_month=0">Link to Waskesiu data</a><br>]]></description> <Point id="khPoint616"> <coordinates>-106.083,53.916698,550</coordinates> </Point></Placemark></kml>

Page 45: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Point with Link

Page 46: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Earth/Map Application Programmer Interface (API)

Sign up for your keyCan be used only on requested web accessible directory eg. http://www.example.com/gmapsReceive example script and put it in that directoryBuild Google Map applications from there

Page 47: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Jim's Google Maps JavaScript API Example from M. Brown</title> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=xxx" type="text/javascript"></script> <script type="text/javascript">

//<![CDATA[ var largemapcontrol = new GLargeMapControl(); function load() { if (GBrowserIsCompatible()) { var map = new GMap(document.getElementById("map"));

GEvent.addListener(map,'click',function(overlay,point) { var latLngStr = '(' + point.x + ', '+ point.y + ')<br/>'; var message = document.getElementById("message");message.innerHTML = latLngStr;});

map.centerAndZoom(new GPoint(-79.505, 43.77382), 4); map.addControl(largemapcontrol); } } //]]>

</script> </head> <body onload="load()" onunload="GUnload()"> <div id="map" style="width: 500px; height: 300px"></div> <div id="message"></div> </body></html>

Page 48: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Map API

Page 49: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Earth API

Link to dynamically generated kmlNo API key required

See http://earth.google.com/kml/kml_tut.html#tracking_point

Page 50: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Google Earth Example<?php// get the time$timesnap = date("H:i:s");

$BOX=$_GET[BBOX];// split the client's BBOX return by commas and spaces to obtain an array of coordinates$coords = preg_split('/,|\s/', $BOX);

// for clarity, place each coordinate into a clearly marked bottom_left or top_right variable$bl_lon = $coords[0];$bl_lat = $coords[1];$tr_lon = $coords[2];$tr_lat = $coords[3];

// calculate the approx center of the view -- note that this is innaccurate if the user is not looking straight down$userlon = (($coords[2] - $coords[0])/2) + $coords[0];$userlat = (($coords[3] - $coords[1])/2) + $coords[1];

$response = '<?xml version="1.0" encoding="UTF-8"?>';$response .= '<kml xmlns="http://earth.google.com/kml/2.0">';$response .= '<Placemark>';$response .= '<name>'.$timesnap.'</name>';$response .= '<Point>';$response .= "<coordinates>$userlon,$userlat,0</coordinates>";$response .= '</Point>';$response .= '</Placemark>';$response .= '</kml>';echo $response;

?>

Page 51: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 52: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 53: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Examples from the Community

“Mashups”

Page 54: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 55: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 56: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 57: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 58: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 59: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 60: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 61: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006
Page 62: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Acknowledgements

Data providers J. Miller (York U), A. Smith (Agr. Canada)

Colleagues I. Lumb, L. Gray

Page 63: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Resources

http://earth.google.comhttp://maps.google.comhttp://www.oars.on.ca“Hacking Google Maps and Google Earth” by Martin C. BrownCheck back on the OARS website for a copy of these slides and list url of useful links

Page 64: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

ResourcesInteresting linksGeoTagging "adding location information to pictures"

http://www.iceburnslair.com/mapper/http://wwmx.org/Download.aspxhttp://www.oziphototool.com//http://www.gpsbabel.org/http://itagsoftware.awswa.com/Interesting discussion at Canadian Canoe Routes on this topic:http://www.myccr.com/SectionForums/viewtopic.php?p=183038Mashups:http://www.beerhunter.ca/OttawaAreahttp://googlemapsmania.blogspot.com/

Page 65: Incorporating Google Maps and Google Earth into your Remote Sensing Applications J. Freemantle OARS Technical Meeting, Dec 11, 2006

Questions?