# A Unified Database Solution to Process BIM and GIS Data
## 3 Results
### Implementation of the Common Database Environment for IFC and CityGML Data
The rotation angle of the local coordinate system relative to the geodetic system (TrueNorth) is determined by the IfcGeometricRepresentationContext object referenced from the IfcProject object. * The geometry of the object expressed in the global coordinate system is stored in the geometry attribute of the bigi_s.spacegeometry table. The reverse conversion involves creating, on the basis of the data stored in the tables in the BIGI-S, sets of attributes assigned to the object, single attributes assigned to the object, and geometry in the local coordinate system of the object obtained from the geometry expressed in the global system, taking into account all local coordinate systems of the host objects. The last step is to create the object itself with its basic attributes (Figure 4). Figure 4: General scheme for transforming data from the BIGI-S to the IFC schema based on the example of an IfcSpace object. The general algorithm of the transformation process of the \"room\" class from the BIGI-S to the IFC schema is as follows:  
1. Attributes GlobalId, Name, and Description are read from the bigi_s.space table. 2. These attributes are saved in the ifc.space table in the IFC schema. 3. The data about author, date, and BIM application data used to create the processed object originally derived from the IFC model is read from the bigi_s.space table. 4. The data about the source of the object data is saved in the ifc.ownerhistory table. 5. The data about relations between the processed object and other objects derived from the IfcObjectDefinition class is read from the table in BIGI-S.
6. This data about these dependencies is saved in the ifc.relaggregates table. 7. Room properties are read from the bigi_s.spaceproperties table. 8. Simple properties are saved in the ifc.properlysinglevalue table. 9. Property sets data is saved in the ifc.complexproperty and ifc.properlyset tables. 10. Data of the IfcRelDefinesByProperties object aggregating the IfcPropertySet objects with the processed object is saved in the ifc.reldefinesbyproperties table. 11. The geometric representation of the room is read from the bigi_s.spacegeometry table. 12. Transformation of coordinates from the global geodetic coordinate system to the local coordinate system of the project is performed: 1. The angle between the project North direction and the True North direction for the selected project (TrueNorth) is read from the bigi_s.project table. 2. The coordinates of all points describing the geometry of the room are read from the bigi_s.spacegeometry table. 3. The transformation of coordinates of points by rotating the coordinate system by the angle that TrueNorth is performed. 4. The point with the smallest x and y coordinates is selected as the starting point of the local coordinate system of the object. 5. Transformation of the point coordinate system is performed by moving the coordinate system by the vector w = (-x, -y), where x and y are the coordinates of the selected point as the starting point of the local coordinate system. 6. The x and y coordinates calculated in step 12.d are saved because they allow the position of the local coordinate system of the processed object to be determined in the local coordinate system of the parent object in the hierarchical structure of the building. 13. IfcLocalPlacement, IfcDirection, and IfcCartesianPoint class objects that define the location of the local coordinate system of the object in the local coordinate system of the parent object in the hierarchical structure of the building are saved in dedicated tables in BIGI-S.
14. IfcAxis2 Placement3d, IfcLocalPlacement, IfcCartesianPoint, IfcPolyline, IfcExtrudedAreaSolid, IfcShapeRepresentation, IfcShapeRepresentation, and IfcProductDefinitionShape class objects that define the geometry of the object in its local coordinate system and the location of this object in the local coordinate system are saved in dedicated tables in BIGI-S.
15. Reference to the IfcProductDefinitionShape class object is saved in the Representation attribute of the room.