Google Earth integration

GeoWebCache can integrate with Google Earth. Google Earth is an application that is installed locally, unlike Google Maps and Microsoft Virtual Earth, which are JavaScript applications that can be run in a web browser. As such, GeoWebCache integration with Google Earth is different from Google Maps or Virtual Earth.

Google Earth receives data in KML format, which is a variant of XML. GeoWebCache also automatically creates super-overlays to give the compelling streaming effect on Google Earth. Please see the Google KML API documentation for details on creating custom Google Earth demos.

To integrate a layer served by GeoWebCache with Google Earth, you can use the following XML code as a template.

<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
  <Folder>
    <NetworkLink>
      <name>SuperOverlay:TITLE_OF_LAYER</name>
      <Region>
	<Lod>
          <minLodPixels>128</minLodPixels>
          <maxLodPixels>-1</maxLodPixels>
        </Lod>
      </Region>
      <Link>
        <href>http://EXAMPLE.COM:PORT/GEOWEBCACHE_PATH/kml/YOUR_LAYER/x0y0z0.kml</href>
        <viewRefreshMode>onRegion</viewRefreshMode>
      </Link>
    </NetworkLink>
    <LookAt id="superoverlay">
      <longitude>-96</longitude>
      <latitude>39</latitude>
      <range>6000000</range>
    </LookAt>
  </Folder>
</kml>

A few notes on the above template:

1.

<name>SuperOverlay:TITLE_OF_LAYER</name>

This will be displayed in the "Places" window. Replace TITLE_OF_LAYER with the name of your layer. This is a title, not code, so exact syntax isn't necessary here.

2.

<href>http://EXAMPLE.COM:PORT/GEOWEBCACHE_PATH/kml/YOUR_LAYER/x0y0z0.kml</href>

This line is where the URL containing the layer served by GeoWebCache is explicitly invoked. Change EXAMPLE.COM:PORT to your website and port number. Change GEOWEBCACHE_PATH to the path of your GeoWebCache instance (Examples: /geowebcache or /geoserver/gwc/service). Change YOUR_LAYER to the name of your layer (Example: topp:states).

For more information on KML syntax, please see the Google KML API documentation.