This tutorial will illustrate a typical approach for creating a basic 3D model by taking 2D
CAD data and extruding it to 3D. In this workspace, building outline geometries will be read from
an AutoCAD source file with the DWG DXF reader while related height attribute information
will simultaneously be loaded from a CSV table and merged onto the building outlines using
the outline key identifier.
Let's launch FME workbench and create a blank workspace. We will begin by adding our AutoCAD
source file, we must expose the extended entity data of the DWG file; we can do this within
the parameters section by setting the group entities by to attribute schema.
Now let's add our CSV file to the canvas. It is important to understand that both of
our source data sets share an attribute that stores an identifier for every building; we
will use this information to join the height of the buildings with their outlines.
A feature merger is used to join the building outline geometries to our CSV table containing
the heights for each building. To preserve the geometry of the building outlines, the
outlines are connected as requesters and the CSV Heights as suppliers.
Now let's adjust our parameters; let's set the attribute values of both our requesters
and suppliers to be outline_ID.
Now that we have moved the mean height onto our building outlines we can extrude the data;
so let's go ahead and add an extruder transformer to our canvas. We should connect the merged
of our feature merger to our extruder.
Let's adjust our parameters so that the attribute value of our extrusion height will be mean_height.
We already know that we want to write out to KML, however, in order to write data to
a KML file it needs to have a lat/long coordinate system; we can add a CSmap re-projector transformer
and alter its parameters so that it will reprojector to a lat/long coordinate system.
Now let's add our KML writer to the workspace; go ahead and set up your writer format and
data set. For our destination schema, we will select the outlines schema, from one of the
reader feature types. Let's give this feature type a new name; I will call it buildings.
Go ahead and connect the reprojector to our KML buildings.
Let's run the workspace.
Now let's take a look at our output file; open the containing folder and double-click
on the file to open it in Google Earth.