USE OF GEOGRAPHICAL INFORMATION SYSTEM APPROACHES FOR THE DIAGNOSIS OF SAN ISIDORO RUINS (MADRID, SPAIN)

This article shows the application of different geoinformatic approaches for the diagnosis of a small hermitage located at the Spanish capital of Madrid. More specifically Structure from Motion photogrammetry for the 3D digitalization and orthophoto generation, and Geographical Information System (GIS) for uploading and management of the information were used. Both strategies were carried out using open-source software. In the case of the GIS approach the QGIS platform was chosen and some additional features were programmed to facilitate the diagnosis such as the creation of standardized HTML files to improve the interoperability. The prediagnosis phase was carried out by means of the Qfield android application that allows capturing the data on field. Additionally, several previous test, i.e. X-ray diffraction, microscopy and physical tests were carried out with the aim of understanding the severe degradation process that this Hermitage is suffering. This multidisciplinary approach allows us to understand the current status and degradation mechanisms of the Hermitage on which the most prominent damages are the features induced by material loss. This damage is related with the environmental conditions of the sites as well as the physical and chemical properties of the stone used during its construction.


INTRODUCTION
In 2015 the United Nations (UN) established seventeen Sustainable Development Goals (SDG) with the aim of transforming the world in the next 15 years (United Nations, 2015). Two of these goals are aimed expressly at preserving our Heritage as a key to said Sustainable Development: SDG 8.9 and SDG 11.4. Goal 8.9 "By 2030, devise and implement policies to promote sustainable tourism that creates jobs and promotes local culture and products" mentions Heritage as one of the keys of promoting tourism and local culture. On the other hand, SDG 11.4, which is contained within SDG 11 "Sustainable cities and communities", shines a light on the need to "Strengthen efforts to protect and safeguard the world's cultural and natural heritage" so that it may continue to benefit the future generations.
Complementary to this the UNESCO's World Heritage and Sustainable Development Program (Labadi, 2017) describes the possible benefits that a correct preservation and maintenance of Cultural Heritage can have on Sustainable Development. The adequate protection of Heritage can directly contribute to the prosperity of the natural environment for present and future generations from the cultural point of view (as it refers to the cultural identity of the environment), as well as from an economic perspective in which Heritage acts as a motor for tourism. In spite of the importance that Heritage seems to have as a key factor in the sustainable development and economy of a country, the funds dedicated to intervening and preservation are far from what is truly necessary, making it necessary to look to new methodologies that allow us to optimize our efforts and in which TICs play an important role (Masciotta et al., 2019).
The development of these new technologies must be in accordance with the present approach in preservation which is based on the use of scientific and multidisciplinary investigations as is stated in the Krakow Charter (de Naeyer et al., 2000) . This multidisciplinary approach can only be successful with the help of platforms that facilitate the digitization of information developed by all agents involved in a common language, so that it will be easy to interpret and use by all involved in the process. Within the field of geoinformatics the two main approaches are: i) the HBIM (Historical Information Building Models); and ii) the GIS (Geographical Information Systems). They allow us to manage the multidisciplinary information compiled in the diagnosis-intervention-conservation stages thanks to standardized languages like IFC (Industry Foundation Classes) and geospatial databases in the case of the GIS approaches. There are various articles based on the use and development of these systems in the field of Heritage Buildings. In the case of the HBIM methodology Malinverni et al. (2019) integrates damages of the materials within a geometrical model captured by laser scanner for analyzing the decay of a historical building. Mora et al. (2021) applies this methodology for mapping damages, construction systems and assets for the preventive conservation of a historical library. Fornos and Román (2020) develop an approach for the damage mapping by using specific families for integrating the data of a point cloud into a 3D model of part of the Seville cathedral. In all those cases, this approach seems to cope with the different difficulties that could arise during the diagnosis, restoration and preventive conservation of the sites. However, these works highlight the necessity of investing a great part of the time in defining the 3D model.
On the contrary, one of the main advantages of the GIS approach is the possibility of working directly with 2D raster data which makes its application easier and faster. Thanks to this it is possible to analyze the heritage at different scales, from city scale for evaluating the natural and anthropogenic hazards (Agapiou et al., 2015;Ortiz et al., 2014) , to building-scale for evaluating the building (Campanaro et al., 2016;Drap et al., 2012;Sánchez-Aparicio et al., 2020) , fusing multidisciplinary and multisource information. This fusion makes the development of complex queries that facilitate the diagnosis, restoration and conservation of the buildings possible.
Under the basis previously mentioned, this article shows an application of the open-source platform QGIS for the diagnosis of historical constructions by using raster information provided by a photogrammetric approach, the data of several previous tests as well as the use of specific shapefiles and scripts that facilitate this process. After the Introduction, Section 2 explains the data required for the diagnosis as well as the shapefiles and fields required for the diagnosis. Section 3 shows a description of the study case. Section 4 exposes the results obtained after the development of the QGIS project and diagnosis results. Finally, Section 5 shows the conclusions of the work.

