Heritage Sustainability of the Territory: Photogrammetric Survey of the Castle of Beas de Segura (Ja é n, Spain)

: Beas de Segura is an ancient village located in the valley of the Sierra de Segura, at the gateway to the Sierra de Cazorla, Segura y las Villas (Ja é n, Spain). This territory has been inhabited by different cultures, from the Palaeolithic to the present day, giving rise to a complex urban fabric in which relevant architectural and archaeological elements still survive. The coexistence of these heritage structures with the inhabited domestic architecture has generated signiﬁcant conﬂicts of coexistence, resulting in an accelerated process of physical and social deterioration of this increasingly impoverished area. Drawing, together with all the techniques that derive from it, is a necessary and precise source of knowledge and communication for understanding the territory, however complex it may be. This potential, applied to a heritage and social reality such as that of the Castle and Fortress of Beas de Segura (Ja é n), allows for processes to be revealed, actions to be ordered, and interventions to be proposed. This article brings together the results of research carried out in this area of the Sierra de Segura, in which graphic expression, combined with the study of materials, has enabled us to identify original elements of the castle and medieval fortiﬁcation. This system of knowledge discovery has been decisive in establishing a criterion for heritage intervention, seeking a sustainable balance between the development of life in this area of the city, the recovery of the collective memory of the surviving elements of the castle and fortress, and the conservation of the protected historical remains.


Background
The municipality of Beas de Segura, located in the extreme north-east of the province of Jaén, has preserved the structures of the castle and fortress to this day, with significant losses and deterioration which have been largely due to the attempted coexistence of the heritage elements, with the generations that have been populating it. This problem of coexistence was detected by the municipal council, which set out to develop research that could organise all the interventions in a precise and well-documented manner. In this way, it was proposed to develop research to determine: what heritage elements remain; what elements have been incorporated in successive phases; what structures can coexist with the social fabric that inhabits this area of the municipality; and how to make a working plan that would allow the heritage to be in accord with the resident population. With these expectations, it was proposed to make a master plan that would organise all future interventions. Thus arose the objective and remit of the assignment (Figure 1): to study all the primary documentary sources; to analyse the urban evolution and context of the castle in the evolution of the municipality; to precisely document the pre-existence as well as the archaeological studies carried out; and to establish a conservation plan for coexistence with the neighbours and contemporary urban structures. This article summarises the section referring to data collection and graphic analysis. The planning of objectives allowed us to carry out a works programme agreed with a multidisciplinary team made up of surveyors, archaeologists, engineers, historians, anthropologists, and architects. To be able to start working, good cartography was needed which would reliably reflect the heritage reality of Beas and onto which all the historical and archaeological research could be transferred. It was at this initial moment when it was decided to carry out a rigorous photogrammetric survey that would allow us to start working with a documented reality. In this way, the major questions about the architectural and urban evolution of the heritage complex of the castle could be resolved with the graphic and material study of the constructed reality.
To achieve this, several references were taken from important works that have been carried out in this same sphere, with similar starting plan methodologies and logic, such as: the Mula Castle Master Plan [1], given its scale and dimensions close to our object of study; the Comprehensive Urban Regeneration Master Plan for the Historic-Artistic Complex of Alcalá del Júcar (Albacete) [2], which contains a social reality inserted into a heritage context, very similar to that of the Beas de Segura case study; the Sagunto Castle Master Plan [3] for its methodology, in relating archaeological studies with emerging structures, and the extensive study it develops at the territorial and landscape level; the Alhambra and Generalife Master Plan 2007-2015 [4]; and the Itálica Master Plan [5], both highly developed in the field of management and subsequent impact on society. From the international sphere, we highlight the work carried out by Francesco Doglioni [6], which develops studies of archaeology applied to the analysis of architecture and heritage sites, based on important cartographic and photogrammetric developments. Planning regulations applied to conservation have been derived from these works, as in the case of Venice [7]. Similarly, the research carried out for the drafting of the master plan, for Villavieja and Castillo de Beas de Segura, analysed important references in the field of large-scale architectural conservation, such as those developed by Alberto López [8] or Camila Mileto and her team [9].
Given the lack of documentation on this heritage asset, the results obtained from heritage studies using photogrammetric techniques were analysed in order to develop an exact cartography of the current state. The material reality of the site obliged the assembly of various types and forms of documentation, from structures already lost, such as the research carried out by R. Angulo on photogrammetry applied to lost architectures [10], to theoretical studies on the application of this technique and technology in the graphic documentation of historical studies, such as the research by R. Martín [11]. These works provided information on the applied technique. Together with this, given the multidisciplinary nature of the team, and the different techniques required, we analysed the work by E.T. Delegou and her team on the Kaisariani Monastery [12], in which all disciplines designed the data collection and analysis of results. All this was coupled with the extensive theoretical resources developed by F. Remondino [13] in the field of photogrammetry applied from volumetric recovery, or D. Constantino [14], explicitly on the application to heritage interventions. Although the subject of photogrammetry applied to the collection of heritage data is increasingly broad, the process of selection and analysis of references was very important in allowing the collection of data on the material reality of Beas de Segura, its castle, and Villavieja.

A Settlement with Prehistoric Origins
The municipality of Beas, and specifically the area of the castle and fortress, has been a human settlement from the origins of civilisation [15] (Figure 2). Habitat remains from prehistoric times have been documented, especially in the cave area of the urban centre itself, and on the terraces of the Guadalimar River, where one of the oldest sites in Andalusia is found and ascribed to the Lower Palaeolithic. These are known, thanks to the studies carried out there by Cabré and Abad Breuil in 1913. Remains of useful elements such as flakes, biofacies, scrapers, and other tools, which undoubtedly belong to this prehistoric period, have been found during various archaeological campaigns. After the first results of the archaeological interventions, made by the Department of Medieval History of the University of Jaén, in the area of Villavieja of Beas, and based on the materials found, we can speak of a first occupation of the site in the Chalcolithic era. This occupation can be linked with the numerous caves or rock shelters located throughout the space occupied by the old part of the city. During the archaeological campaigns, several fragments of ceramics dating to that era have been documented, in addition to other significant worked stone items, such as a polished axe, or a bone needle in a very good state of conservation. The rock shelters present an irregular surface, which causes material to be conserved in a residual form, testifying to the occupation of these natural rock shelters during the Prehistoric era ( Figure 3). According to the scientific evidence derived from the various archaeological campaigns carried out in Villavieja, and the fortuitous finds, of which there is oral evidence, there must have been an important Iberian oppidum in the area. This could have had an already fortified area in the upper part, as in the neighbouring town of Castellón, including sanctuary caves destined for the worship of the gods. However, continuous human occupation of Villavieja has greatly changed the area and currently no large structures from that time have been found to verify it. Here the perfect natural circumstances exist for the settlement and defence of the population in that area, on its promontory, naturally defended by its great escarpment, formed by the Beas River and the Arroyo de la Tobilla. It is known, through oral tradition, that there have been numerous fortuitous finds of human and animal burials in Villavieja that could be ascribed to the Iberian period. Highlighted are such important pieces as the "León de Beas" ("The Lion of Beas"), found on the plain next to the Beas River, and preserved today in the town hall. It is very likely that this piece, together with another with the same characteristics and whose whereabouts is unknown, was associated with some important funerary construction and denotes the importance of the settlement at the time.

