FME Version
Files
-
- 600 KB
- Download
Introduction
Both IFC and CityGML have a hierarchical data structure. However, IFC’s structure is more complex, and contains intermediate features not required in CityGML. For example, in IFC Doors are the children of Openings, which in turn are the children of Walls, while in CityGML, Doors are children of Walls.
As well, the features are grouped somewhat differently. For example, parts of windows and stairs are contained in the IFC Member feature and must be added to their parent feature when converting to CityGML.
This example shows how to convert from a high detail IFC model to a CityGML with a Level of Detail (LOD) of four. This workspace is comprehensive enough to handle most Architectural IFC datasets.
Downloads
-
Download Data (Data can be downloaded from Vectorworks)
Step-by-step Instructions
Due to the sheer complexity of this workspace, this tutorial is a high-level overview. For parameter specifics, please open the workspace. Key parameters are mentioned.
Source Data
This workspace uses the DC Riverside Building LOD 300 IFC file, before beginning please download the data, which is from the Vectorworks website.
DC_Riverside_Bldg_LOD_300.ifc viewed in Solibri Model Viewer
Part 1: Create parent/child lookup
IFC features hold links to their parent features, but to remove unneeded intermediate features (like Openings) we also need links to the grandparent features. To do this we use two separate Industry Foundation Class STEP (IFC) readers. This first reader reads all the IFC features and populates a lookup table of feature and parent IDs as variables, and also a lookup table of parent types. Because this first reader does not use the IFC geometry, it runs quickly. FME runs its readers sequentially so that this reader will finish, and the lookup tables will be completely populated before the second reader starts.
Create a parent/child lookup table
Part 2: Create building
The second IFC reader is used for the data conversion. The Building is a simple conversion to remove any geometry using the GeometryRemover transformer and then and AttributeRenamer transformer to set the ifc_unique_id to the gml_id.
A simple conversion to remove geometry from the building
Part 3: Convert complex IFC solid geometry to MultiSurface
All of the conversions will need to convert the geometry from a complex IFC solid to MultiSurface that can be written to CityGML, so a custom transformer called ConvertGeometry is created to quickly duplicate this process.
Within the ConvertGeometry custom transformer, the IFC solid geometry is separated from the property sets with a GeometryPartExtractor transformer, then converted to surfaces with a GeometryCoercer transformer. Then to flatten multi-level geometry, it was disaggregated using the Deaggregator transformer and setting the Mode to Flatten All. Then the geometry is re-aggregate into MultiSurfaces using the Aggregator tranformer with the Mode set to Geometry - Assemble One Level and a GeometryRefiner transformer.
ConvertGeometry custom transformer workflow
Part 4: Get grandparent ID
Almost all features have their parent link set to the IFC Building Story, instead of the Building, so we need to move up one link to create the CityGML parent link to the Building, using the lookup tables stored in the variables. Since this will be repeated throughout the workspace, another custom transformer called GetGrandParentID is created.
A BinaryEncoder transformer is used with a User Parameter created for Attribute to Encode. Then a VariableRetriever tranformer is added to set the _gparent_id. Finally, the _gparent_id is decoded, and another User Parameter is created for Destination Attribute using the BinaryDecoder transformer.
GetGrandParentID custom transformer workflow
Part 5: Set CityGML LOD Name and Feature Role
Before writing out to CityGML, a couple of attributes always need to be set following a strict naming convention. A CityGMLGeometrySetter custom transformer has been created to prevent data entry errors and can be found on the FME Hub. This transformer sets the CityGML Lod Name and the Feature Role.
Part 6: Simple conversions
Simple conversions require minimal filtering if any at all before writing out to CityGML. The main workflow goes as follows:
- Read in IFC data
- ConvertGeometry
- Set the gml_id
- GetGrandparentID
- CityGMLGeometrySetter
- Write out to CityGML
Example simple conversion, converting IfcSpace to a CityGML Room
Part 7: Complex conversions
CityGML BuildingInstallation and WallSurface features are made up of many IFC feature types, and some IFC features may be part of both. IFC Members, StairFlights, Slabs, and Railings are combined into Stairs, which are then written as BuildingInstallations, along with Columns and Beams. Other Members are combined into CurtainWalls, which are written out to WallsSurfaces, as are IFC features Wall and WallStandardCase.
These separations and combinations can require several lookups of parent type and grandparent IDs from the variables created by the first IFC reader.
Part 8: Results
Output CityGML file viewed in FZK Viewer
Data Attribution
Riverside Building demo project data produced by Nemetschek Vectorworks.
Comments
1 comment
hello.
I know that CityGML has versions 1.0 to 3.0. Is the current article based on version 1.0 of CityGML?
Please sign in to leave a comment.