Search The Google Earth Library
Loading
Home > Announcements > Google Earth Network Links Explained

Google Earth Network Links Explained

Network Links are a very powerful, but very simple, feature of Google Earth that every Google Earth user should understand.  Also, EVERY Google Earth content developer that hosts KML/KMZ files online should understand Network Links and make use of them when it makes sense.  So take a couple minutes and read below to learn how to make use of this powerful feature of Google Earth.

Background:

Normally when you add custom KML content to you My Places, all of the data included with that custom KML file gets added to your main myplaces.kml file (saved under Documents and Settings\username\Application Data\Google\GoogleEarth\myplaces.kml).  For example, if you were to click on this KMZ file link and save the content to your permanent My Places folder in Google Earth, then you would have just made your myplaces.kml file about 15 megabytes larger than it was before and you would notice that it now takes Google Earth several more seconds to start up.  Do this 10 or 15 times and your myplaces.kml file can quickly grow out of control.  Also, if the original author of that KMZ file updates it, then you would need to  go back to their website and download it again to get the update.

If instead, you decide to use a Network Link, some important things will happen:

  1. Instead of your myplaces.kml file becoming 15 megabytes larger, it will only become 1-2 kilobytes larger.  You can add 1,000’s of Network Links without having to worry about the size of your myplaces.kml file.
  2. If you create a Network Link to a remotely hosted KML file, and the original author of that KML file decides to update it in the future (and doesn’t change the url/filename), then that update will automatically transfer to your machine.
  3. If you create a Network Link to a KML file stored on your local hard drive, then it won’t affect the size of your myplaces.kml file and won’t affect Google Earth’s load time.

How does all this happen?  Simple, because the Network Link does not load the actual KMZ file until you enable the Network Link in Google Earth by checking the box next to it.  The table below gives some recommendations on when to use Network Links, and what type of Network Link to use.

Network Link to Remote URL:
  • KML data is updated frequently by the author
  • KML data is less than 2-3 megabytes
  • KML data is not accessed very often
Network Link to local file on hard drive:
  • KML data is rarely updated
  • KML data is larger than 2-3 megabytes
  • KML data is frequently accessed
Network Link Not Necessary:
  • KML data is very small (less than 100K)

Creating a Network Link:

If your still reading, then I must have convinced you Network Links are a good thing.  So how do you create a Network Link?  Simple:

  1. Copy the URL of the KML/KMZ file that you want to add.  (right-click on the link and select Copy Link Location or Copy Shortcut).
  2. Go to Google Earth and select Network Link from the Add menu at the top.
  3. Put your cursor in the box next to Link and hit CTRL-P to paste the URL of the KMZ file into that box.
  4. Type in something in the Name field at the top.
  5. That’s it.  Leave everything else as the default values.

Congratulations, you’ve just created a Network Link.  Now you can save the Network Link under your permanent My Places folder in Google Earth just like you normally would.

You can also use Network Links for content stored on your local hard drive.  Instead of pasting the URL into the Link box, just click Browse and select the file on your local hard drive.

Content Developers:

If you host KMZ/KML files online, you should consider using Network Links when it makes sense.  The advantages are that the user will not have to manually create one and if you update your KML code in the future, the update will automatically propogate to the user.  Also, users can pass around a Network Link through email, etc, much easier than the larger KML/KMZ file.  The disadvantage of course is increased load on your server since the users will be downloading the main KML file each time they access it.

Or maybe even give the user the option of choosing between direct download of the entire KML/KMZ file or a Network Link.  In fact, as I write this, I’m thinking I may add this option to files on my blog.

Below is some sample code for a very basic Network Link.  Simply fill in the Name, Description and the URL to the KMZ/KML file that you want it to load.  Then save as KML file and use this for the link the users will click on to access files on your website.