Consolidation of the Settlement during the Roman and Muslim Period
Already under Roman domination, the pre-existing town centres had to be reinforced, as evidenced by the archaeological findings from both the centre of Beas, and other centres in the municipality, as well as several towns linked to agricultural activities.
With the first administrative division carried out in 197 BCE, Beas remained within Hispania Ulterior. Augustus, in the year 27 CE, altered the boundaries and Beas then became part of Hispania Citerior, which, in turn, divided into seven legal convents, one of them Carthago Nova, of which it formed a part. In 332 CE, the Emperor Constantine created the Roman province Carthaginiensis, of which it would continue to be a part. In the centre of Villavieja, abundant Samian ware material, linked to the Iberian-Roman period, has been documented in several of the surveys carried out. Highlighted is a small terracotta sculpture which could represent the Roman god Bacchus. The archaeological evidence from both of the campaigns carried out, and the fortuitous finds that are known, assure that there was a city of more or less importance in Roman times. The remains of an old Roman mill have been located in the surroundings of Villavieja, which include its main millstone and numerous decontextualized fragments of representative buildings (ashlars, columns, bases, capitals, tombstones, etc.).
Regarding the fortification in Villavieja, there is the hypothesis that some defensive structures inherited from the Iberian period were reinforced, as in the neighbouring town of Castellón, as pointed out by some authors, such as Juan de la Cruz Martínez: ". . . this town is as old as Segura; it owes its foundation to the Romans as can be credited by its ruins, walls, quality of mortar, etc." [16], or Navarro López, who wrote in 1965: "a town in which there are still vestiges and ruins of Rome" [17].
There are various references to Visigoth vestiges in the municipality, highlighting the burials found in the 1970s in the "Olivar de los Muertos", Bastagoya, Tolosa, and in the "Cruz de los Trabajos", with rich funeral goods of which, unfortunately, little information is available today. Also important is the finding, in 1922, of the "Patena de Beas", an Hispano-Visigothic rectangular paten in bluish glass with the depiction of a fish, conserved in the Macaya collection.
The Visigoth collapse in 711, encouraged the Muslims to invade the entire peninsula and it was not until 714, or 715, when Beas, peacefully and without a struggle, was subdued by the Wali Abd al-Aziz ibn Musa. In order to more easily secure Muslim control in the peninsula, Musa followed a policy of pacts or treaties with the Visigoth chiefs, by means of capitulations [18]. After the capture of Orihuela, "Abdelaziz left without damaging or scorching the earth; he led the army to the regions of the Segura mountains and entered Bazta and Acxi and Jayen and Elvira and Garnata, which the Jews had [ . . . ] without finding resistance" [19]. This must have allowed the survival of the autochthonous culture for many years, including the practice of the Christian religion, until the Fitna rebellions, or even longer [20]. Given the isolation of the area, it suggests that there were even more Christians, despite the wars and deportations. Ibrahim ibn Hamusk himself, who controlled the area during the 12th century, had Christian ancestors, according to the chronicles of the time [21].
The elevation of the wall is built in mud with abundant lime and stone masonry, of which 1.5 m of the aforementioned base is preserved, in total, a standing elevation of 3.5 m. In the part corresponding to the stucco, the wall is covered on its internal side by a plaster, or a coating of lime mortar, which is not found at the base of the wall. On the outside, the wall is fully reinforced by a tuff stone masonry liner, already used in medieval Christian times [22] (p. 11).
From the time of the construction of this structure, several activities and levels have been documented from photogrammetry. In the first place, the cave is cut in its upper part to facilitate the construction of the fortification. There are also traces of several incisions made in the rock and putlog holes, probably for the anchoring of scaffolding to facilitate the work on its elevation. A highlight within the walls is the presence of a large storage area, located in this part of the fortress, where it has been possible to document a silo dug into the rock, or the presence of post holes, with traces of wooden pillars that would have supported structures made with perishable materials. This would have formed a lean-to to cover elements related to the storage area [22] (p. 17).
In 2020, at the opposite end, at the north-western part, it was possible to document another large stretch of wall, and at least two towers, which can also be attributed to this period. Most of this stretch of wall is made of Islamic mud, conserving delicate tracery (12th century), with oblique incisions in its interior that simulate a false pointing of the walls. This surface treatment would form a mock monumental bond, so that the horizontal bands coincide with the lines of the sawn heads of the wooden spires of each course of the formwork. [23]. The use of incisions within the strips must be related to the intention of creating an "optical grey" which allows a darker shade to be distinguished from the whitewash itself. Although it seems that this decorative treatment can be framed in the Almohad period (1147-1228), as pointed out by Samuel Márquez in his study, Andalusian Construction Technology: Formwork and Coatings in Military Architecture . The example of the towers, the nearby fortress of Navas de Tolosa, has the same treatment on the walls of its hexagonal tower, with the same simplicity as the Granada Taifa examples of Baños de la Encina, and has been framed in an extensive Almoravid-Almohad period, so we cannot rule out that it is earlier [24]. However, the decorative strip work of these three fortresses, Beas, Baños de la Encina, and Navas de Tolosa, have the same characteristics and typology, so these could be contemporary (Figure 4). The location of the fortress on the high and steep terrain, favoured the existence of natural defensive elements, with its walls anchored directly on the rock, cut at peak, in much of its circuit. These walls or fences, which were continually repaired and improved, are mostly made of masonry, executed with well-worked tuff stone, although in some parts, such as buttresses, corners, towers, and arches of doors or entrances, ashlar masonry or rough limestone were used.

