# A Simplified CityGML-Based 3D Indoor Space Model for Indoor Applications
## 4 Implementation
### Data Extraction  
According to the 3 DSISM, data extraction consists of the following five steps: (1) Filtering and mapping of semantic types; (2) extraction and setting of attribute data; (3) transformation and setting of spatial reference system; (4) extraction of the building components; and (5) generation of indoor spaces. Filtering and mapping of semantic types  
The IFC defines numerous types of building components, with only a subset of the types associated with CityGML. An IFC file consists of a project (IfcProject) at the top. Under the project, there are one or more sites (IfcSite), which may include one or more buildings (IfcBuilding). A building may contain one or more stories (IfcBuildingStory), each of which contains various building elements, such as walls, slabs, and doors. According to the simplified 3D indoor model in Section 3, the IFC types shown in Table 1 are selected as the input data in this work, with the italicized descriptions in brackets referring to the data types provided to the corresponding CityGML dataset. Extraction and setting of attribute data  
The IfcProject describes the general properties of the project, such as GlobalId, Name, and Description, which can be renamed to CityModel of CityGML by _AttributeManager_ transformer, such as GlobalId set to gml_id. Similarly, the IfcBuilding provides the attribute information of the building, which is converted to Building of CityGML by _AttributeManager_, as shown in Figure 17. It should be noted that CityModel is the top class of CityGML model, and Building is the child class of CityModel; hence, the ID: gml_id of CityModel is set as the parent ID: gml_parent_id of Building, and the ID: gml_id of Building is set as the parent ID: gml_parent_id of other building components. Transformation and setting of spatial reference system \begin{table}
\begin{tabular}{c c} \hline \hline
**IFC Type** & **CityGML Class** \\ \hline IfcProject (_Attribute_) & CityModel \\ IfcBuilding (_Attribute_) & Building \\ IfcSite (_Attribute_, _Lonitude, Elevation_) & Location information of the building \\ IfcWallStandardCase (_Geometry_) & InteriorWallSurface \\ IfcSlab (_Geometry_) & CeilingSurface \\ IfcStair (_Geometry_) & FloorSurface \\ IfcOpeningElement (_Attribute_) & Attribute information for _Openings_ \\ IfcDoor (_Geometry_) & Door \\ IfcWindow (_Geometry_) & Window \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Semantic mappings from Industry Foundation Classes (IFC) to CityGML. Figure 17: Setting of attribute data of CityGML classes. IfcSite provides building location information in the form of latitude, longitude and elevation, while CityGML describes spatial information in the form of a 3D CRS (Coordinate Reference Systems), such as the well-known European Petroleum Survey Group (EPSG); therefore, conversion of spatial reference system is required. The latitude, longitude and elevation of IfcSite are extracted by _AttributeKeper_ and projected to the target spatial reference system, EPSG: 31,467 by _AttributeReprojector_. The transformer _FeatureMerger_ is used to merge the coordinate reference information with the building elements, and then 3D affine transformation is performed to obtain the coordinate reference information of the building elements (Figure 18). * Extraction of the building components The extraction of the building components is an important part of data extraction. Building components, such as interior walls, ceilings, floors, doors, and windows, are extracted for the generation of indoor spaces according to the simplified description of the building components in Section 3.2.2. The building components and the layouts of the indoor spaces are different in each story and should be filtered and extracted according to each story. 1. Filtering of the building components The building components are filtered according to the story where they are. Take the filtering of walls as an example. The IfcWallStandardCase has attributes that contain the ID of its parent class IfcBuildingStory, namely, ifc_parent_id.