Sources of information required in a diagnosis
For an optimal diagnosis it is necessary to include as much data as possible to be able to make an informed decision. We have identified five different types of data that allow us to get to know the building thoroughly, namely: • Planimetry: this type of information is necessary for mapping damages as well as locating the different construction materials and previous tests. This information could be imported by means of vectorized drawings or even by means of ortoimages from laser scanning or photogrammetry. • Construction materials and systems: understanding the materials used and the constructive systems they form a part of is essential to understand and to identify the type of damages, its influence in the global conservation of the building as well as the acceptable remedial measures. • Historical information: the history of the construction is a crucial aspect to understand the previous interventions on the constructions, possible demotions, restorations or even to understand the origin and evolution of certain types of damages. • Damages: in a diagnosis phase it is essential to include the proper digitalization (extension and location) of the damages as well as some data associated with this such as the type of damage, origin or the possible causes. A visual inspection gives us a first idea of the damages present in the building; most damages can be identified simply from this first inspection. However, some damages require additional tests in order to understand its degradation mechanism or even its origin. • Previous tests: if after a visual inspection there is doubt as to the causes of a certain damage, tests must be administered to ascertain the true cause and extent of the damage. Previous tests also include stratigraphic analysis or structural analysis among others.

Platform's QGIS
The present investigation is based on the use of the GIS software QGIS. This software is an open-source platform that allows us to collect and manage all the information previously described ( Figure 1). Apart from this, the platforms allow programming scripts in Python language, which allows for the expansion of the system features. Among several updates and supplements which supply different user needs and make their experiences easier, Qfield (https://qfield.org/) is a multifunctional tool used to improve field work, receiving all data required for the prior shapefiles. Apart from this, Qfield allows for online or offline mapping and an attributes edition. The most outlined characteristics include not only the synchronization between the QGIS project and the mobile application but also the chance to directly take images from the inspected element. Once the treatment of data is complete, it is possible to share the outputs with other users by using the Qfield Sync plugin. All collected information taken to elaborate the diagnosis is stored in different shapefiles by the QGIS system, where a variety of data is incorporated inside them (for more details consult Section 2.1). Each of them, with the exception of the planimetry, have their own field attributes attending to the criteria required to analyse and report all data demanded: • Construction materials and systems: this shapefile includes data from: i) date_of_inspection; ii) name; iii) type_of_construction_system (i.e. regular masonry, irregular masonry, etc.); iv) short_description; v) date_of_construction; v) type_of_material; and vi) type_of_mortar. All the fields previously mentioned are introduced in the shapes by means of text with the exception of the date_of_inspection and date_of_construction which are dates.
• Historical information is also taken into account by: i) name; ii) a short building description; iii) the architectural style and the name of the architect; and iv) images (maximum 4). • Damages are registered in the QGIS platform by a three-level classification system similar to the proposal of ICOMOS (2016) . According to this, the shapefile of damages is made up by of following fields: i) name; ii) date_of_inspection; iii) location; iv) class; v) subclass; vi) sub-subclass; vii) short_description; viii) Affected_constructive_elements; ix) Affected_materials; x) Direct_causes; xi) Indirect_causes; xii) Associated_damages; xiii) Need_for_intervention; xiv) Proposed_tests; xv) Reparation_proposals; xvi) Images (maximum 4). All the fields have the same type of data as the previous shapefile. Due to the nature of data compilation is obliged to distinguish among different mapping geometries. For instance, there are two damages shapefiles, one of them with a line geometry to map fissures and cracks, while other extensive damages are drawn through a polygonal geometry over the inspected surface.
• Previous tests: this shapefile is made up of the following fields: i) date_of_procesing; ii) name; iii) type_of_test (non-destructive; intrusive in-situ; laboratory test with sample destruction; laboratory test with recuperation of sample); iv) equipment_used_and_set_up; v) short-description of the results obtained; vi) image_of_results (maximum 4); vii) sample_identification; viii) date_of_extraction; ix) description_sample; and x) image_of_samples (maximum 4). All the fields are considered as texts with the exception of the dates.
All the shapefiles previously described included an additional field that allows uploading a PDF file with all that information that exceeds the limit of 255 characters of a text field. This field is stored by using a text type with the relative path of the file.
All the data previously exposed was also introduced into standardized HTML files which could be consulted outside the GIS environment. In this case, a Python script was developed by using the PyCharm environment. To this end, a total of four base files were created by using the web-programming language HTML-5 and CSS-3. These files include all the fields that could be stored in the different shapefiles as well as a couple of markers within each field ( Figure 2). These markers are used by the software to insert on them the information stored in the fields by using the following Phyton order: According to this, the QGIS script computes the following steps: i) copy of the base HTML file to the folder on which the shapefile is stored and named as the data which is stored in the field name; ii) replace of the markers placed along the HTML file by the information stored in the shape file and; iii) creation of the final HTML file.

