GATHERING GEODATA FOR HBIM AND ANALYSIS ON PRESERVING A CARAVANSERAI IN KOYSENJAQ

The goal of the following article is to outline the method of a gathering of geodata for a historical building and prepare outputs for the Historical Building Information Management. The study site where the geospatial data was captured in the caravanserai in Koysenjaq in Iraqi Kurdistan. Caravanserais are simply accommodation buildings for merchants which were positioned all over the Silk Roads and are spread from China to Turkey. According to UNESCO the historic importance of such buildings lays in the cultural and religious traces left from the merchants who used these sites to even socialize. The caravanserai in Koysenjaq is unfortunately ruined and gathering geospatial data about the state of the construction was captured using close-range photogrammetry and Simultaneous Localization and Mapping technology. The goal of the research was to not only capture data but also reconstruct an orthophoto map of the current state, compare it to the vector state of the floors and prepare data for BIM.


INTRODUCTION
This contribution is focused on the analysis of captured geodata by laser scanning using the SLAM algorithm and close-range photogrammetry. Data from these sensors was captured in terms of accuracy, speed of data capturing, data processing, and efficiency. All these technologies have a similar output called a point cloud, which is nowadays a basis for creating further results, for example, 2D floor plans, cross-section plans, orthophoto maps, or 3D models for BIM or HBIM. All this documentation is essential for planning future reconstruction, rebuilding, or similar processes. The essence of the above will be presented using geodata from a partially collapsed historical object. Building Information Modelling and Management have focused too much on planning and constructing new buildings. Numerous workflow schemes, processing steps, standards, and libraries have been created in the past five years to satisfy the need for a BIM plan (Shamshiri et al. 2018). Unfortunately, little has been done in the sphere of how to implement BIM technologies for existing buildings. Facility management is an important part of a building lifecycle, but it usually concerns devices placed in a building, not structural changes. Many non-governmental organizations are dealing with preserving the historical architectural and archaeological heritage of the world. UNESCO (UNESCO n.d.) is one of them. Moreover, each state possesses and maintains a registered list of buildings with cultural importance. Logically, these buildings were built with a different material than the contemporary available ones and with a different knowledge and perception of the architecture. Nowadays, a 100-story building might be built up in a few months, but for example, religious buildings like St.Vitus were built over a few centuries ("Katedrála Svatého Víta, Václava a Vojtěcha -Oficiální Web | Katedrála" n.d.). The purpose of this comparison is to indicate the fact that historic buildings have more details, more elements on the facades, complex staircases, windows, entrances, etc.
Little has been done on the topic of how to capture correct geospatial data from historical buildings with complex architecture. Moreover, there are few research projects on measuring buildings that are almost ruined. Despite that fact, HBIM has the same potential as BIM tools for planned buildings. It is essential to indicate that the paper-based documentation exchange of geospatial information is already in the past. Even though it might be required from state agencies, engineers and architects usually demand digital and scaled documentation. One of the drawbacks of geospatial measuring for HBIM is the developed technical tools for measurements that capture thousands or millions of points (Bregianni 2013). This leads to a problem with dealing with big data, storing the data, viewing in special software, and using it for other post-processing. An architectural object with historic essence is a distinct type of existing construction. Such a building often lacks a complex set of data that takes into account the history of the construction, what was its maintenance and what might be the possible reconstructed structural elements and service parts. Despite non-concrete standards on geodata gathering for HBIM, there is already research on how to capture geospatial data from archaeological sites and complex historic buildings. Photogrammetric techniques were used in 3D modeling of archaeological artifacts and later 3D printed (Pavelka, Pappi, and Pavelka 2021). SLAM technology and terrestrial laser scanning are also successfully implemented in historic sites again for the 3D modeling of a Jewish settlement in Morocco (Matoušková et al. 2021). Geospatial measuring and parametric modelling of historic buildings and their construction elements are well described in (Z. Poloprutský 2019) the whole process from measuring to 2D floor plans creation is mentioned.

