Basic 3D KML

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2020.0

Introduction

In this demo, elevation values are used to extrude building outlines to create 3D KML building features. You will require Google Earth to view the output KML.

Note that this 3D forcing technique can be used in many scenarios, even for thematic mapping data such as earthquake intensity.

 

Video

Note, this video was created using an older version of FME and a different dataset but the workflow is still the same.

 

Step-by-step Instructions

1. Add an Esri Shapefile Reader

In a blank workspace, add an Esri Shapefile reader. Browse to the buildingfootprints.zip, then click OK to add the reader.

shapefilereader.jpg

 

2. Create Z Values

Add a 3DForcer transformer to the canvas. The 3DForcer uses an attribute value, in this case, Elevation, to add Z values to the coordinates of the 2D building features. In the parameters, set the Elevation to topelev_m.

3dforcer.jpg

 

3. Set KML Geometry Properties

Before we can write out to Google KML, we need to set some properties. Add a KMLPropertySetter to the canvas. Set the Altitude Mode to Relative Ground, this parameter specifies how the z values will be interpreted. Then set Extrude to Yes, this specifies whether to connect geometry to the ground.

kmlpropertysetter.jpg

 

4. Write to Google KML

Now add a Google KML writer to the canvas. Set the dataset to 3DBuildings.kml and click ok. In the KML writer parameters, you can set the appearance colors if desired.

kmlwriter.jpg

 

5. Run the workspace

Save the workspace and then run it. Once it has finished running, click on the writer feature type to open the popup menu, from here, click on Open Containing Folder.

openfolder.jpg

 

In the folder, open the 3DBuildings.kml file in Google Earth.

googleearthoutput.jpg

 

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.