Development and Extension during Medieval Times
The castle stood at the highest point, being strongly defended with numerous towers, ramparts, scaffolding, and sentry boxes, as described after the different visits, made at different historical moments [25]. Among the towers are those named the Homenaje (Homage) or the Abejuela, the Torre Mocha, the Torre Enmedio, and the Torre Azores or the Torre del Comendador. It had two doors, or entrances: the main one, to the south, called Puerta del Hierro (Iron Door); the other, to the west, with a moat and bridge, opened onto Villavieja. This castle was "embraced by the ramparts" referred to as the fort of Villavieja. It occupied more than one hectare of the surface. In its wall there were four towers facing Calle del Arrabal, another two in "el Tobazo", and two gates, the main one called Puerta de la Villa (Door to the Town). All the defences of the fortress were reinforced at different parts (mainly covering the eastern and southern areas), with another outer wall or "Barrier", in addition to other low ramparts and bastions [26].
Due to the large population and the extension of the medieval town, during the time of the Christians, it would have been impractical to provide the entire population with enclosures or walls, unlike other sites, such as the town of Siles or de la Segura. The great fortress or "villeta" of Villavieja, with great capacity for the "refuge of the population", would be sufficient [27]. However, the medieval urban system of the remainder of the urban nucleus is curious and very interesting. Built largely against the wall in a "casamuro" manner, where the houses themselves in the lower areas formed a large impassable wall with very few accesses and were very controlled by small, intricate alleys, some on a bend, which caused the whole population, including that which extended to the lower part, to be sheltered and to develop towards the interior. Thus it was configured as a large urban area that was highly defended by its urbanism, its own architecture, and its great natural moat, the Beas River [28] (Figures 5 and 6). In modern times, with the arrival of developmentalism and hygienic trends, the urban paradigms of healthy cities sought the opening of new and large avenues, as well as an idealisation of high-rise housing. Beas was no stranger to these movements and thoughts, and the population began to descend from the steep topographic peaks to the plains which, although occupied by orchards and crops, due to their proximity, were being replaced by large apertures. It is from this new urbanism, typical of the 19th century, when the abandonment of the areas delimited by the walled enclosures, accentuates the depopulation and a migratory movement to the lower areas of the municipality. Until that time, the documented elements of losses were not of great magnitude, as the different residential spaces coexisted without great affect. It would be from the industrialisation of construction when numerous elements and structural evidence for the construction of houses were eliminated ( Figure 7) (Table 1).  The investigation began with a profound material study to discover what endures today of all those important structures, as it is not possible to accurately read what relates to which moment in time. It is for this reason that the graphical expression of this reality is a central component of all this work, an in-depth survey by means of photogrammetry and a high-resolution 3D volumetry, which allows us to read structures and constructive sequences.

Roman Period
Remodelling and repairs of the fortified enclosure and constructions surrounding the enclosure.

Almohad Period
Construction of the south-west side of the Villavieja by means of stone plinth and rammed earth elevation. Enlargement of the north-west front (the large preserved stretch), as well as at least two towers (documented).

Medieval Period
Construction of the large units and structures of the castle, as well as structures linked to the defence of the enclosure.

Modern Age
Abandonment. Elimination and loss of numerous heritage items due to major documented landslides.

Present Time
Numerous non-contextualized interventions for the construction of slums, with the consequent gradual loss of the built heritage.

Materials and Methods
In recent times, new topographic, photogrammetric and 3D scanning survey methods have been spreading, which are complementing the traditional direct survey. For this reason, it is essential to understand the peculiarities of each methodology, to choose the one that best suits the needs of each part of the monumental complex. It is not possible to use a single method to carry out a good survey, it is necessary to use various methods in an integrated manner, always bearing in mind that the final results provide the maximum possible information on the whole, within a reasonable timescale and cost.
The photogrammetric technique and the digital survey have, in recent years, allowed us to provide important sources of explicit knowledge about relevant archaeological sites, or unique emerging heritage structures. This was made evident by Fabio Remondino [29], when developing an in-depth study on the different scales of application. Similarly, E. Tumeliene and his team highlighted the need to adapt the equipment, according to the scales, as well as the versatility of the possible results [30], from reconstruction, to an in-depth study of the pathologies. Although this represented a new perspective for the use of these new technologies applied to different heritage contexts, the works have used the photogrammetric technique to restore [31], to detect pathologies [32], and even to establish new and important intervention criteria [33]. This is emphasised by Robert Kesack in his doctoral thesis, recently published by Columbia University [34]. Although it is true that this is a field in the process of deep change and experimentation, each new direct practical application supposes a new adjustment in the versatility of data collection, and this has been the intention in the work presented here.
The object from which we started was the walled enclosure and castle of Beas de Segura, declared a site of Cultural interest, according to the Decree of 22 April 1949 [35], by which all walled enclosures in Spain are given the greatest protection. From that moment, to the present day, the walled enclosure has not had any conservation intervention. Only urgent action has been taken, with specific conservation interventions. The lack of a plan that could organise all of these actions has generated significant deterioration, not only of the material asset but, above all, of the social asset. The population that inhabits this context of the municipality has not found, in these heritage elements, any memory that would encourage them to protect it, so the construction of new houses, or the refurbishment of existing ones, have further accelerated the degradation of the complex ( Figure 8). Although we have worked from numerous perspectives for the preparation of the master plan (archaeological, anthropological, economic, social, etc.) we focused on the graphic tool as an instrument enabling important documentary sources, as it is the guiding theme of this monographic publication. The complexity of the place on which we have worked has required an in-depth study of socio-economic characterisation. Thus, the evolution of the heritage context would not be understood, without the society that inhabits it. All the data of a social nature were collected in the complete document and are available to any citizen who wishes to consult them.
For all these reasons, the first point for the reclassification of the heritage of the precinct was to determine which heritage elements still existed. From this approach, the following research objectives were established:

1.
To document all the existing historical planimetry of the castle and the fortress. There is a great deal of historical documentation on this important heritage precinct, but there is no graphical documentation. The little that there is, has had to be requested from the different National Historical Archives of Spain. This documentation has allowed us to study the evolution, the diverse phases, as well as the incursions of the residential fabric.

2.
Develop a new reference system that would allow all the actions and data collection to be organised [36]. In order to undertake future actions in an orderly manner, a new system of coordinates was established, suitable for both the scale and the nature of the asset. This new system has generated a specific nomenclature for each area of the precinct.

3.
A photogrammetric and 3D scanner survey of the entire precinct, in an orderly manner, according to the new reference system: As will now be explained, a network of geodetic points has been established, that allows measurements and the analysis of pathologies to be observed with millimetre precision.

4.
Analysis of materials and linking of results to the survey for a study of material pathologies. A study of materials was carried out, assigned to each of the layers of the survey, so that at any moment in time it is known what material is in each place. This automatically determines the construction phases, decontextualized interventions, unadjusted phases, or original elements.