Three dimensional geodata
The capturing of 3D geodata for sites with both historic and architectural heritage has become a great topic of the last decade. Precise as-built measurements provide us with accurate data to preserve and manage the building site sustainably. The generation of 3D information containing metadata of the site enables the creation of multipurpose information models, browsing data, project management, and other activities which were almost impossible to establish with conventional measurements. Preserving historical and architectural heritage needs precise basic measurement in order to create precise and modern documentation for planned reconstructions.

Capturing geodata
There are four important parameters of capturing geodata for geoinformation modelling: where, what, how, and when? Where deals with the correct position of the object. Defining the precision of measuring and precision of the outputs as well as defining a coordinate reference system for visualizing. It is essential to establish beforehand what will be measuredconstruction, facilities, texture, colours, etc. An answer to the question of how it the object will be measured defines the technology which will be used. Last but not least, the date of measuring is also important in order to keep track of object management and monitoring.

Location and history
The study site is located in the northern part of Iraq, in the city of Koysinjaq or Koya ("Koysinjaq | Unbelievable Kurdistan -Official Tourism Site of Kurdistan" n.d.). The rough coordinates are latitude = 36.085 o and longitude = 44.692 o (see Figure. 1). The territory falls into the Iraqi Kurdistan region. The etymology of the name can be traced back to Turkish roots of the words "koy" and "sinjaq", meaning village and respectively flag. A legend has it that the city was founded by the son of an Ottoman sultan who planted his flag and established a settlement for his army (Wikipeadia 2022).
In particular, the research team had to capture geodata for the future restoration of a Khan Caravanserai, located next to the Koya Grand Mosque. Caravanserai is a special building where travellers can rest and recover from their journey. The current state of the building is unfortunately ruined. In that case, geodetic measurements should take place but only photogrammetric or laser technology will represent the current state the best. Unfortunately, as-built plans do not exist.

Religious groups
The city of Koysinjaq has a history of inhabitants from different cultural and religious backgrounds. There was already a Jewish community in the city in the 18 th century. Moreover, in the 19 th century, a small Catholic group was established.

The historical importance of the caravanserais
The etymology of the word caravanserai can be traced back to Persian and Turkish, where karvan in Persian means caravan and sara means either palace or a building. The so-called buildings known as caravanserais are typical in the Arabic world but not only there. They served to travelers, merchants, etc. to recover from their journey, have a reset, and stay overnight. The building could be described as a large place for accommodation or hostels. Such buildings were built on the lines of the Silk Roads and can be found from Turkey to China. These special houses served not only for accommodation but also for socializing, trading with locals, exchanging cultural ideas, etc. A large network of caravanserai was established having one such place every 30 -40 km, preventing the merchants and their cargo from being robbed. Some caravanserais were even fortified and served to the military armies.
According to UNESCO and their Silk Roads Programme (UNESCO 2022), the most important heritage of the caravanserais is the mixture between different cultures, languages, and religions, and this exchange is somehow architecturally implemented in the buildings themselves.

Research aspects
In our case project, the abovementioned steps were taken and analysed, along with their advantages and disadvantages for the creation of an information model according to the HBIM standards. As a case project, presented here is a future reconstruction of the historic caravanserai in the historical Old Town of the city of Koysenjaq in Iraqi Kurdistan (Grand Khan or Xani Gawra). The original caravanserai dates from the 19 th century and is currently near-total destruction. The research project is supported by ALIPH, the International Alliance for the Protection of Heritage in Conflict Areas. The building, however, though partly ruined, is still rich in interesting details of specific building techniques and decorations. The Khans structure is a square complex organized around a central court.
Two stories of chambers are served by a vaulted arcade in front.
Parts of the arcade are collapsed. The actual situation is characterized by the immediate threat of loss of further parts of the monument due to lack of maintenance and ongoing deterioration. The planned emergency safeguard measures at the Khan pursue the goal to stabilize the threatened parts of the structure. As a logical first step, precise documentation was requested. Close-range photogrammetry with an SLR camera mounted on an unmanned aerial vehicle and a mobile laser scanner were used to capture the current state of the Khan.

