Archive for September, 2007

The KML Behind Network Links

Posted on September 20, 2007. Filed under: Google Earth, Network Links |

In my last post on Google Earth Network Links I covered the basic concepts of how this functionality can be used to provide dynamic access to geographic data in the Google Earth viewer.  We briefly discussed the KML elements that are used to define a Network Link, but in this post I’d like to expand on the KML elements used to enable this functionality.

<NetworkLink>
The <NetworkLink> element inherits from the <Feature> element as do the <Placemark>, <Overlay>, and <Container> elements.  You can get more information on the KML Object Model here.  Because it is descended from <Feature>, <NetworkLink> inherits a number of child elements which define the basic characteristics of a Network Link which I won’t go into detail on here (see the Feature object in the KML Object Model for details).  The elements specific to <NetworkLink> include <Link>, <refreshVisibility>, and <flyToView>.  A <Link> with an <href> child element specifies the KML/KMZ file to load, and this file can either be from a local or remote source.  For example, the following code shows how to create a link to a remote KML source:

<Link>
     <href>http://www.geospatialtraining.com/NetworkLink/SeePlacemarks.kml</href&gt;
</Link>

In addition to linking to an existing KML/KMZ file you can also link to CGI scripts written in languages such as Python, Perl, Ruby, and others which can be created to provide dynamic data.  We’ll save this topic for another post.

Another element of <NetworkLink> is <refreshVisibility> which by default is set to a value of “0” and leaves the visibility of features within the control of the Google Earth user.  Setting the value to “1” resets the visibility of features each time the Network Link is refreshed.

The <flyToView> element when set to a value of “1” causes Google Earth to fly to the view of the root element in the refreshed file.  <LookAt> defines the camera for the view. The camera is the current viewpoint of the Google Earth viewer and includes things like the latitude, longitude the camera is looking at along with the altitude, range, tilt, and heading.

Here then is a quick KML code sample for creating a Network Link:

<NetworkLink>
     <name>Test Placemark</name>
     <visibility>0</visibility>
     <open>0</open>
     <description>This is a KML Network Link Test</description>
     <refreshVisibility>0</refreshVisibility>
     <flyToView>0</flytoView>
     <Link>
          <href>http://www.geospatialtraining.com/NetworkLink/SeePlacemarks.kml</href&gt;
     </Link>
</NetworkLink>

<NetworkLinkControl>
Now let’s move on to the <NetworkLinkControl> element which controls the behavior of files fetched by <NetworkLink>.  There are a handful of child elements of <NetworkLinkControl>, but the most important are <minRefreshPeriod>, <expires>, and <Update>.  Let’s start with <minRefreshPeriod>.  This element specifies the minimum allowed time between fetches of the file in seconds.  Therefore, if you want the minimum update time to be one hour this element would be set to <minRefreshPeriod>3600</minRefreshPeriod>.  The <expires> element is used to specify a date/time when the link should automatically be refreshed. 

<Update>
The child element of <NetworkLinkControl> that I want to highlight in particular is the <Update> element.  <Update> is used add, edit, or delete data from an existing KML file that has already been loaded.  This is powerful stuff! The <targetHref> child element specifies the KML/KMZ file that you would like to alter in some way.  Three child elements (<Change>, <Create>, and <Delete>) of <Update> are used to perform the editing tasks.  The <Change> element modifies the values of a geographic object that has already been loaded with <NetworkLink>.  Within the <Change> element, the object to be modified must include a targetID attribute that references the original element’s id.  The <Create> element is used to add new objects, and the <Delete> element deletes features that have already been loaded.  Here is an example of using the <Change> element with <Update>.

<NetworkLinkControl>
     <Update>
          <targetHref>http://www.geospatialtraining.com/GE/Data/Points.kml</targetHref&gt;
          <Change>
               <Point targetId = “point001”>
                    <coordinates>-97.23,35.35,0</coordinates>
               </Point>
           </Change>
     </Update>
</NetworkLinkControl>

The ability to add, edit, and delete data from an existing KML/KMZ file served through a Network Link opens up a lot of possibilities for delivering dynamic Google Earth applications to your end users.  This functionality combined with CGI scripting through Network Links makes it even more powerful.  For more information on the update functionality provided through <NetworkLinkControl> please click here.

In the next post on Network Links I’ll show you how to use a CGI script to dynamically generate data served through a Network Link.

Our “Mastering KML for Google Earth” course covers Network Links in great detail along with all the other ways that you can create custom Google Earth applications using KML.

Read Full Post | Make a Comment ( None so far )

Mastering KML in Google Earth

Posted on September 18, 2007. Filed under: GeoSpatial Training Services |

GeoSpatial Training Services will be releasing its latest e-learning course entitled “Mastering KML in Google Earth” on October 15th, 2007.  KML is an XML based file format used to display geographic data in Google Earth, Google Maps, and Google Maps for Mobile.  Data displayed in Google Earth is contained in KML files, and in our new e-learning course you will learn to master the use of KML for creating advanced Google Earth applications.