Documentation of incursions of domestic architectures:
The precise documentation of all the structural elements of the current houses, which have engulfed the heritage remains, lets us glimpse the elements that survive the occupation process, and the original elements that remain even today. These incursions, although they can be determined as non-contextualised phases, will be studied from the point of view of the construction system, as their structures are usually subsidiary to the heritage elements. 6.
Development of an urban planning document which allows a sustainable framework to be established, between the society that inhabits the fortified area, and the heritage elements: From all of this documentation, a sustainable analysis of the balance between houses and heritage elements and possible future interventions, a master plan has been developed for intervention that collects all these conclusions and allows the Council of Beas de Segura to intervene, in an orderly and correct manner, from both a heritage and social perspective, in this territory.
With the investigation carried out, an attempt was made to obtain a precise, rigorous, and complete understanding of the current state of the remains of the Villavieja walls, including the remains of the Alcazaba and the barbicans of the fortress [37]. In order to achieve this, a series of plans were developed, with all the geometric, architectural, and structural definitions, as well as all the visible pathologies (dampness, cracks, loss of material, etc.), and an analysis of the evolution of the construction elements.
At present, data collection is being carried out using surveying methods, both topographic and photogrammetric, and by means of a 3D scanner, which completes the traditional direct survey [38]. For this reason, it has been essential to clearly understand the different methodologies from which to choose what best suits each work on the fortress and Villavieja de Beas de Segura. A single method cannot be used to carry out a good graphical survey and data collection, especially when it comes to a wealth of analysis that coexists with a complex residential fabric. This is the reason why we have been forced to use various methods, in an integrated manner, always bearing in mind that the final results will provide maximum information on this important heritage site, its construction phases, its evolution, and its current state.
All work has been carried out by digital topography, by means of prismless laser measurements, completed with direct measurement and an accuracy of less than 1.5 cm. All surveys were carried out using convergent photogrammetry [39] from the ground and with drones, support points, and digital typography for less accessible areas, such as caves or interior courtyards of abandoned houses. All this work was concluded with a 3D model, formed by a cloud of triangulated points, which allowed us to obtain various orthophotos, based on the various projection plans that we had chosen. As these have been superimposed on a vector system, it has been with these orthophotos that we have been able to obtain all kinds of information, both for measurement and for a profound analysis of pathologies [11].
In order to carry out the field work, a geodesic network was established by means of a precision polygonal system which covered the entire remains of the walled precinct. Given the dimensions of the delimitation, we had to place an important framework of specific reference and support points. From the bases of the polygonal all the essential points for the definition of the elements of the Villavieja and Castillo complex were radiated. This guaranteed the geometry of the constructions (both heritage and houses) to be determined with an error in precision of less than 1.5 cm.
The surveying equipment used to take to carry out this work was two Leica TCR 407 total stations of 15 cc centesimal appreciation; TopCal 21 calculation program, TCP v.4; GPS 5800; Canon 80D Camera (24.2 Mg) calibrated and various lenses; Canon G7X (20.1 Mg); DJI Phantom 4 Pro Drone; DJI GS Pro flight programming, as well as the Agisof Metashape convergent photogrammetry software.
To link the work with the geodetic network, the coordinate system georeferenced from two points taken with GPS RTK (Trimble GPS: GPS 5700/5800), precision xy: 1 cm in z: 2 cm UTM HUSO 30N ED 50 projection, orthometric dimensions. Given the impossibility of measuring all the bases using GPS, due to the narrowness of the streets, depth of the caves and complex urban layouts, it was necessary to carry out closed polygonal lines around the outer contour of Villavieja, and within the sanctuary, and open polygonal lines to measure the caves. This was carried out with a Leica TCR 407 Total Station and with more than 700 bases located on the ground.
All the points necessary for the definition of the structural elements of the complex radiated from these bases of the polygonal (point cloud with 3D coordinates). This ensured the geometry of the construction with errors of less than 1.5 cm for well-defined points as well as the P.A. of the stills.
The different point clouds processed in the high-resolution aerial images allowed us to generate georeferenced orthophotos with a very exhaustive precision and an error of less than 1 cm on the control points located on the ground. The development of the work was completely automated, allowing us to carry out the data collection and simultaneously see the data obtained. Although the work not at all easy, given the large amount of noise coming from the vegetation and numerous uncontrolled constructions and ruins, a genuine photogrammetry was achieved by increasing the number of physical bases located on the ground. We must also point out that to take much more exhaustive data, at our request the council undertook a major cleaning and clearing of the area. From all this we obtained a graphic documentation with a pixel resolution of 1 cm in plan and between 2-4 mm in elevations and sections.
The photogrammetric results, despite the complexity of the project, have been graphically and analytically rich. However, it must be emphasised that, given the excess noise and number of medium voltage lines that surround the studied environment, the option of working with effective values (RMS) was eliminated, and we opted for the development in TRMS. In a complex place with signal parasites such as these we do not believe it appropriate to work with such ordered sine wave spectra, as they would never reflect reality. This complex data collection could be carried out with complete accuracy, making real measurements, at all times, and exponentially increasing the reference bases. This is why the architectural drawing was made with progressive sequences of horizontal and vertical triangulations which allowed the data obtained through TRMS values to be corroborated in situ and in real time. Since previous cartographies of these characteristics had never been carried out it was possible to verify altimetric, but not planimetric, agreement.
The planning of the field work was carried out in different time phases, taking into account time and different products obtained: Phase 1: Previous recognition of the land and collection of initial documentation: Given the territorial complexity of the work area in which we were located, an initial visit was necessary that would allow us to successfully obtain all the existing graphical documentation (very scarce) and to go through all the areas that would later be surveyed. There were innumerable accesses to the rears of abandoned houses, with patios completely overrun by vegetation. This required a deep cleaning prior to the survey. In addition, all the existing structural units were recognised, not only those constructed but also those drilled into the natural slope itself. In this phase, the different units were named and the important remains of old structures that had never previously been documented were documented. This phase lasted two full days in the field.
Phase 2: Reading the territory from the study of the existing data: Once all the data provided by the council had been studied, a new visit was made in which phases with concrete historical readings of these structures were identified. At this point, the work carried out by the city's Official Chronicler, Antonio Yuste, was of great help. From a profound knowledge of existing documents, and the descriptions contained in them, it was possible to carry out a coherent re-reading of the complex material reality. This phase lasted two days, one in the field and another in the office.
Phase 3: Location of support points and the reference system: From this moment and having the different convergent construction phases clear in this material reality, the process of location of the data collection points, triangulation, and reference system, began. Until then, various actions had been taken without considering a unitary reference system. With this action, the referencing criteria were unified and a framework was consolidated, not only for this survey, but for all future works that will be taken in the context of Castillo de Beas. This phase lasted two days in the field.
Phase 4: Taking photogrammetric data and parallel drone flights: Once the work systems were established, with clear specific objectives, the entire work area cleared, and with access facilitated by the proprietors of the houses, work began on the survey. The complexity of the structures and the important visual discontinuity forced the generation of an important network of points on which we then made the photogrammetric scan. This phase was developed over two weeks in the field.
Phase 5: Research work: The development of the cartographies was an important work, carried out by a multidisciplinary team, that were entering in different phases of the project. This phase had several specific sub-phases, based on the knowledge area. The first was developed entirely by the topography and architecture teams. Once the first cartographies were obtained, we were able to bring together the different disciplines at the table, with the purpose of gradually converging the various historical, construction, destructive, archaeological, and intervention hypotheses. This research phase lasted two months in the office.
Phase 6: Adjustment and verification visit: Once all the work described was completed, we returned to the field to propose some adjustments and hypotheses, with a search for specific material readings. After that return to the field, the hypotheses generated during the study could be established and verified. This phase lasted two days in the field, prior to closing the project.
Phase 7: The research project concluded with a proposal for intervention and the drafting of the master plan for action and conservation of the Castle and Fortress of Villavieja de Beas de Segura. This was recently approved by the Heritage Commission of the Delegation of Culture of Jaén.
From all these working phases, a set of more than 50 plans (separated into implementation units) were obtained, which were later grouped to take a complete reading. From all this debugging work, they were grouped into four area: plans of the north section of the wall, plans of the south section of the wall, plans of the east-west section of the wall and plans of the interior of the walled precinct (the Old Convent). In this way it was possible to sectorise the graphical production, and the results, for future activities that are explained below.