THE ROMANESQUE RUINS OF SAN ISIDORO
The case study used for validating the proposed methodology was the small hermitage of San Pelayo and San Isidoro de Ávila located in Madrid, Spain. These Romanesque ruins, originally located on the outskirts of the medieval city of Ávila, were composed of a single nave covered by a wooden roof with a couple of entrances. In 1896 this Church was translated to the Spanish capital, more specifically to the centre of the city ( Figure  3). Due to the relocation of the remains of these ruins, the main material known as "Caleño stone", a porous-opaline little compact granite, is suffering from pronounced deterioration processes. It results in the impossibility of moving or giving back the remains to another location; any dismantling could wreck the whole ruins due to the lack of cohesiveness.
As it has been mentioned, its original location corresponds to the Spanish city of Ávila. From its origins, this church was enlarged and changed its appearance to a more Romanesque style after the accommodation of the remains of San Isidoro in the church (Real Academia de la Historia, 1916). After the enlargement and improvement of 1116, it was consecrated again in 1232; but later in the 16th century it lost its parish status and became dependent on the nearby San Nicolás parish. A reform took place in XVII with the execution of a sacristy to the south between the head and the front. However, because of the expropriations of the 19th century it progressed to a dilapidated state.

a)
The In the 19th century, only the head, part of the roof and the walls with the south portal remain. Then, an antique collector, Emilio Rotondo y Nicolau, bought the remains of the Hermitage and disassembled them to take them to Madrid. Later, the State bought the remains and in 1894 it was planned to rebuild the hermitage in the gardens of the Archaeological Museum. Finally, two years later, it was located in its current location, the Retiro park (Teijeira Pablos, 2015) ( Figure 3 and Figure 4).
Once it was located in its current position, there has been a couple of remarkable interventions; the first one in 1998, being restored through cleaning operations and study of the Ruins, and the second in 2018 it was intervened again through a corrective conservation process, carrying out a series of conservation actions (elimination of deteriorated joints, renewal of damaged pieces, comprehensive waterproofing of the whole, perimeter drainage and various repairs) (Real Academia de la Historia, 1916). Nevertheless, the environmental conditions of the area within the physical properties of the granite as well as these previous interventions are promoting the degradation of the material, demanding a robust diagnosis in order to minimize it.

