President, GeoSpatial Training Services, LLC
Our “Google Maps For Your Apps ” and “Integrating ArcGIS Data with Google Earth ” courses provide detailed information about Google Maps and Google Earth. Each course provides detailed audio and hard-copy lecture materials, visual demonstrations, and exercises designed to supplement the materials presented in our lectures. In addition, you can now purchase these courses as a bundle. Click the links provided above for more information.
The release of Google Earth 4 brought many new enhancements to an already fantastic geographic viewing tool, but in my opinion the most important new functionality is the introduction of the new Time control which allows you to incorporate time information into your existing GIS data. The addition of this fourth dimension greatly enhances the capabilities of Google Earth by enabling you to analyze patterns in your data over time. In this how-to article you’ll discover how to create time enabled, Google Earth format files (kml/kmz) using a combination of ArcGIS Desktop, Spatial Analyst, Google Earth, and your favorite text editor.
A new Time control has been added to the user interface which allows you to control the time period of the globe. The Time control, which is both functional and minimal, is only visible on the Google Earth display when TimeSpan tags are detected in your kml/kmz file.
The user interface for the Timer control consists of a draggable area containing a start and end date which you can expand or shrink along with controls for starting the time animation and displaying the Time properties form.
Time properties including the time zone, animation speed, and other options can be set from this dialog.
Data that has been tagged with time information will appear or disappear depending on the current time of the map. The TimeSpan tag represents an extent in time bounded by begin and end dates/times. The tag describes the beginning instant of a time period while the tag describes the ending instant of a time period. In the example below, the beginning time date is January 1st, 2003 and the ending time date is December 31st, 2003.
In this article we will integrate ArcGIS and Google Earth to analyze building permit data for the City of Austin, Texas for the years 1997 to 2003. Our analysis will be performed through the use of ArcGIS with the Spatial Analyst extension to create both raster and vector output files which will then be used to construct KML format files that display the results of our analysis through Google Earth and its new Time control. Before we get into the details of how to create a Google Earth file that contains a time based analysis of geographic data perform in ArcGIS lets first take a look at the finished product. If you haven’t already done so make sure you download a copy of Google Earth 4 before continuing with this article. To accomplish this task I have created two distinct output kml files. The first is a vector analysis of building permit data by census tract and displayed as a graduated color map. To visualize the results of this analysis please click here. Using the same data I have also created a “heat map” in raster format which can be viewed here.
Step 1 – Obtain GIS Data
I first obtained building permit data from the City of Austin, TX for the years 1997 through 2003 which had already been geocoded and stored as point data in shapefile format. Each year was stored in a separate shapefile. For more information regarding building permit data for the City of Austin please visit their website. This data was then loaded into ArcMap along with census tract polygons for purposes of a spatial join with the building permit data.
Step 2 – Process Data in ArcMap
In this particular case the goal was to create two distinct output kml files; one for the vector analysis and the other for the raster (“heat map”) analysis. In the case of our vector analysis I also added a census tract polygon layer that covers the Austin, Texas area. A series of spatial joins were then performed between each of the point shapefiles containing building permit data and the census tract polygon layer. For more information on performing spatial joins in ArcMap please reference the desktop help file. The result of each spatial join was the addition of a new field in the census tract polygon layer containing a count of the number of building permits issued for each tract. At the end of this processing I had fields for each year containing the number of building permits for that year. The addition of building permit counts by year is illustrated in the figure below.
Using each field in succession I then created a graduated color map for each year. Finally, using the Export Map function in ArcMap I then exported image files for each year in .png format. For example, I exported the building permit graduated color map from 2003 as go_Census_Tracts_2003.png. These image files will serve as the basis for our display of time data in Google Earth.
For our “heat map” raster density analysis the processing of our building permit data was analyzed using the Point Density tool in the Spatial Analyst extension of ArcGIS.
Just as with our vector graduated color maps I created individual raster layers for each year and exported to a .gif format image file using Export Map. You can see an example of this type of raster “heat map” in the figure below.
One final task that I performed in ArcMap was to gather the geographic extent in decimal degrees of the output images. This was accomplished very easily by setting my Data Frame Properties Display to “Decimal Degrees” and then moving the cursor to the maximum and minimum extents of the display and manually gathering the coordinate locations.
One additional consideration that you need to take into account is the transparency of your output images. Setting a transparency value allows you to see the underlying data sources provided by Google Earth while at the same time visualizing the results of your analysis. In this case I have set a transparency value of 50% on each output image through the Layer Properties Display tab. This step isn’t absolutely necessary though as transparency values can be set for the images in Google Earth.
Step 3 – Create KML/KMZ File
The final step in the creation of Google Earth time display data is the creation of the actual kml/kmz files that will display the data. There are a number of different ways that this can be accomplished, but for purposes of this article we’re going to actually create the final output file through a text editor (Notepad) so that you can get a good understanding of how this process works. However, we will create the initial baseline kml data file through Google Earth.
Open Google Earth, and create a folder to put the graphic files into by selecting Add à Folder in the Places Pane. Go ahead and give the folder a name like “Austin Building Permits 1997 – 2003” like you see below and click OK.
Now, right click on the newly created folder and select “Save As” and write out the file in .kml format (not .kmz for now). This will create the baseline structure of the kml file that we’ll now work with in your favorite text editor for the remainder of the tutorial. Close Google Earth and navigate to where you’ve saved the kml file and open it with your favorite text editor. You should see something like the figure below.
This will serve as your baseline file which we’ll now use to add image overlay and time display tags. Each image that we exported from ArcMap will need to be imported into the kml file as an image overlay. Below you will see an example of how to use the tag to import your image files as image overlays in Google Earth. This first ground overlay tag represents the 1997 building permit data at a census tract level.
There are a couple of things that I’ll point out about the attributes of the tag. Notice that the attribute contains a pointer to the image file that I have exported from ArcMap. In our kml file this is a hard-coded path to the image, but later we’ll see how you can alter this to a relative path name for easy distribution of your files. The other thing to note is the tag which contains bounding coordinates for you image. This is how you specify where Google Earth should place your image. Back in Step 2 we gathered the geographic coordinates of our display in ArcMap, and now it’s time to put these coordinates to use. By using this set of kml tags you have specified a pointer to an image file that you have created along with the bounding coordinates for where the image will be displayed in Google Earth. This code should be placed just below the 1 tag line.
Now that you know how to define an image overlay we need a way to add time data to each image so that Google Earth can display each of the images in a time based format. Earlier in the tutorial we said that the tag can be used to accomplish this task. By adding in the tag to our kml as you see below we can define the period of time for which each of our image overlays will be visible in Google Earth.
At this point we have fully defined the kml for a single ground overlay to display our building permit data for the year 1997. You will need to perform the exact same steps to import each of the remaining images in your collection to the kml file. This can be a tedious process, but through the use of cut and paste you can greatly simplify the task. You can download the full text of the code created in this tutorial by clicking here.
Once you’ve fully defined the kml tags for each image you can save the file and then open in Google Earth. You should see something similar to the following:
Notice that each image overlay has been added to the folder and the Time control is now visible and ready for use in Google Earth. There is one additional task that I would recommend performing to make the sharing and distribution of your files more efficient. Recall that in our kml file we have hard-coded the paths to our image files. By converting the kml file to a kmz format we can embed the images into the compressed kmz format file and in so doing alter the path to our images to a relative path rather than a hard-coded path. This can be easily accomplished in Google Earth by right clicking the folder and selecting Save As and selecting the .kmz format.
The physical structure of the resulting kmz file is shown below.
Notice that all the image files have been loaded into the kmz file and a new doc.kml file has been created. The contents of the doc.kml file are nearly identical to the kml file we created earlier with the exception that the paths to our image files are now relative paths.
To view the contents of a .kmz file you can simply rename the extension to .zip and then open the zip file.
Step 4 – Using the Time Control
As is the case with most Google Earth functionality, the time control is incredibly easy to use. When Google Earth detects the use of tags in your kml/kmz files it will automatically display the control.
Play Button – Used to start a time display animation from your kml/kmz file
Pause Button – Used to pause the time display animation
Display Time Properties – Displays the time properties form
Time Span – Draggable area that consists of a time span (start date and end date)
In this how-to article we have discovered a simple process for visualizing geographic data that has a time element through the use of ArcMap and Google Earth. This type of analysis is important in many GIS studies because it helps distinguish patterns in your data over time.
Mr. Pimpler is the owner of Geospatial Training Services, LLC, a provider of virtual and instructor led GIS training opportunities and the author of its popular virtual training course “Google Maps For Your Apps!” and the recently released "Integrating ArcGIS Data with Google Earth" For more information regarding training opportunities provided by GeoSpatial Training Services, please visit our website at http://www.geospatialtraining.com.
This article copyright (c) 2007 Eric Pimpler, GeoSpatial Training Services, LLC - http://www.geospatialtraining.com