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
- Download buildings.zip.
- 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.
- Create a datastore called "postgis" from the postgis database.
- 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. - On the Feature Type Editor page:
- Set the Style to polygon

- Generate the bounding box

- Set the KML Regionating Attribute to "height"
- Set the KML Regionating Strategy to "external-sorting"

- Set the Style to polygon
- 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.
- On the file system navigate to the root of the GeoServer data directory.
- Create a new file named time.ftl under the featureTypes/postgis_buildings directory.
time.ftl
${height.value}
View the Data in Google Earth
- In a web browser navigate to http://localhost:8080/geoserver/wms/kml?layers=topp:buildings&kmattr=false.
- Open the result in Google Earth.

- Zoom to lower Manhattan and wait for the buildings to load.
- Tilt the camera toward the horizontal.

- Zoom through lower Manhattan viewing watching the buildings load as they come into view.