Photogrammetric survey of 3d point cloud
As it was stated in Section 2.1, the diagnosis of a building requires the use of planimetric drawings in order to map its different damages and construction systems. Taking this into account, a photogrammetric survey by means of the Structure from Motion approach was carried out. During this survey each body of the Hermitage, namely façade and apse (Figure 4), was reconstructed separately by using two different convergence protocols. In each protocol it was ensured a homogeneous GSD as well as an overlap between images of 80-90%. These images were captured by using a DSLR Camera Nikon D5600 with a zoom lens 18-55 mm fixed at 18 mm. 33 images were required for digitizing the façade. Meanwhile 28 images were captured for the reconstruction of the apse.
The processing of the data was carried out by using the opensource software GRAPHOS (inteGRAted PHOtogrammetric Suite) (Gonzalez-Aguilera et al., 2018). The pipeline used within this software was: i) feature extraction and matching by using the A-SIFT algorithm within a L2-norm distance approach for refining (Morel and Yu, 2009); ii) the blunder adjustment, including the self-calibration of the camera by using the APERO algorithm (Deseilligny and Clery, 2011) within a Fraser calibration model of 12 parameters (Fraser, 1980); iii) a dense matching through the use of the SGM algorithm (Hirschmüller, 2008); and iv) the creation of the orthoimages. The scale of the model was provided by using a total of six measurements taken in-field with a flexometer. Figure 5 shows the result obtained during the blunder adjustment phase and the dense matching. Finally, a total of four orthoimages were obtained with an average GSD of 2mm. These ortoimages were introduced into the QGIS project, serving as a base for the pre-diagnosis and the diagnosis phase ( Figure 6).

Pre-Diagnosis through the QGIS-QField
After the introduction of the ortoimages in the QGIS project the next step involved the creation of the different shape layers. This process was carried out by using the QGIS builder tool (Figure  7), that allows us to create these layers in an automatic way. To this end, the creation of an empty shapefile was required whose function is used as an input for the model builder tool. Then the rule "Refactor fields" was used to elaborate the shapefiles previously exposed in Section 2.2. Afterwards, the project was exported to the Android application QField by using the Qfield Sync plugin (OPENGIS.ch, 2019). This step allows us to pass all this data to an android device to carry out the pre-diagnosis phase on field (Figure 8).  During this phase it was possible to map the construction materials, construction systems as well as the different damages.
All the data was complemented by several images captured by the mobile device. Once the in-field work was finished the data was imported to the desktop application by using the Qfield Sync plugin (Figure 9). Then, the history of the construction was introduced, in this case only a short description was included in the shapefile meanwhile the rest of the information is attached by using the annexed_pdf_file field of the shape ( Figure 10). Also, the different standardized documents (i.e damage documents) were created by using the Python script shown in Section 2.2. These documents could be consulted by clicking on a specific shapefile ( Figure 11). Figure 10. Appearance of the QGIS project at the moment of which the historical information is consulted. Figure 11. Access to the HTML file created for the efflorescences at the intrados of the façade.
A set of consults were carried out in the QGIS project by using the intersection tool. This intersection allows us to evaluate the percentage of each material affected by different damages. From this consultation it was possible to conclude that a great part of the building shows a high presence of features induced by material loss. More specifically, 43% of the façade extrados, 10% of the façade intrados, 10% of the apse intrados and 12% of the apse extrados ( Figure 12). This degradation is especially eminent if it is compared with the original remains of the Hermitage (Figure 13).

Previous studies
The pre-diagnosis carried out on the ruins reveals a construction in an advanced state of deterioration, demanding and in-depth analysis of the stone and mortar used for its construction. According to this, a total of eight samples were extracted: • SI1: white stone with a large degradation in the intrados of the apse • SI2: ochre stone with biological colonization in the intrados of the apse. • SI3: red stone in the extrados of the apse • SI4: ochre mortar in the extrados in the façade • SI5: red-brown mortar in the façade • SI6: white stone in the extrados of the façade • SI7: red mortar in the extrados of the façade • SI8: ochre stone in the extrados of the apse These samples were used in different studies: i) X-ray diffraction analysis, not only for crystalline phases identification but also for finding out its phase transitions or determining its phase diagrams; ii) optical polarization microscopy to obtain information about the minerals phases of the mortar samples; iii) scanning electron microscopy for analysing texture and morphological properties of the samples and their different phases, as well as for taking compositional variations information; and iv) the hydrostatic balance for determining the physical constants of the stone and mortar namely absorption coefficient, bulk density and water-accessible porosity.
All this data was properly registered within the QGIS project by using the shapefile of previous tests ( Figure 14).

