# A Unified Database Solution to Process BIM and GIS Data
## 3 Results
### Implementation of the Common Database Environment for IFC and CityGML Data
Conversion from the CityGML schema to the BIGI-S is much less complicated. The conversion process involves rewriting the basic data about the object, geometric data, and properties (Figure 5). The general algorithm for the transformation of data related to the \"room\" class from the CityGML to BIGI-S is as follows:  
1. All descriptive attributes (class, function, and usage) are read from the citygml.room table. 2. These attributes are saved in the bigi_s.properlysinglevalue table in the appropriate attributes of the property sets attached to the object. 3. The geometric elements of Solid and MultiSurface are read from the citygml.space table at the LoD4 detail level. 4. The geometric data for LoD4 is saved in the bigi_s.spacegeometry table. The inverse conversion of data from the BIGI-S to the CityGML schema is analogous. It includes basic object data, object geometry, and properties (Figure 6). The general algorithm for transforming data related to the \"room\" class from the BIGI-S to the CityGML scheme is as follows:  
1. The appropriate attributes from the property sets attached to the room are read from the bigi_s.spacegeometry table. 2. The attributes are saved in the citygml.space table. 3. The geometric data for LoD4 for the room being processed are read from the bigi_s.spacegeometry table. 4. The geometric data are saved in the citygml.space table. Figure 5: General scheme for transforming data from the CityGML schema to the BIGI-S based on the example of the Space object. Figure 6: General scheme for transforming data from the BIGI-S to the CityGML schema based on the example of the Space object. In conclusion, let us analyze the example of room data editing by BIM and GIS applications. The BIM application uses data for a single room. In this case, it calls stored procedures in the IFC database schema allowing to read data about object classes IfcSpace (basic data of the room), IfcProductDefinitionShape, IfcShapeRepresentation, IfcExtrudedAreaSolid, IfcArbitraryClosedProfileDef, IfcPolyline, IfcCartesianPoint, IfcLocalPlacement, IfcAxis2 Placement3D, IfcDirection (data on the geometry of the object), IfcRelDefinesByProperties, IfcPropertySet, IfcComplexProperty, and IfcPropertySingleValue (object descriptive data). These stored procedures are ifc.getspace, ifc.getproductdefinitionshape, ifc.getshaperepresentation, ifc.getpropertyset, etc. The routines retrieve relevant data from tables in BIGI-S, convert it to an IFC model, and make it available for BIM application. The modified data is saved by calling the stored procedures: ifc.updatepspace, ifc.updateproductdefinitionshape, ifc.updateshaperepresentation, ifc.updatepropertyset, etc. At the same time, the GIS system uses the data of the same room using a stored procedure in the CityGML database schema: citygml.getspace, which retrieves data from tables in BIGI-S and converts it to CityGML format. Data is saved by the citygml.updatepspace stored procedure in the CityGML database schema, which converts data from CityGML and saves it in tables in BIGI-S. In this way, assuming the right performance is ensured, conversions can be performed almost invisibly to users of BIM and GIS applications.