Results
After obtaining the data and reading the graphs taken from the photogrammetry, we were able to establish a series proposals. For the study of the walls, we worked with both the north section (structure) and the south section (structure) establishing the division of the elevations into three defined areas as an analysis criterion: ZONE A. Construction adapted to the wall and irregular urban growth. It can be observed how, during the 20th century, the old Villavieja fortress was over capacity, with many buildings emerging from the layout of the walls, taking advantage of their foundations [40]. For this reason, a residential layer was created, superimposed onto the historic walls, which had to be analysed building by building in order to determine the value of each, and its conservation or elimination. For this reason, in this material analysis only singular buildings, such as the Sandovales Palace, will be analysed leaving the residential assessment for the different phases of detail. ZONE B. Walled section, according to the material evidence obtained and the outline hypotheses.
This corresponds with the area of wall, as such. In it, the different pathologies derived from its defensive composition will be analysed: the state of the stone, the mortar, the damage by humidity, bio alteration, or the actions of man, among others. It is an analysis that will later have to be extended with sampling, chemical analyses, and other tests, in order to carry out the different phases of intervention. ZONE C. Geological base of tuff stone on which the fortress is constructed. Its consolidation and restitution is fundamental to guarantee the stability of the fortress and of Villavieja itself. A general reading of the pathologies that affect it, such as biological alterations, ruptures, degradation, and volumetric losses, etc., was carried out. As with the walls, an in-depth petrographic study of the geologic matter will have to be carried out.
For the study of the heritage remains of the fortress and castle, a general analysis of pathologies was carried out, corroborated by the data collected from the graphical reading, from chromatic or superficial alterations, to loss of material or damage caused by the action of man. Similarly, those irregular constructions that must be questioned in order to recover the individual value of the building, and its character, as a defensive and territorial watchtower, have been marked.

North Wall Section
The north section of the Villavieja wall is formed by a great palimpsest of times, interventions and constructions, which makes it extremely difficult to understand the original system but which, in turn, has formed a singular and complex heritage structure. The disparity of masonry and structures has been the cause of the length of this research, as it required parallel readings between the graphical expression that we were obtaining, together with the material and historical reading (Figures 9 and 10).
the historic walls, which had to be analysed building by building in order to determine the value of each, and its conservation or elimination. For this reason, in this material analysis only singular buildings, such as the Sandovales Palace, will be analysed leaving the residential assessment for the different phases of detail. ZONE B. Walled section, according to the material evidence obtained and the outline hypotheses.
This corresponds with the area of wall, as such. In it, the different pathologies derived from its defensive composition will be analysed: the state of the stone, the mortar, the damage by humidity, bio alteration, or the actions of man, among others. It is an analysis that will later have to be extended with sampling, chemical analyses, and other tests, in order to carry out the different phases of intervention. ZONE C. Geological base of tuff stone on which the fortress is constructed. Its consolidation and restitution is fundamental to guarantee the stability of the fortress and of Villavieja itself. A general reading of the pathologies that affect it, such as biological alterations, ruptures, degradation, and volumetric losses, etc., was carried out. As with the walls, an in-depth petrographic study of the geologic matter will have to be carried out.
For the study of the heritage remains of the fortress and castle, a general analysis of pathologies was carried out, corroborated by the data collected from the graphical reading, from chromatic or superficial alterations, to loss of material or damage caused by the action of man. Similarly, those irregular constructions that must be questioned in order to recover the individual value of the building, and its character, as a defensive and territorial watchtower, have been marked.