METHODS AND MATERIALS
In the following chapter, the state-of-the-art will be described as well as methods of post-processing data. For thorough analyses, the research team used terrestrial laser scanning, laser scanning using the SLAM technology, and a close-range photogrammetry method of capturing geodata. On one hand, all technical equipment was supposed to be tested and evaluated in such demanding conditions as ruined historic buildings. All data wase captured and processed by our research team.

SLAM technology and Zeb-revo
SLAM is a technology for capturing geospatial information. It is based on a laser sensor that captures data and generates a 3D map of the environment. SLAM means Simultaneous localization and mapping (Geoslam 2022). The process of data capturing can be called scanning for simplicity. The core of the scanning process is the reconstruction of the environment in a three-dimensional model while keeping track of the instrument's location. Surprising as it may sound, this technology is on the one hand user friendly, but on the other hand, a precision problem exists. This problem concerns the reconstruction of the scanned object and is called the SLAM problem. For capturing geodata in the site of the caravanserai in Koysinjaq a SLAM handheld laser scanner was used. Our department possesses the Zeb-revo machine which is ideal for mapping challenging objects such as ruins of historical buildings and archaeological sites.
The scanner has a scanning range of 30 m and a field of view 360 o x 270 o . it enables capturing up to 43 000 points per second. The Zeb-revo relative accuracy is up to 6 mm. One of the biggest advantages of the SLAM technology is that the data postprocessing is automatic and there is no need for manual coregistration of scanning positions. Because of the timeconsuming scanning process with Leica BLK360, the Zeb-revo was preferred to document the ruins of the Grand Kahn. Unfortunately, this type of sensor is not equipped with a camera and the resulting pointcloud cannot be directly colorized. In addition, the accuracy reaches 1-3 cm, which is however sufficient for research purposes. The Zeb-revo post-processing is fully automated. Captured data is stored in a *.zip file which is based on preliminary stored parameters processing in Geoslam Hub to a pointcloud (Figure 4). The latter can be later vectorized (either automatically or by hand) to a 2D vector floor layout or cross-section.

Terrestrial laser scanner
Geodata from the Leica BLK360 was used as a reference dataset because this laser scanner has sufficient resolution, accuracy (4mm per 10m) and it has a camera for pointcloud texturing (Leica Geosystems 2022). On the other hand, the work with this instrument is relatively slow and it wasn't possible to document all spaces because the scanning process was timeconsuming. Every scanposition lasts between 3 to 8 minutes depending on if the colour photographs were chosen ( Figure 5).

Photogrammetric data capturing
In order to capture all the details, if possible, with all the technologies, a detailed terrestrial photo-set of the whole object was performed (853 photos) and two flights with an unmanned aerial vehicle (DJI Mavis Pro and DJI Mavic 2) were performed (275 and 287 photos).
After the geospatial measurements, the most important rescue and stabilization work was carried out immediately. After processing the measured data, a virtual reconstruction will be performed which will be presented both to the town hall of Koya and to potential sponsors and financial providers. For this purpose, models from various measuring technologies will be processed which will be converted into the form of HBIM and further into virtual reality for a quality demonstration for the proposed reconstruction works.

3D floor plans creation
The main output was supposed to be a 2D vector floorplan of the ground floor and the 1 st floor. The floor plan was created in Geoslam Draw module. As a data source, an orthogonally projected pointcloud layer was used (see Figure 6).