Diagnosis through the QGIS platform
The previous studies carried out on the ruins reveal that the composition of the stones of the monument agree with the description for the Caleño Stone in scientific literature (García-Talegón et al., 1994), but with additional minerals of neoformation, such as gypsum, barite and calcite, coming from environmental pollution. In general, they are grainy and very porous silicate rocks. Samples SI-1 and SI-2 are evidence of the progression of stone deterioration. Both have been extracted from the apse, in the shady area, and have been compared with samples similar on the main façade (SI-4 and SI-6) ( Figure 15). In both cases, a loss of clay matrix material has been observed, this being more pronounced in the white stone. This conclusion is in agreement with the data extracted by using the GIS intersections during the pre-diagnosis phase ( Figure 12). Additionally, the results obtained during the physical tests reveal a stone with an extremely high-value of absorption coefficient (24%) and water-accessible porosity (36,3%), suggesting that there is a loss of clays and opal due to disintegration, which is completely breaking down the cohesive structure of the stone. As a synthesis of the studies developed throughout this investigation work, a series of recommendations for its treatment and conservation are proposed. The most pronounced deterioration is found in the lack of cohesion and loss of the granulometric matrix of the granite materials, aggravated by the atmospheric conditions and pollution of the city as well as the humidity of the environment. That is the reason why a proposal is made mainly to focus on the consolidation and strengthening of its granulometric structure. The execution of a Preventive Conservation Plan is recommended and considered for the future that allows an adequate and regular maintenance of the damages and risks that the historic complex may suffer, avoiding, or at least, trying to reduce the impact that these deteriorating facts may have on the ruins.

CONCLUSIONS
This article shows the application of two geoinformatics approaches for the diagnosis of San Isidoro ruins. These ruins are placed at the center of the Spanish Capital (Madrid) and are suffering strong material losses. On the one hand, the Structure from Motion approach was used with the aim of obtaining a 3D point cloud of the ruins with centimeter accuracy and great resolution, as well as its ortophotos with a GSD of 2mm. This approach proves to be efficient, containing all the necessary information for mapping the damages and construction system of the building.
Complementary to this, a GIS strategy was used to upload and manage the multisource information generated during the diagnosis such as the damage mapping, X-ray analysis, etc. This approach proves to be very efficient especially if it is combined with additional scripts or apps that improve the interoperability of the data as well as the data capturing in-field. More specifically the open-source software QGIS was used. By default, this software does not fulfil all the requirements for a diagnosis, thus the development of several scripts were required. In this work we proposed the development of a script for generating standardized forms by using the HTML and CSS languages. Additionally, the app Qfield proves to be very efficient, reducing the time required in-field for mapping damages and construction systems of the buildings. In contrast to the HBIM models (which could be considered as another approach adequate for the diagnosis of a historical construction) the use of GIS systems are less complex, making it possible to work with orthophotos and geospatial databases that allow for the management of all the information required for a diagnosis as well as using intersection orders to obtain some conclusions during the diagnosis phase. However, some limitations could be highlighted such as the impossibility of working with the 3D models or even the level of interoperability of the HBIM approaches. For the last one, the present work proposes the use of standardized HTML files by using in-house programming scripts. Thanks to this combination, as well as the use of several previous tests, it has been possible to diagnose the hermitage of San Isidro. The results of this diagnosis highlight the advanced deterioration process (specially material losses). This deterioration has two main components: i) the pollution of the zone; and ii) the physical and chemical properties of the stone. For this reason, it is recommended to carry out consolidation processes in order to minimize this deterioration process. Future works will be focused on the development of a plugin that facilitates the diagnosis of historical construction by means of Geographical Information Systems. Also, several 3D rendering strategies will be evaluated in order to improve the features of the proposed approach.