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

15 comments to Google Earth Network Links Explained

  • 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.

  • Ledrappier

    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

    • 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.

  • 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?

    • 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.

  • Ledrappier

    @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

  • Matt

    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.

  • marcela

    hi I wan´t to know if this tool allows to edit, add or delete information by other users, I’m interested in do that, we have a investigation group and we want to share the information but each of the participants need to have access to edit it.
    Thanks for your information!

    • Theoretically, you should be able to have multiple users update each others information using network links. But updating the information on the server holding the KML data might be a bit tricky.

  • I agree with the premise of your article but simple it is not for the ordinary content manager!

    I have developed a place for MPGC from google maps, saved as a klm file and imported into GE to create a fly past. So far so good.

    Now want to publish and also edit the file so created a network link which I have no idea how but ended up as….
    http://maps.google.com/maps/ms?hl=en&ie=UTF8&view=map&vps=1&jsv=255b&oe=UTF8&msa=0&msid=101454607916082374676.00048b47092afca09ae3e&output=kml
    Now every time I try to edit I loose changes on refresh
    I tried save a copy as (kml or kmz) to local drive import as temporary places & edit then save to my places (network link as abobe) but all information lost except original.
    So there must be a method of creating, editing and publishing re-editing that I cannot get my head around and would like your article to just out-line for the uninitiated!

  • wil

    I added a network link to a file on my computer’s hard drive and it worked, I was able to view the points in Google Earth. When, however, I added a link to a file on our server, it did not work. The link name appears in the table of contents on the left, but I am not able to see it in Google Earth. I am also not able to view the properties of the file, such as to change opacity, scale of the label etc. I am able to do all of this when adding a network link to a local file, however.

    Advice appreciated.

  • wil

    oh, i appear to have fixed it. It needs to be a non UNC path… don’t start it with \\server\folder name\blah\blah.kml, start it with a mapped drive eg D:\folder\blah\blah.kml. weird

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>