North Wall Section
The north section of the Villavieja wall is formed by a great palimpsest of times, interventions and constructions, which makes it extremely difficult to understand the original system but which, in turn, has formed a singular and complex heritage structure. The disparity of masonry and structures has been the cause of the length of this research, as it required parallel readings between the graphical expression that we were obtaining, together with the material and historical reading (Figures 9 and 10).  From bottom to top, we first found the geological base of tuff stone. This had suffered a lot of damage due to the property regime in which it was located: the subdivision of the houses on "Calle del Carmen", has led to each house corresponding to a portion of rock which acts as a backdrop for the garden. In this way, the different owners have constructed irregular buildings, perforating the rock and creating, or increasing, the existing cavities. This shows pathologies, mainly due to the presence of small and medium sized vegetation, which has grown uncontrollably throughout the rock from the hollows in the tuff rock. Also, some cracks, caused by displacement of the supports, or other causes, mainly horizontal, have been detected. They are the most serious. In addition, failures have been detected in the union of the works in the support of the wall on the rock.
On the top of the rock, the most common pathologies on the walls are efflorescence, due to salt deposits; surface degradation of the material, due to washing; the disintegration of the mortar bonding; or irregular additions with cement mortar. Some areas of manifest antiquity are distinguished, such as the old embrasure opening with a semi-circular arch, and the upper area in general, responding to a canonical typology of fortifications from this period [41]. On the other hand, the lookout area and the houses on 'Calle de la Villa' have suffered from having undergone intense intervention and recovery processes, sometimes unfortunate, which is why, apparently, a clear hypothesis of the limits of the city walls cannot be determined. From bottom to top, we first found the geological base of tuff stone. This had suffered a lot of damage due to the property regime in which it was located: the subdivision of the houses on "Calle del Carmen", has led to each house corresponding to a portion of rock which acts as a backdrop for the garden. In this way, the different owners have constructed irregular buildings, perforating the rock and creating, or increasing, the existing cavities. This shows pathologies, mainly due to the presence of small and medium sized vegetation, which has grown uncontrollably throughout the rock from the hollows in the tuff rock. Also, some cracks, caused by displacement of the supports, or other causes, mainly horizontal, have been detected. They are the most serious. In addition, failures have been detected in the union of the works in the support of the wall on the rock.
On the top of the rock, the most common pathologies on the walls are efflorescence, due to salt deposits; surface degradation of the material, due to washing; the disintegration of the mortar bonding; or irregular additions with cement mortar. Some areas of manifest antiquity are distinguished, such as the old embrasure opening with a semi-circular arch, and the upper area in general, responding to a canonical typology of fortifications from this period [41]. On the other hand, the lookout area and the houses on 'Calle de la Villa' have suffered from having undergone intense intervention and recovery processes, sometimes unfortunate, which is why, apparently, a clear hypothesis of the limits of the city walls cannot be determined.
Finally, the residential layer shows a network of buildings, with narrow parcelling and a certain height (between two and three floors) that mostly rest on the fortress walls and can cause damage in their supports. Without going into each of the buildings to evaluate them and recommend, or not, their elimination, irregular extensions in roofs and attics were detected, as well as excessive volumes that exceed the consolidated cornice line of the neighbourhood. Finally, the residential layer shows a network of buildings, with narrow parcelling and a certain height (between two and three floors) that mostly rest on the fortress walls and can cause damage in their supports. Without going into each of the buildings to evaluate them and recommend, or not, their elimination, irregular extensions in roofs and attics were detected, as well as excessive volumes that exceed the consolidated cornice line of the neighbourhood.
In the Sandovales Palace, on the other hand, we found numerous pathologies, due to the repeated use of cement mortar and the damage caused by humidity, both from cleaning of the facade and by ascending capillarity. The building has also been intervened too frequently and it is difficult to intuit the original configuration, although it is possible to make an hypothesis of the presence of the wall under its foundation, thanks to the tower structure that is "transparent" in the facade mortars, probably absorbed by the building.

South Section of the Wall
The south section of the wall has a casuistry similar to the north, recognising the same three structured edges: the geological base of tuff, the walled section, and the residential level. Nevertheless, the proportions of one or other edges vary with respect to the north section, as the rock acquires great prominence compared to the other two, and the walled areas have been mostly altered in recent interventions (Figures 11 and 12).
The rocky stratum reiterates the same pathologies suffered on the north face, although in greater proportions. It is mainly affected by volumetric losses, whether they are small size, such as hollows or artificial castings, or as in caves (up to a total of six of them at the base of the rock), aggravated by belonging until not so long ago to particular properties. There are also bio-alterations involving the entire tuffaceous structure, caused by invasive species of small and medium size that emerge from the hollows and clog the geologic formation, being favoured by the humidity of the lower areas caused by capillarity. Finally, a serious condition is the multiple cracks that pepper the rock, most importantly on the south-east face, of vertical significance and which are accompanied by smaller fissures arising from the larger ones. three structured edges: the geological base of tuff, the walled section, and the residential level. Nevertheless, the proportions of one or other edges vary with respect to the north section, as the rock acquires great prominence compared to the other two, and the walled areas have been mostly altered in recent interventions (Figures 11 and 12).  The rocky stratum reiterates the same pathologies suffered on the north face, although in greater proportions. It is mainly affected by volumetric losses, whether they are small size, such as hollows or artificial castings, or as in caves (up to a total of six of them at the base of the rock), aggravated by belonging until not so long ago to particular properties. There are also bio-alterations involving the entire tuffaceous structure, caused by invasive species of small and medium size that emerge from the hollows and clog the geologic formation, being favoured by the humidity of the lower areas caused by capillarity. Finally, a serious condition is the multiple cracks that pepper the rock, most importantly on the south-east face, of vertical significance and which are accompanied by smaller fissures arising from the larger ones.
The walled area is, as has been said, smaller in this elevation, in addition to having undergone various successive interventions that have transformed it and concealed the original layer (at some points its existence cannot be verified without carrying out the corresponding sampling). These interventions are clearly observed in the central area under the south vantage point and in the sections under the south-west houses (in the reconstructed tower, for example), which have consisted of recovering panels of the wall with typical stereotomy, whose scale and finish do not correspond to the original. The stone shows general surface degradation due to cleaning and mortar detachment from the support over a large part of its extension. There are also areas with salt deposits and, again, bio-alterations, due to small and medium sized vegetation, especially on the west flank.
Thirdly, the residential stratum also registers a great many irregularities and minor or subsidiary constructions that alter the morphology of the remains. If in the north section it is common to find buildings at height, in this south section there are houses of one and two floors that, for the most part, are not organised, but, instead, are of a progressive The walled area is, as has been said, smaller in this elevation, in addition to having undergone various successive interventions that have transformed it and concealed the original layer (at some points its existence cannot be verified without carrying out the corresponding sampling). These interventions are clearly observed in the central area under the south vantage point and in the sections under the south-west houses (in the reconstructed tower, for example), which have consisted of recovering panels of the wall with typical stereotomy, whose scale and finish do not correspond to the original. The stone shows general surface degradation due to cleaning and mortar detachment from the support over a large part of its extension. There are also areas with salt deposits and, again, bio-alterations, due to small and medium sized vegetation, especially on the west flank.
Thirdly, the residential stratum also registers a great many irregularities and minor or subsidiary constructions that alter the morphology of the remains. If in the north section it is common to find buildings at height, in this south section there are houses of one and two floors that, for the most part, are not organised, but, instead, are of a progressive and somewhat chaotic emergence. Those located to the north-west, from the south vantage point to the small square next to the Calle de la Villa, prevent the route of the rampart to be recorded, while those located to the north-east block the ascent to the highest point of the hill, in addition to being, according to the hypotheses, located on the remains of Santa Maria de Villa. The latter, like the wall beneath them, are affected by advanced bio-alterations, with vegetation rising from the rock towards the rear walls and facades. All of them also present problems of finishes, showing bare dividing walls, unplastered facades, and metal or fibre cement roofs that distort the unitary vision of the hill of Villavieja.

