FME Version
Files
-
- 100 KB
- Download
Introduction
This tutorial demonstrates a basic IFC to CityGML translation with a low level of detail: IFC LOD100 to CityGML LOD2.
Downloads
- Download Data (Data can be downloaded from Vectorworks)
Step-by-step Instructions
1. Download data
This exercise will be using the DC Riverside Building LOD 100 IFC file, before beginning please download the data, which comes from the Vectorworks website.
2. Read source IFC
In a blank workspace add an Industry Foundation Class STEP Files (IFC) reader to the canvas and browse to the DC_Riverside_Bldg-LOD_100.ifc dataset. We will want to read in the IfcSpaces geometry type, so in the reader parameters, set the Read IfcSpace Geometries to Yes. Click OK to add the Reader.
IFC Reader parameters; change Read IfcSpace Geometries to Yes
In the Select Feature Types dialog, only select IfcSlab and IfcSpaces. These are the two layers needed to create a simple lod2Solid geometry. The IfcSlab represents the floors and roofs, and the IfcSpace represents the space between these floors.
3. Create a single mesh
The IFC features need to be merged into a single feature that represents the building. Add a Triangulator transformer to the canvas and connect it to both the IfcSlab and IfcSpace feature type. In the parameters, ensure that Aggregate Handling is set to Deaggregate. This transformer breaks the input geometry into a mesh for each of the flattened components. When we run this workspace later on, some of the features will be rejected, so to ensure that the workspace continues running we need to set the Rejected Feature Handling. Right-click on the <Rejected> output port on the Triangulator, expand the Workspace: Rejected Feature Handling, then click on Continue. The red dot next to the <Rejected> port will disappear when this is set correctly.
Now that the meshes have been created for each component we need to merge them together so we can work with a single mesh. Add a MeshMerger transformer to the canvas and connect it to the TINSurface output port on the Triangulator. This will merge the 59 individual meshes into a single mesh.
Create a single mesh using the Triangulator and MeshMerger
4. Set Attributes and traits
CityGML has specific standards for attribute naming in order for the file to be readable. Thankfully there is a custom transformer to create these attributes. Add a CityGMLGeometrySetter custom transformer to the canvas. In the parameters set the CityGML Lod Name to lod2Solid and the Feature Role to cityObjectMember. You could create these attributes using an AttributeCreator and a GeometryPropertySetter, but using this custom transformer prevents typos because these attribute values are case sensitive.
Set CityGML Lod Name to lod2Solid and Feature Role to cityObjectMember
We have other attributes we’d like to create that don’t need to follow the strict standards. Add an AttributeCreator transformer to the canvas and connect it to the CityGMLGeometrySetter. In the parameters set up the following attributes:
Attributes To Create | Attribute Value |
citygml_level_of_detail | 2 |
gml_id | gml_@UUID() |
gml_name | dc_riverside_building |
Create citygml_level_of_detail, gml_id and gml_name attributes
5. Scale and set coordinates
There is no coordinate system information stored in the IFC model, but there is a KML file of the building available. If you would like to explore the KML model, you can download it from the VectorWorks website.
We will need to scale the model because it is currently in millimetres. Add a Scaler transformer to the canvas and connect it to the AttributeCreator. In the parameters, set the Scale Factor for X, Y, and Z to 0.001 which will scale it to meters.
Next, add a LocalCoordinateSystemSetter transformer to the canvas, set the following:
Origin Coordinate System | LL84 |
Origin X | -76.986560155564575 |
Origin Y | 38.876070469421258 |
Set the Origin X and Y in the LocalCoordinateSystemSetter
Finally, reproject the data into the desired coordinate system. To do this, add a CsmapReprojector transformer to the canvas. In the parameters, set the Destination Coordinate System to EPSG:2248 and then change the Vertical Handling to Heights are relative to the ellipsoid(s) or geocentric.
6. Write to CityGML
Add a CityGML writer to the canvas and name the dataset Riverside_LOD2City.gml. Set the Feature Type Definition to Automatic and then connect it to the CsmapReprojector. In the Feature Type parameters set the Feature Type Name to Building.
Run the workspace and inspect the output. Note, that if your workspace terminates at the Triangulator, ensure that Rejected Feature Handling was set to Continue in Step 3.
Completed workspace
Output CityGML viewed in the FME Data Inspector
Data Attribution
Riverside Building demo project data produced by Nemetschek Vectorworks.
Comments
0 comments
Please sign in to leave a comment.