05-Super Overlays and Extrudes with Building Data

This documentation is no longer maintained. Please see the new GeoServer documentation at http://docs.geoserver.org

Setting up a buildings dataset for viewing in Google Earth.

This tutorial applies to GeoServer 1.7.1 and above.
This tutorial requires a PostGIS installation.
This tutorial assumes that GeoServer is running on http://localhost:8080.

Introduction

This tutorial walks through the steps of setting up a dataset containing buildings for viewing in Google Earth. This includes configuring the dataset for KML super overlays and KML extrudes.

Getting Started

  1. Download buildings.zip.
  2. Unzip buildings.zip and import the result into PostGIS. For this tutorial it is assumed the name of the database is "postgis".
    psql postgis -f buildings.sql
    

Create the Feature Type

The first step will be to create the datastore and feature type for the building data imported in the previous section.

  1. Create a datastore called "postgis" from the postgis database.
  2. Create a feature type from the buildings table.
    Note that if the postgis database only has the buildings table in it this step will be performed automatically.
  3. On the Feature Type Editor page:
    1. Set the Style to polygon
    2. Generate the bounding box
    3. Set the KML Regionating Attribute to "height"
    4. Set the KML Regionating Strategy to "external-sorting"
  4. Apply and Save the configuration.

Create the Height Template

The next step is to create a height template which specifies which attribute of the buildings dataset should be used to generate KML extrudes.

  1. On the file system navigate to the root of the GeoServer data directory.
  2. Create a new file named time.ftl under the featureTypes/postgis_buildings directory.
    time.ftl
    ${height.value}
    

View the Data in Google Earth

  1. In a web browser navigate to http://localhost:8080/geoserver/wms/kml?layers=topp:buildings&kmattr=false.
  2. Open the result in Google Earth.
  3. Zoom to lower Manhattan and wait for the buildings to load.
  4. Tilt the camera toward the horizontal.
  5. Zoom through lower Manhattan viewing watching the buildings load as they come into view.
Added by Justin Deoliveira, last edited by Justin Deoliveira on Dec 04, 2008  (view change)
View Attachments (6) Info