# A Unified Database Solution to Process BIM and GIS Data
## 3 Results
### Implementation of the Common Database Environment for IFC and CityGML Data
Stored procedures in the BIGI-S allow on-the-fly conversion of data from the IFC schema to the BIGI-S and vice versa, as well as bidirectional data conversion between the CityGML schema and the BIGI-S according to the analysis of both data models briefly presented in Table 1. For objects of the classes inherited from _IfcProduct class_, the process of converting data from the IFC schema to the BIGI-S includes several steps: rewriting the basic attributes of the object, converting the geometry of the object to the global coordinate system, taking into account the rotation of the coordinate system according to the TrueNorth attribute, saving the individual attributes assigned to the object, and saving the sets of attributes assigned to the object (Figure 3). The general algorithm of the transformation process of object data from the IFC schema to BIGI-S for each object class inherited from the IfcObjectDefinition class is the same. For example, for an IfcSpace object, this process is as follows:  
1. Attributes GlobalId, Name, and Description are read from object's table. 2. These attributes are saved in the bigi_s.space table, along with the project GUID. 3. The data about author, date, and BIM application used to create the processed object in the IFC model is read from the IfcOwnerHistory class object indicated by the OwnerHistory attribute. 4. The data about the source of the object data is saved in the bigi_s.space table. 5. The data about relations between the processed object and other objects of the IfcObjectDefinition class are read from the source tables. 6. Data about these dependencies are saved in a table in the BIGI-S schema. 7. Based on the IfcPropertySet, IfcComplexProperty, and IfcPropertySingleValue objects assigned to an IfcSpace object through the IfcRelDefinesByProperties object, a list of single properties and property sets assigned to this object is determined. 8. Data about IfcRelDefinesByProperties, IfcPropertySet, IfcComplexProperty, and IfcPropertySingleValue class objects is stored in the bigi_s.spaceproperties table for reverse conversion to IFC. 9. Single properties retrieved from IfcPropertySingleValue objects assigned by IfcRelDefinesByProperties are saved in the bigi_s.spaceproperties table. Figure 3: General scheme for transforming data from the IFC schema to the BIGI-S based on the example of an IfcSpace object. The property sets retrieved from the IfcPropertySet, IfcComplexProperty, and IfcPropertySingleValue objects are saved in the bigi_s.spaceproperties table. * On the basis of the IfcProductDefinitionShape, IfcShapeRepresentation, IfcExtrudedAreaSolid, IfcArbitraryClosedProfileDef, IfcPolyline, IfcCartesianPoint class objects, the geometry of the object is determined. * The data of the IfcProductDefinitionShape, IfcShapeRepresentation, IfcExtrudedAreaSolid, IfcArbitraryClosedProfileDef, IfcPolyline, and IfcCartesianPoint class objects are stored in the bigi_s.spacegeometry table in BIGI-S to enable reverse conversion to IFC. * Based on the IfcAxis2 Placement3d, IfcCartesianPoint, IfcDirection, and IfcLocalPlacement classes, the location of the local coordinate system of the room in the local coordinate system of the IfcSite class object is determined. When processing data on the location of the local coordinate system of an object, dependencies of local coordinate systems are taken into account. The geometric elements representing the room are expressed in the local coordinate system of the room, the position of which is determined in the local coordinate system of the floor and that in the local coordinate system of the building, which was expressed in the local coordinate system of the site. * Data of the IfcAxis2 Placement3d, IfcCartesianPoint, IfcDirection and IfcLocalPlacement objects are stored in the table in the BIGI-S schema to enable the reverse conversion to IFC. * The location of the local coordinate system of an IfcSite object is specified in the global geodetic coordinate system through the RefLatitude, RefLongitude, and RefElevation attributes.