Convent and Sanctuary
The remains of the church of the Virgin de la Paz, originally a hermitage and currently attached to the Interpretation Centre of Villa, is a construction where, according to the hypotheses, the castle of the Villavieja stood, and consists of different diachronic buildings that have arisen from the different extensions. Four pieces are distinguished, essentially the hermitage of La Paz, a square-plan body with a central tower that houses the old restaurant and part of the museum, an L-shaped body that separates the Plaza de la Villa from the Plaza de la Ermita and houses the rest of the museum, and a small body of stairs attached to the south façade (Figures 13 and 14). Santa Maria de Villa. The latter, like the wall beneath them, are affected by advanced bioalterations, with vegetation rising from the rock towards the rear walls and facades. All of them also present problems of finishes, showing bare dividing walls, unplastered facades, and metal or fibre cement roofs that distort the unitary vision of the hill of Villavieja.

Convent and Sanctuary
The remains of the church of the Virgin de la Paz, originally a hermitage and currently attached to the Interpretation Centre of Villa, is a construction where, according to the hypotheses, the castle of the Villavieja stood, and consists of different diachronic buildings that have arisen from the different extensions. Four pieces are distinguished, essentially the hermitage of La Paz, a square-plan body with a central tower that houses the old restaurant and part of the museum, an L-shaped body that separates the Plaza de la Villa from the Plaza de la Ermita and houses the rest of the museum, and a small body of stairs attached to the south façade (Figures 13 and 14).   Santa Maria de Villa. The latter, like the wall beneath them, are affected by advanced bioalterations, with vegetation rising from the rock towards the rear walls and facades. All of them also present problems of finishes, showing bare dividing walls, unplastered facades, and metal or fibre cement roofs that distort the unitary vision of the hill of Villavieja.

Convent and Sanctuary
The remains of the church of the Virgin de la Paz, originally a hermitage and currently attached to the Interpretation Centre of Villa, is a construction where, according to the hypotheses, the castle of the Villavieja stood, and consists of different diachronic buildings that have arisen from the different extensions. Four pieces are distinguished, essentially the hermitage of La Paz, a square-plan body with a central tower that houses the old restaurant and part of the museum, an L-shaped body that separates the Plaza de la Villa from the Plaza de la Ermita and houses the rest of the museum, and a small body of stairs attached to the south façade (Figures 13 and 14).   The church dates from 1873, originally an isolated construction on the hill of Villavieja, next to the remains of the walls [42]. It has three free-standing facades (west, north, and east) and the third dividing wall towards the body of the square-the first two consist of sgraffito with dressed ashlars. The west and north facades reflect similar situations: the increased presence of efflorescence and salts stands out, as well as the loss of the sgraffito on the façade, due to the mortar washes. In addition to cleaning, water leaks are also detected in the upper areas of the façade, and humidity by capillarity in the lower ones. The brickwork can be seen in the gaps and in the bell gable, where it shows superficial degradation due to cleaning and, in the north elevation, a blocked access has been detected. In addition, the facades have traces and marks of inadequate electrical installation for the building and a show lack of uniformity of colour.
The quadrangular building mainly includes pathologies derived from the use of cement mortar and its additions, as well as the finishing paintings on the interior faces that hide the original stone facade (already shown in the south elevation of the Interpretation Centre). The exterior faces are those that appear most altered and which also have a greater impact, due to the preferential position in the landscape. Once again there is widespread use of cement mortar and plastic paint, as well as the alteration of the system of gaps, as the previous interventions have been opening gaps, without order or functional criteria, which corrupts the original composition. Finally, the roofs suffer damages and some filtrations, although they are not at risk of collapse.
The arms in the "L-shape" of the construction that separate the two squares, has begun to show the variable treatments of their facades: towards the interior they maintain the cement mortar, with a red paint finish, and the holes framed in white, towards the Plaza de la Villa the stone base is shown with the mortar removed, and towards what there is of the south viewpoint, is a cement mortar with a white paint finish. Dampness appears in the different facades, due to capillarity in the lower areas and water seepage in the upper parts. The stone faces show disintegration of the mortar and superficial losses through cleaning, as well as areas with efflorescence of salts and patina. Again there appear to be electrical systems crossing the facades and downpipes. Their roofs show poor condition, although these are not in danger of imminent collapse. On the south facade, two possible blind hollows were detected, according to their composition.
The annexed body of the stairs appeared in a generally poor state, with dampness due to capillarity in its lower part, and numerous leaks in the cornice. Also, a decontextualised hollow has been opened at the height of the ground floor.
The remains are surrounded by irregular subsidiary buildings, which must be removed to ensure the understanding of the building volume. Specifically, there appear to be up to three garages in the south vantage point, an addition on the east facade and a hollow brick wall cutting off the continuity of the exterior area of the apse (Figure 15).

Discussion
The process of surveying the walled enclosures, as well as the rest of the castle, has been a technical and technological challenge that has resulted in a series of cartographies, never seen until now. All the documentation of the various caves and cavities that are hidden in the lower levels, the remains of the wall structures from the Almohad and Chris-