Orthophoto map
The first output was an orthophoto map of the current state of the almost demolished Khan caravanserai in the coordinate reference system WGS '84/UTM zone 38. The first output was an orthophoto map of the current state of the almost demolished Khan caravanserai in the coordinate reference system WGS '84/UTM zone 38. A problem was occurred with possible object deformation. We goet several point clouds from close-range photogrammetry and laser instruments. We assumed that the point cloud and orthophoto from the drone would be relatively accurate both in terms of location in coordinates due to the built-in GNSS instrument, and due to the definable scale and bundle adjustment of all photographic images. A regular block of photographs should have been stable. However, it turned out that this is where the uncontrolled deformation took place, when the elements of internal and external orientation were deformed and finally the whole block was deformed up to the order of one meter. During the analysis, we found that the problems were probably caused by the absence of more oblique images of the object. We fixed this on the second flight, which we needed to repeat due to the existence of dark shadows. The flight took place early in the morning (Figure 8). As a reference, the point cloud from BLK360 was used. On next figures an analysis of point clouds is shown (using CloudCompare software, Figure 7). Based on data from ZEB-REVO PLS, which covered the entire building, including hard-to-reach rooms and partially collapsed spaces, a model was created in Revit software, which is used for future H-BIM. This will be important during the planned reconstruction of the building. So far, only rescue work and debris removal have been carried out. The vector data created in point 4.1 was used as an additional layer with the orthophoto to indicate the correct position of the chambers which are left beneath the ruins. Vector layer for the ground and the first floor was used and the results can be seen in Figure 9 and Figure 10. The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLVI-5/W1-2022 Measurement, Visualisation andProcessing in BIM for Design andConstruction Management II, 7-8 Feb. 2022, Prague, Czech Republic

Preparatory analyses for HBIM
The final pointcloud of the Grand Khan was exported to .*e57 format and imported to Autodesk ReCap. ReCap comes from Reality Capturing and it is an Autodesk product that serves as a viewer and basis file format to import in either AutoCAD or Revit. In our case, we imported the pointcloud in Revit and created two-floor plan sections and two vertical sections across the chambers to examine the output views. Furthermore, the basis for future BIM modelling was prepared and analyzed. The processing was carried out in Autodesk Revit. The software allows linking a pointcloud reference file in *.rcp (Autodesk ReCap) format. At the beginning of the HBIM steps, a spatial coordinate system must be defined, either a predefined geodetic coordinate system or a local one. Revit does not support X and Y coordinates with many digits (higher numbers than 1000) and the file being imported should not be -33km or 33km away from the internal point of the Revit project (Zdeněk Poloprutský 2021).  The most powerful tool of Revit modelling is the possibility of parametric object-oriented modelling. This technique is based on predefined libraries, or Revit Families which contain the geometric and meta-information about an object and allow changing the size of the object so that all components geometrically dependant on it could preserve their scale (Figures 10-14).

CONCLUSION
A demonstration of the fast and low-cost 3D documentation of a historic object in the form of a partially destroyed old caravanserai, which is awaiting a thorough reconstruction, was presented in the paper. Relatively low-cost and easily transportable devices in the form of small laser scanners and close-range photogrammetry were used. The output geodata were terrestrial photographs, aerial photograph pointclouds from terrestrial laser scanning, and SLAM laser scanning. Each of the technologies that were used has its advantages and disadvantages. For terrestrial photogrammetry, only a low-cost SLR can be used. However, there is a problem with the dark spaces (chambers), the large number of used images, and the absence of photos taken from the air. This can be solved by using an unmanned aerial vehicle. Unfortunately, flying such a vehicle could be very problematic in countries like Iraq. Joining terrestrial and aerial images seems to be straightforward, but it is necessary to follow the appropriate photo planning, especially to add oblique aerial images of the object and to take also oblique images from relatively small height for aligning with the terrestrial images. If the process of geospatial data capturing is not carried out well, the output model can be distorted or the data from both technologies may not align together. The SLAM technology seems to be optimal. The measurement is speedy, accurate for the purpose, and can generate very easy crosssections or vectorized floor plans in *.dwg or*.dxf format based on the computed pointcloud. However, in narrow and small spaces such as vast areas, they can be distorted. It is advisable to have pre-measured ground control points, not to make long-time measurements (not longer than 15-20 minutes), to divide the area into several smaller measurements, and then align them into one single pointcloud. The data can also be combined with other more accurate data from terrestrial laser scanning which we also did. The disadvantage of the Zeb-revo is that it does not have a camera and the pointcloud cannot be colorized. However, the pointcloud is relatively sparse and primarily does not serve for modelling objects in the form of a textured mesh, but as a basis for vector processing in the form of cross-sections or floor plans. Such kinds of final outputs are widely desired.