<?xml version=”1.0? encoding=”UTF-8″”>
<kml xmlns=”http://www.opengis.net/kml/2.2? xmlns:gx=”http://www.google.com/kml/ext/2.2″ xmlns:kml=”http://www.opengis.net/kml/2.2? xmlns:atom=”http://www.w3.org/2005/Atom”>
<NetworkLink>
<name>XXXXXXX</name>
<visibility>0</visibility>
<Snippet maxLines=0></Snippet>
<description>XXXXXXXXX</description>
<flyToView>1</flyToView>
<Url>
<href>http://XXXXXXXX.kmz</href>
<viewRefreshMode>onRequest</viewRefreshMode>
</Url>
</NetworkLink>
</kml>

That’s it.  If you have any other suggestions or tips regarding Network Links, please leave a comment below.

  • Share/Bookmark

Related posts

Categories: Announcements Tags:
  1. June 3rd, 2009 at 05:51 | #1

    I agree! Especially if you are going to have really frequent updates, NetworkLinks are the way to go. I just developed a simple more or less realtimetracker based on network link in conjunction with the expire header… Therefore, GE updates the KML file every few seconds. With the Update feature available with KML 2.2 it is also possible to only receive the updates aka the delta data! The only drawback till now is the poll instead of a push mechanism. But I think, extending GE with a plugin/module could fix this easily.

  2. Ledrappier
    August 24th, 2009 at 05:49 | #2

    Hi…

    Question… I have a NetWorklink which link to a big .kmz file…
    When i use “Save as… ” to save my Networklink as a KMZ FILE, i obtain a KMZ FILE with the kmz file inside… i mean that now, the networklink is linking to a file in files/…. and not to the original one which is on a remote location…
    So in my final KMZ FILE, the networklink is not usefull because the kmz file which is initially pointed by the Networklink is now inside ths KMZ FILE…

    is it clear for someone?
    thanks

    • August 24th, 2009 at 09:52 | #3

      Question… I have a NetWorklink which link to a big .kmz file…
      When i use “Save as… ” to save my Networklink as a KMZ FILE, i obtain a KMZ FILE with the kmz file inside… i mean that now, the networklink is linking to a file in files/…. and not to the original one which is on a remote location…
      So in my final KMZ FILE, the networklink is not usefull because the kmz file which is initially pointed by the Networklink is now inside ths KMZ FILE…

      Not sure what’s going on. YOu should be able to use Save As to just save the small Network Link kml file without the large KMZ file. Maybe if you provide link to what you’re talking about, I can figure out what is happening.

  3. August 24th, 2009 at 09:20 | #4

    Any ide if it is possible to control access to the KML on the server by embedding a username and password. Id like to know If a kml subscription service is possible, with the use accessing the file from a network link. Of course they could just share the link (and username and password) with anyone so how could access be controlled. somekind of public key/private key arrangement?

    • August 24th, 2009 at 09:49 | #5

      Any ide if it is possible to control access to the KML on the server by embedding a username and password. Id like to know If a kml subscription service is possible, with the use accessing the file from a network link.

      Not sure how you’d do this. Beyond my level of expertise. You might try Google Groups. They have several forums for advanced KML, scripting, etc.

  4. Ledrappier
    August 24th, 2009 at 23:11 | #6

    @topomatt

    Hi..
    Waht do you mean by ” if you provide link to what you’re talking about”?

    you write: “should be able to use Save As to just save the small Network Link kml file “…
    I don’t have the problem when i save the NetWorkLink as KML… but I would like to save my NetWorkLink in a KMZ file… and then, i have my problem… i mean in the resulting KMZ, the NetWorkLink is pointing on a file inside the KMZ and not the original one…
    do you see?

    thanks

    • August 24th, 2009 at 23:47 | #7

      I mean, I’d have to somehow see your file. Not sure if it’s onlines somewhere.

  5. Matt
    October 23rd, 2009 at 12:33 | #8

    GE may include the linked material in the kmz if the network link is pointing to a UNC path such as C: or \\server. For instance, if i make a network link to an image on my C drive and create a KMZ of that network link, the image is compressed into the kmz. You need to use a URL in the network link to have it not place the image in the kmz. Since kml holds only text information, it can only use the path of the image.

  1. June 1st, 2009 at 12:45 | #1
  2. September 8th, 2009 at 10:02 | #2