Discussion
The process of surveying the walled enclosures, as well as the rest of the castle, has been a technical and technological challenge that has resulted in a series of cartographies, never seen until now. All the documentation of the various caves and cavities that are hidden in the lower levels, the remains of the wall structures from the Almohad and Christian periods, or simply actual topographic sections, with the location of all the existing elements, has been subjected to a profound analysis, with the purpose of bringing the existence of this castle to light, the structure of which was unknown until now (Figures 16 and 17).     In modern times, the coexistence of the domestic structures (houses) in this area of the city became more difficult due, mainly, to the complexity of access to these sectors, as well as the impossibility of opening roads that would allow road traffic. In view of this, the entire original population moved to the less rugged slopes of the municipality, leaving the area of the castle and abandoning the walled enclosure with its urban fabric in a semi-ruined state. With the arrival of immigrants, especially seasonal workers linked to olive-producing farms, this area of the city received this population, completely alien to the place in which they were located. This disengagement from the land was what made the abandonment even greater, given that actions were undertaken outside the material reality itself and outside the memory of what that place had meant for Beas de Segura. With all this, the castle grounds were filled with warehouses, slums, garages, and residual spaces.
With the documentation produced and collected together in this article, an orderly intervention process has begun, in which the first of all the phases was to know the current state of the site. Therefore, it is with thanks to the funding and the will of Beas de Seguro Council, that these activities took place, and which have allowed us to become aware of what remains of this unique castle, and to be able to establish orderly groundwork for its gradual recovery. For this, an important debate on the sustainability of the heritage of this type of precinct was taken into account, once they had been graphically developed. This debate was reflected in the following points: -What is known is protected: We are convinced that it has been the ignorance of the existing heritage reality in this context that has led to almost total loss of the presence of the castle and walled enclosures. This can be shown, explained, documented, and published, from good documentation. Once the first phase of systematic documentation had been carried out, the next phase was to make known what there is of the castle of Beas de Segura, as shown in this article. -Orderly plan of action: When the fields of action are as extensive as the one described in this walled enclosure, there is a risk of intervening randomly or due to emergencies. The approach, once the results of this data collection had been obtained, was to establish a master plan [43] that, from a sustainable point of view with the anthropological reality of Beas de Segura, would be capable of assuming, addressing, and developing it, establishing intervention criteria for the whole action. Based on this, a list of priorities and areas has been established according to their state of conservation. -Multidisciplinary team: Given the complexity and sensitivity of the territory on which the activities were planned, from the first moment, all the necessary disciplines were incorporated to address this reality, from architecture, archaeology, and history, to topography, anthropology, biology, and geology. A complex team of people who, starting from the common basis of establishing a sustainable framework of activities in the context of Castillo and fortress, knew how to bring together the needs of each of the disciplines. Thus, the graphic tool became the common nexus to them all. For this reason, the first development of the project was the accomplishment of an important graphic documentary source as a starting support for all the later heritage discourse ( Figure 18). -Tourism, sustained and sustainable: Tourism is not the solution for heritage, but it does allow the development of economically sustainable contexts for its development.
Elimination of the residential fabric of all this entire heritage area was never a consideration in this project-quite the opposite, it was to try to find the formulas to make the tourist sector coexist with the residents themselves. Thematising a sector of the population would only present problems in the future through the well-known processes of gentrification and wealth crystallisation [44]. -Heritage and social balance: The conservation of these important vestiges of heritage must go hand in hand with social development of this sector of the population. It would make no sense to delimit a space of the city and turn it into a museum without life. For that reason the developed master plan has provided a set of tools to make these two dimensions coexist, seeking a balance between respect for the conservation of these structures and the development of the residents of this area. For this, the council has begun to buy all the private buildings defined within the action area in order to restore some of them, to eliminate others, but giving the entire intervention a sense of logic, starting from the material reality revealed by the graphical analysis of the remains. -Recovery of the social memory of the heritage elements: The present population that inhabits this area, as has been indicated previously, is alien to the history of the municipality itself. With the exhaustive documentation of the existing elements it is intended to begin a process of recovery of heritage awareness of the municipality as well as the reclassification of the recovered spaces by means of giving significance to the collective memory in these spaces. There are important traditions linked to this walled enclosure and castle. The promotion of these civic and religious activities will gradually endow this group with significant historical and heritage value. -Documentation and recovery of spaces for life and culture: With the exhaustive identification carried out, various important architectural landmarks, such as towers, doors, etc., have been documented. All these spaces are intended to be incorporated into the daily life of the city, in addition to their restoration and enhancement, through a sustainable programme of activities over time that allows everyone to insert all these heritage enclaves into the daily life of the city. -Viability of future investments: Given the dimensions of the documented enclosure it would be totally unfeasible to undertake everything that was planned, especially for a local administration on the scale of the Beas de Segura municipality. It is for this purpose that an assessment of each of the activities, based on the order of execution, was carried out. These phases allow the administration to seek forms of financing which will guarantee the viability and sustainability of the project. -Tourism, sustained and sustainable: Tourism is not the solution for heritage, but it does allow the development of economically sustainable contexts for its development. Elimination of the residential fabric of all this entire heritage area was never a All these points have determined the initial objectives of the graphic documentation process, as they have delimited the action, established the question and proposed the hypotheses. From all the work carried out and collected here, it has been possible to establish the certainties that now allow us to continue working ( Figure 19). sert all these heritage enclaves into the daily life of the city. -Viability of future investments: Given the dimensions of the documented enclosure it would be totally unfeasible to undertake everything that was planned, especially for a local administration on the scale of the Beas de Segura municipality. It is for this purpose that an assessment of each of the activities, based on the order of execution, was carried out. These phases allow the administration to seek forms of financing which will guarantee the viability and sustainability of the project.
All these points have determined the initial objectives of the graphic documentation process, as they have delimited the action, established the question and proposed the hypotheses. From all the work carried out and collected here, it has been possible to establish the certainties that now allow us to continue working ( Figure 19). Figure 19. 3D volumetry of the studied enclosure. This volume has allowed us to be able to identify each of the houses that affect the walled enclosure, as well as the pathologies caused by them [authors' own drawing].
The master plan (the complete document) includes the analysis carried out from these graphic documentary sources as a support for the other disciplines. The plan clearly sets out the study of the impact of the interventions planned for the future, the study of Figure 19. 3D volumetry of the studied enclosure. This volume has allowed us to be able to identify each of the houses that affect the walled enclosure, as well as the pathologies caused by them [authors' own drawing].
The master plan (the complete document) includes the analysis carried out from these graphic documentary sources as a support for the other disciplines. The plan clearly sets out the study of the impact of the interventions planned for the future, the study of uses, and the analysis of the tourist impact. This document, although at the planning stage, and not bound by regional planning regulations, it is intended to be the tool which allows us to act according to objective technical criteria.

Conclusions
The Castle and Fortress of Beas de Segura are one of the main fortified bastions in the south of the Iberian Peninsula. Its location on a promontory has conferred it a special topographic, landscaped, and heritage uniqueness, being a place inhabited from its origin to the present time. This uninterrupted presence has generated important transformations to the heritage complex. With the graphic and planimetric work we present in this article, it has been possible to establish a unique sequence in the configuration of the current enclosure.
From the graphic reading carried out in this investigation, it has been possible to categorise the construction sequences, and the historical and material logistics, both for its conservation and for the coexistence of the remains that still exist with the society that inhabits them. The sustainability and guarantee of the survival of these heritage structures has to be considered in parallel to the generation of domestic spaces. The poor state of conservation of the remains and the permanent looting and destruction by the residents themselves has led this important building to its present state of ruin. From the graphic documentation and readings carried out, and the collections in this work it is possible to demonstrate the original elements that still survive and which represent an important fortified complex.
The results of the work have taken shape in the "Master Plan for the recovery and enhancement of the fortress of Villavieja and the Castle of Beas de Segura" which has just been approved by the Heritage Commission of the Delegation of Culture and Heritage of Jaen. It will shortly be published and made available to all interested parties as a free download. Similarly, and in order to work in a co-ordinated manner, the cartographies and surveys will form part of a website, allowing the development of the works to be monitored at any moment, as well as their compatibility with the expected results.
We believe that from now on, with all this documentation, the foundations can be laid for the adequate material and heritage survival of the Castle and Fortress de Beas de Segura. Its location at the door of the Sierra de Segura Natural Park confers it the opportunity for optimal sustainable development at the territorial and local level of the municipality. Funding: We would like to thank the financial support of the Own Research Plan of the University of Seville as well as the City Council of Beas de Segura. Thanks to its funding, it has been possible to carry out this research.