GOOGLE EARTH ACTIVITY

Google Earth and Google Map work differently.  With Google Map you must create the Java and html code that creates markers, routes or polygons on your map and Google Map provides the map background, zoom tool and buttons to switch to and from map, satellite and hybrid backgrounds. Google Map has no 3-D capability or the ability to "fly" over or tilt your map.  Google Map is what is says it is - a map.  But it is a map where you can add content to the markers (points) on the map so that when you click on the point some information about it appears.

Google Earth makes a stab at being a representation of the real world.  It incorporates the third dimension very cleverly. Google Earth's ability to zoom around and tilt the world, sometimes with highly detailed aerial imagery behind the vector data along with its creative labeling where labels fade in and out make it the highest level GLAT around.  GLAT is an acronymn that, if you check Google, stands for Google Labs Aptitude Test but I first heard it as "Golly, look at that!!!"

Google Map and Earth handle locational information quite differently.  In Google Map it is embedded in the html but in Google Earth they use a version of XML, eXtensible Markup Language that they call KML (Keyhole Markup Language).  This comes from the name of the company, Keyhole, that developed it; Google purchased the company. 

XML and its variants are to data what html is to text; it allows you to format data and send it across the web.  Like html, XML uses elements, e.g. <MAP> and <AREA> in the last activity and these elements can act as parents and have children, e.g. the <AREA> element is a child to the <MAP> element in html .  Elements can also have attributes, information about the element.

  Go to c:\Document_and_Settings\Your_User_Name\Application_Data\Google\Google_Earth  and you will find a set of files that begin with myplaces and have various extenders.  Open myplaces.xml with Word Pad.  Open Google Earth and arrange your screen so you can see the Places box on the left and the myplaces.kml file on the right.  Here are the first 20 or so lines that contain most of the elements in the KML file.  The first two lines contain information about the version of XML being used and where the DTD (Document Type Definition) file is located on the Internet.  Then the <Document> element opens, the highest level element.  If you scroll to the bottom of the file, it closes there. Document parents can have folder children and the first folder is called My Places and it has several folders inside it.  It is just like computer folders.  You could have a customized folder called "Schools" that would locate all the schools in a community, another called "Parks" or "Fire Stations" or "Restaurants."   The "Restaurants" folder could have a folder called "Asian" with folders in there called "Indian", "Thai", "Vietnamese", and "Chinese"

Click on the Sightseeing folder in Google Earth and you will see the <description> element appear.  This element appears underneath the element to which it is a child (folder or placemark) and also in the popup when you click on the placemark.  Keep them short.

The <Placemark> element is where you locate points and put information about them. Placemarks, as parents, have the following elements as children:

<name> the name that appears in the table of contents
<description> what appears beneath the name and in the popup.  See the <Placemark> element for the Eiffel Tower for an example of how to embed a URL in the description
<LookAt> This is the location you will be looking from.  This element contains the following child elements:
    <longitude> longitude of the Placemark.  Must be in decimal notation with negative values for west longitude
    <latitude> latitude of the Placemark.  In decimal notation with negative values for south latitude.
    <range> altitude of the eye point
    <tilt>  the degrees of tilt for the view
    <heading> the direction you will be looking when you get there
<styleURL> the style of marker that will be placed.  You can customize this if you have a different marker you would like to use, know its width and height and location on the Internet.
<coordinates> the actual location of the point.  Usually the same as the <LookAt> coordinates.
 

Here is an example


<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<Folder>
<name>My Places</name>
<open>1</open>
<Folder>
<name>Sightseeing</name>
<open>1</open>
<description>Start your Google Earth world tour here! Click on an underlined placename for information, double-click to fly to the indicated location, and
click on the blue &quot;Play&quot; arrow below to start a tour.</description>
<Placemark>
<name>Google Campus</name>
<description>Google&apos;s Mountain View, California Campus is one of several corporate locations worldwide.</description>
<LookAt><longitude>-122.0839768933045</longitude>
<latitude>37.42218251594567</latitude>
<range>961.9293005206328</range>
<tilt>12.99787999810844</tilt><heading>-151.810674441166</heading>
</LookAt><styleUrl>root://styles#default</styleUrl>
<Point>
<coordinates>-122.0852756225358,37.42251611704262,0</coordinates>
</Point>
</Placemark>

Then the <Placemark> element closes with </Placemark>  In XML all tags must be closed.  a tag opens like this <Tag> and closes like this </Tag>.  They can open and close on the same or different lines.

Activity - Google Earth Files from Scratch

Make a Google_Earth folder in your c:\arcims\website folder. There is a simple KML file referenced at http://www.geography.ccsu.edu/harmonj/int_gis/google_earth_lubbock.htm  When you click on a KML link in Internet Explorer you would hope it opens Google Earth and goes to that location.  What you have to do is save the KML file to your Google_Earth folder, and from Windows Explorer double click on it. Anyway, save this file in your Google Earth folder and open it in Google Earth.  It will zoom to the two schools that are in the file already.

Use Google to find a free geocoder and a list of schools in Lubbock, TX, and add two schools to the Google Earth file. Use Notepad to edit the KML file and cut and paste on of the existing placemarks; just change the <name>, <description>, <LookAt> and <coordinates> elements to reflect the new schools' names, web pages and locations.  E-mail me your KML file so I can open it as well.

Activity - Google Earth Files from ArcMap

There is a script at http://arcscripts.esri.com/ called Export to KML 2.2.4.  Download and install it in an ArcMap file.  [See me if you do not know how to do this... this cannot be done through Citrix.] This will export a layer in kml. 

In the n:\int_gis_map\labs\Google_Earth_Activity folder there is a shapefile called Lubbock_schools_all.shp.  Symbolize the schools the way you would like them to be. When you click on the KML export buttopn (it looks like the Google Earth icon) this dialog shows:

 

 

Export the shapefile using the layer's symbology and NAME as the attribute for labeling features.  There is no height field.  Save it to your Google_Earth folder.    Edit that kml file in Word Pad  so that for one of the schools the description will point to the school's website.  E-mail me the kml file and the name of the school whose web page was implemented.

Some Web Resources