Course Modules

  • Introduction to KML
  • Basic KML Elements
    • Features
      • Placemarks
      • Ground Overlays
      • Screen Overlays
      • Folders & Documents
    • Geometry
      • Point
      • LineString
      • Polygon & Linear Rings
      • MultiGeometry
    • Styles
  • Advanced KML Elements
    • Using Network Links for Dynamic Data Display
    • Time Display
    • Regions

Skills Learned

  • Learn how to author KML documents
  • Understand the KML Object Model
  • Create new GE data including placemarks, paths, and polygons
  • Apply custom styles to your data and display
  • Add image overlays including USGS topographic maps in GE
  • Use Network Links to provide dynamic applications to your users
  • Create time display data in GE
  • Display KML files in Google Maps and Google Maps for Mobile

Read Full Post | Make a Comment ( None so far )

GIS Salary Resources

Posted on September 11, 2007. Filed under: Uncategorized |

I typically teach a couple GIS courses per semester at San Antonio College, and this semester is no different as I’m currently teaching “Introduction to GIS”, and “Programming for GIS”.  As part of my course materials for the “Introduction to GIS” course I always put together a lecture covering the various career tracks that one can take in this field along with general salary range information for the positions.  In general, I have found that students and even experienced professionals often don’t have a good grasp of the opportunities available to them so it’s good to cover this information.  Below you will find a list of salary resources for GIS professionals.  This is by no means an all inclusive list, but it should be a good beginning point for both students and active professionals.   These resources can help provide answers to questions such as:

  • Am I being compensated fairly for my skill set, level of experience, education, years of experience, certification, and geographic location?
  • What kind of compensation can I expect to earn by gaining various GIS skills and education?
  • I’m considering taking a position in another part of the country.  How does the cost of living compare?
  • What can I expect to earn in an entry-level position
  • What are the various GIS positions and how are they compensated
  • What is the compensation difference between public and private sector employment

GIS Salary and Employment

 Please feel free to contribute additional resources.

Read Full Post | Make a Comment ( None so far )

Dynamic Google Earth Applications with Network Links

Posted on September 4, 2007. Filed under: Google Earth, Network Links |

Introduction
Over the next few posts we are going to look at a how you can serve up dynamic Google Earth applications to your end users through the use of network link functionality.  Network link functionality provides a way for multiple clients to view the same network-based or web-based KMZ data and automatically see any changes to the content as those changes are made.   

 How it Works
Network links are functionally similar to traditional web content publishing in that they allow for the delivery of dynamic data to multiple users.  By distributing traditional network links or web links to your KMZ files, users can obtain a view only reference to your data through the GE interface.  As the content provider you can specify how often to refresh the data in the file through various GE tabs, KML parameters, or even CGI scripts that dynamically update the data.  Data is updated only at the source and provides a single point of entry for your specific data sets.  End users can also specify how often to refresh the data through the GE interface.  Although end users can specify how often to refresh data from the source, they can not modify the existing KML file.  It is possible, however, to save the file to their local computer.  The figure below gives you a visual depiction of this process.

 

Advantages
The advantages of sharing Google Earth data with your users through this method include accessibility (can be accessed via the web), ease of distribution, automatic data updates, and centralized backup.   

How to Create a Network Link in GE
Creating a network link from the GE interface is a simple process, but you will need to make sure that your content (KML/KMZ) has been saved to the server you are linking to.  Select Add à Network Link from the GE menu.  Give your network link a name, and specify the link to your file on a server.  The “Refresh” tab can be used to specify how frequently your data is refreshed.  See the figures below for more information on created a network link through the GE interface. 

 

KML
The primary KML elements used to define a network link include <NetworkLink> and <Link>.  <NetworkLink> is used to define the existence of a network link while <Link> combined with <href> specifies the location of the KML/KMZ file to load.  This can be a local link or a link to a remote server.  For instance, in the code example below, the <Link> element and <href> child element point to a dynamic Python CGI script (http://yourserver.com/cgi-bin/randomPlacemark.py) that will dynamically run when the network link is referenced.  Other important elements include <refreshVisibility> which is used to specify the data update frequency, <name> which contains the descriptive name of your network link, and <description> which as its name implies refers to the description you give to the link.
 

Dynamic Scripting
In my opinion, the most compelling reason to use network link functionality is the ability to dynamically update the data source on the fly through the use of CGI scripting languages such as Python, Perl, Ruby, PHP, and others.  In this case, each time the network link is accessed, a specific script is triggered which generates KML data streams to the network link.  This provides just in time access to the latest data for your application. The process works as follows:

  • Client (Google Earth) calls the server (KML/KMZ file)
  • Server (KML/KMZ) contains a pointer to a CGI script
  • CGI scripts runs and returns a KML stream (dynamic KML) containing the data for your application

 This provides powerful functionality for generating dynamic KML content. 

Examples
See some network link examples at Google Earth Hacks and Google Earth Blog. 

More Information
In the next post we’ll take a look at a specific example of how you can combine a Python script with network links to generate dynamic Google Earth content.  Our upcoming course “Creating Dynamic Google Earth Applications” covers the topic of network links in great detail.

For more information on integrating ArcGIS and Google Earth please consider our “Integrating ArcGIS Desktop and Google Earth” virtual training course.

 

 

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...