20
S Beginning KML Looking at Data with Google Earth

Beginning KML Looking at Data with Google Earth

Embed Size (px)

Citation preview

Page 1: Beginning KML Looking at Data with Google Earth

S

Beginning KMLLooking at Data with Google Earth

Page 2: Beginning KML Looking at Data with Google Earth

Review: XML, HTML

Data Descriptive data vs. List of data

XML Tags, Attributes Opening/Closing tags

HTML XML Tags for the web

Page 3: Beginning KML Looking at Data with Google Earth

Look at Websites

Let’s look at your websites

Any questions?

Let’s look at some sites online! Google Chrome -> Inspect Element

Page 4: Beginning KML Looking at Data with Google Earth

Before KML

Let’s Check Google Earth! Is it on the computers? If not, let’s download it!

Google Earth can be put into a web site!

Page 5: Beginning KML Looking at Data with Google Earth

KML Basics

Points – Also called Placemarks

Paths A list of points

Page 6: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 7: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 8: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 9: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark> <name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark></kml>

Page 10: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name> <description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 11: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description> <Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 12: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point> <coordinates>126.949273,37.458426</coordinates>

</Point> </Placemark>

</kml>

Page 13: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>

126.949273,37.458426</coordinates> </Point>

</Placemark>

</kml>

Page 14: Beginning KML Looking at Data with Google Earth

Creating a KML Point

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>

<name>My SNU Office</name>

<description>Where I code</description>

<Point>

<coordinates>126.949273,37.458426</coordinates>

</Point>

</Placemark>

</kml>

Page 15: Beginning KML Looking at Data with Google Earth

Create Your own Placemark!

Find a Longitude and Latitude using Google Earth

Page 16: Beginning KML Looking at Data with Google Earth

Creating a KML Path

We will need to create a list of: Longitude Latitude Elevation

First an Example

Page 17: Beginning KML Looking at Data with Google Earth

Path Example:

Page 18: Beginning KML Looking at Data with Google Earth

Looking at Code

We will make our own Path

Use Google Earth to create a list of points

Then put them into a KML file, and load it into Google Earth!

Page 19: Beginning KML Looking at Data with Google Earth

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2"> <Document> <name>My Walking Path</name> <description>Examples of paths.</description> <Style id="yellowLineGreenPoly"> <LineStyle> <color>7f00ffff</color> <width>4</width> </LineStyle> <PolyStyle> <color>7f00ff00</color> </PolyStyle> </Style> <Placemark> <name>My Route to the Bus</name> <description>Transparent green wall with yellow outlines</description> <styleUrl>#yellowLineGreenPoly</styleUrl> <LineString> <extrude>1</extrude> <tessellate>1</tessellate> <altitudeMode>absolute</altitudeMode> <coordinates> 126.949421,37.458879,96 126.953857,37.454169,161 <!-- Many points were deleted for space --> 126.954024,37.454186,165 </coordinates> </LineString> </Placemark> </Document></kml>

Page 20: Beginning KML Looking at Data with Google Earth

Next Week

I want to look at embedding Google Earth with KML files on a website.

What would you like to do?

Can your phone record your GPS location and path? We can do cool stuff with this!