Integrated and interactive 4D system for archaeological stratigraphy

The digitization of some of the processes carried out in an archaeological excavation is changing the way of working at the site. Today, new technologies coexist with traditional methodologies. The study of stratigraphy can combine drawings of profiles and plans, the Harris Matrix diagram, as well as digitized files that perform a complete record of the stratigraphic sequence. However, this information is usually unaggregated from the rest of the information system that makes up the archaeological record. In this paper, we present an integrated software tool and the associated methodology to record, store, visualize and analyze the 3D stratigraphy of a site. The implementation uses spatial databases to store information of a heterogeneous nature and game engines for the visualization and interaction with this information. During the excavation process, the strata are scanned using the Tof technology, which is available in many smartphones. The resulting 3D model of the stratum, once uploaded to the software system, allows us to visualize the sequence of strata incorporating the findings into their original arrangement. Some additional tools, such as the scrollbar, help to perform a temporal analysis of the site. The result is a 4D interactive stratigraphy tool, which together with the Harris Matrix, complements the archaeological record and facilitates the work to archaeologists. This methodology also allows to speed up the on-site work and the subsequent analysis, while improving the user experience with the 3D archaeological site replica.


Introduction
Archaeological stratigraphy is a discipline that, based on the stratigraphic principles of Geology, studies the strata sequence of geological and human-made formations. Like geological processes, human activity has left a mark over time as a sequence of deposits or structures that can be identified by archaeologists. Stratigraphy also reflects the chronological sequence of these formations over time, and consequently the chronology of the finds discovered between consecutive layers. The more standardized representation for defining stratigraphy was introduced by Harris. The Harris Matrix (Harris 1989) comprises a diagrammatic 2D graph of the section of an excavation for illustrating these stratigraphic sequences. This two-dimensional representation, in fact, provides information about four dimensions, the three dimensions of space plus time. Thus, the Harris Matrix provides a schematic description of the surface, the depth of the stratigraphic units and also the time or chronology of these sequences. Definitely, the Harris Matrix provides a comprehensive method for documenting stratigraphy and, since its introduction in the 1970s, it has been considered as a standard into the archaeological work (Harris 1975;. In recent decades, Archaeology has benefited from information and communication technologies (ICT) in all its procedures, from data acquisition, documentation, analysis and dissemination. Many of the manual processes, which were developed only a couple of decades ago, have been computerized. This brings benefits in terms of the time to perform some tasks, the way to organize information, or the new analytical capabilities. Dissemination activities also include digital content to improve the user experience of the general public. Stratigraphy is present from the excavation of the site until the dating and analysis of the remains found. In order to assist the Harris Matrix drawing process, some software tools have also emerged to computerize the process, allowing for more flexible editing and automatic integrity checking of the final schema.
Despite all the benefits of these technologies, there are numerous challenges to be faced. One remaining problem is the lack of integration of all these technologies into a single system. Thus, many software tools perform a specialized function or help in a specific task, and above all, in only one of the phases of the archaeological process. An example of this is a 2D picture of a Harris Matrix dissociated from the database that stores the information about the finds, or disaggregated from the images taken from the strata during the excavation in the archaeological site.
In this paper we present an integrated framework for managing archaeological sites, including their stratigraphy. We describe the methodology and the software tool for managing the strata and the rest of information of an archaeological site by means of a 3D graphical interface. During the excavation process, each defined layer or stratum is scanned using agile mobile technologies. This is normally done once the archaeological layer has been completely excavated. The obtained model provides a three-dimensional representation of the actual site maintaining the shape and appearance of the base of each layer. All these digitized strata are introduced in a virtual 3D environment, maintaining their scale and topographic constraints. The finds which are considered significant elements, are then scanned and repositioned between identified layers. The resulting visualization can be interpreted as the digital representation of the site before excavation, and without the soil surrounding the finds. A spatial database stores all the site information, including finds and strata. Deposits are differentiated from interfacial units both in the database and for visualization. This facilitates the process of global analysis of stratigraphy combined with the rest of the information of the archaeological site. The query process can be carried out intuitively through the graphical interface, which improves the user experience and allows non-archaeological professionals to better understand the deposition process. Temporal queries are performed using either the excavation process timeline or the historical period of the remains. This information system does not necessarily replace other methods of stratigraphic recording, but complements them and improves their understanding.
The paper is structured as follows. The "State of the art" section reviews the state of the art in stratigraphy and the use of new technologies. The "System overview" section gives a brief overview of the implemented information system. The "Data acquisition and storage" section identifies the entities and data model used in this paper. The "4D stratigraphy management system" section describes the system behavior and the methodology to perform the stratigraphic analysis. Finally, the "Results and discussion" section examines an example of use case focusing on the advantages and disadvantages of this approach. The "Conclusions and future work" section concludes the work and gives future guidelines to continue this work.

State of the art
Archaeological stratigraphy provides a methodology for registering stratigraphic evidence for posterity. This is considered the standardized way of site preservation, allowing future examination and analysis (Harris 2017). In an excavation, stratigraphy provides temporal relationships between sequences in such a way that finds located on upper strata are historically more recent elements than those found in deeper layers. This principle or law that establishes that upper units of stratification are younger than those in lower strata is known as the principle of superposition. This and three other laws were proposed by Edward C. Harris (1989), contributing to conform the contemporary recording and analysis methodology. The second law is the principle of original horizontality, which determines that any layer deposited in an unconsolidated form will tend towards a horizontal deposit, since many deposits have been laid down by natural forces. The third law is the principle of lateral continuity, which explains how a stratum should end, that is, how it could be bounded, the shape it should have and whether it has been affected by erosion or excavation. Finally, the principle of stratigraphic succession states that any unit of archaeological stratification has its historical place after the unit or layer directly below, and before the layer directly above it. Traditionally, strata can be classified as deposits and interfacial units. Deposits follow the law of original horizontality; however, this natural arrangement of the stratum may have been destroyed. This normally happens due to human activity in the past, for example when the ground has been excavated for a tomb. These cases are considered interfacial units (also called surfaces), and have a different treatment or representation in stratigraphy.
Harris proposed a diagrammatic representation of the stratigraphic sequences in the so-called Harris Matrix, a 2D graph in which nodes represent layers and edges denote stratigraphic relationships between layers (Harris 1989). The principles of archaeological stratigraphy are reflected in the matrix. The oldest stratigraphic units are at the bottom, and the newest ones are at the top. Therefore, the matrix is completed from top to bottom, since upper strata are excavated before, and older layers once the excavation has finished. In short, this is the most universal tool for describing stratigraphy, and is part of the documentation of most archaeological projects (Demetrescu 2015;Drap et al. 2017a;Patricia 1991). Moreover, the usefulness of this tool has transcended archaeology and is used in other disciplines (Photos-Jones and Hall 2011;Yinan et al. 2009).
Apart from being a very widespread tool, the Harris Matrix (HM) is suitable for stratigraphically documenting very complex sites. Even when its use has not been questioned, the registration process can be long and tedious. Some authors have proposed some modifications or extensions to complete or improve its functionality. For example in Patricia (1991), additional symbols were added, as well as a modified spatial arrangement of the matrix for improving analysis and discussion of excavation materials. In Neubauer et al. (2018), the implicit chronology associated to the HM is explicitly defined, allowing to establish a hierarchical time model and providing information about temporal intervals. The Extended Matrix (EM) is another example (Demetrescu 2015;Demetrescu and Ferdani 2021) in which the authors define a formal language and a software tool to include and define re-constructive elements, as well as the sources on which they are based, allowing to virtually reconstruct archaeological contexts.
Some other examples of software tools simply try to assist in the stratification process. Archaeologists take advantage of these digital applications because of their user-friendly graphical interface for editing the information. This allows adding new elements in a flexible way compared to the rigid paper-based process. One example is Le Stratifiant (Desachy 2009), which generates a graph that visually, is somewhat different from the original, and to which dating and certain level of uncertainty can be added. One of the most used tools is the Harris Matrix Composer (HMC) (Traxler et al. 2008). The HMC gives a standard visualization of the graph and reports about its validity. In this case, it is possible to incorporate additional information about dating to allow temporal relations.
Even though these and similar software tool examples facilitate the stratigraphic documentation, they are not normally integrated into the rest of the information system. In fact, as a consequence of the emerging ICT, numerous computer-based tools are available with the aim to help during all the phases of the archaeological work. Roughly speaking, the project documentation is organized in a database. Data in records usually include varied information such as blueprints, photographs, scans, sketches or alphanumeric information. Additionally, some advanced techniques such as photogrammetry or laser scanning are increasingly used for data capturing. They provide 3D models as the result of a digitization process to complete the archaeological record (Radicioni et al. 2021). In short, all these heterogeneous data consisting of textual, 2D and 3D information are today the elements that make up the archaeological record (Ardissone et al. 2013;Galeazzi 2016). This leads to the need for handling information of a very diverse nature and from very different sources, which also requires specific management software. This integration is one of the aims of recent archaeological projects (Galasso et al. 2021;Katsianis et al. 2021;Stal et al. 2014). In this regard, the Harris Matrix is usually part of this amalgam of information, but outside the archaeological database. In fact, one of the issues associated with the management of this diverse data is the use of different software. For example, a photograph is viewed with a different application than the one needed for visualizing and navigating in 3D environments. This disaggregation between data types and software tools also affects stratification. The Harris Matrix is normally presented on paper, as a digital image or as an external document. For some time now, this has leads to some archaeological projects to develop specific tools that link the Harris Matrix with the three-dimensional visualization of stratigraphic layers (Day et al. 2005;Green et al. 2001). In some cases, advanced visualization together with other mechanisms to relate stratigraphic units (e.g., ontologies), have been very powerful tools that complement the HM (Giovanni L et al. 2010;Drap et al. 2012).
The lack of standardized software tool sets in Archaeology leads archaeologists to make use of Geographical Information Systems (GIS) (Nguyen-Gia et al. 2017;Wheatley and Gillings 2003). Advances in software and hardware in these platforms can contribute to the visualization, data storage, documentation and spatial analysis (Bachad et al. 2013). As stated above, documentation has been enriched with 3D models. This makes 3D GIS a candidate for a global information system. They outperform traditional 2D systems by incorporating spatial data with three-dimensional models under the same framework (Katsianis et al. 2021;Landeschi 2019). Additionally, they also facilitate the spatial analysis of the individual remains, and study the relationships among them and with the ancient landscape. GIS can store the position of each find and the layer or stratum where it was located. It is usual to add the UTM (Universal Transverse Mercator) coordinates for more accurate positioning (Al-Ruzouq et al. 2018). Even successive archaeological layers are scanned and integrated into GIS for recording stratigraphy (Drap et al. 2017a;Gavryushkina 2021;Ostrowski et al. 2018).
However, GIS are not standard tools for Archaeology, and they are still in the process of integrating 3D with full functionality. They provide generic solutions with a high level of abstraction, that is away from archaeological methodology (Richards-Rissetto 2017). 3D GIS are still in early stages of development, with limited capabilities in terms of 3D model integration, friendly interfaces or ubiquity. This is usually the reason why many research projects choose to develop their own software tools (Austin 2014; Meghini et al. 2017).
Another solution focused on enhancing the user experience is to take advantage of the capabilities of video game engines. They can be used to create 3D scenarios, interact with scene elements and navigate freely on the scene (Statham 2019). More and more examples can be found in the literature applying to archaeological environments; however, most of them for dissemination purposes (Smith et al. 2019;Zotti et al. 2020), not to facilitate the work of archaeologists.
Another issue that an integrated software should deal with is spatio-temporal analysis. Data associated with archaeological sites has an important spatial component (Radicioni et al. 2021;Wheatley and Gillings 2013). Structural and artifactual remains are found in specific position and orientation, and normally surrounded by other finds (Zangrossi et al. 2019). This spatial arrangement is key to reconstructing these lost spaces. Pictures and draws of the site during excavation try to preserve this information, however, once again they are stored as separate records. This implies a lack of connection between the textual document of the find and its 2D representation. In the particular case of existing 3D models, only in a few cases there is an explicit relationship between the 3D models and the rest of the archaeological record (Meghini et al. 2017). Regarding stratigraphy, we also find this disconnection between the graph associated with the Harris Matrix, the 2D drawing complementing it and the textual information of the database. Some authors state that this methodological principle to separate a stratigraphy into a consistent series of "single" contexts may impose artificial order on the evidence (Croix et al. 2019). It is also asserted that the HM is inherently limited because it only provides a partial snapshot of the stratigraphic sequence (Gavryushkina 2021). In fact, according to Harris methodology, a complete recording of a rectangular area combines the four diagrams, one for each of the four sections, as well as the plant drawing of each excavated stratum (Harris 1989).
One possible solution to this issue comes by connecting modern spatial assets to the stratigraphic formation process (Drap et al. 2017b). Another alternative is the addition of topological relationships to finds (Ortega et al. 2020;Stefani et al. 2013), whose effects are known on archaeological reconstruction and interpretation (Plutniak 2021).
Spatial relationships are inherently associated with temporal ones. Actually, stratigraphy is focused on establishing a chronological sequence among strata. According to Harris, periodization consists of two phases: (1) the definition of the stratigraphic sequence, which is done without attention to historical material; and (2) the division of this sequence into phases and periods, which can be started during the excavation but ends with the study of the finds (Harris 1989). Definitely, temporal analysis of finds is one of the most important objectives of Archaeology, and the reason why some authors have developed some modifications or extensions to the HM to incorporate them more explicitly (Demetrescu and Ferdani 2021;Neubauer et al. 2018). As a consequence of this, spatio-temporal data models have been defined in order to implicitly establish these relations between stratigraphy and the archaeological records (Belussi and Migliorini 2017;De Roo et al. 2016). Some projects work with the 3D representation of the stratigraphic units in 3D, and without making explicit use of the HM (Galasso et al. 2021;Händel et al. 2021;Ostrowski et al. 2018).
In summary, obtaining an integrated information system including data storage, 3D visualization and interaction, as well as stratigraphic analysis, is nowadays under study and development. This should include the capabilities described above: (1) a spatio-temporal database for maintaining textual and 3D models topologically and chronologically connected (Plutniak 2021). (2) A virtual 3D replica of strata and finds of the site considering spatial arrangement for better record understanding and analysis (Galasso et al. 2021;Zangrossi et al. 2019). (3) 6) The GUI must follow the archaeological process and not vice versa to provide the archaeologist with a good user experience (Zilles Borba et al. 2020). In this paper, we describe a prototype system which provides most of the described capabilities, and the methodology that makes it possible. We focus on the spatio-temporal analysis of the information and the study of stratigraphy.

System overview
In this section we describe the main system characteristics, focusing on its architecture and the implemented functionalities. Figure 1 summarizes these features, based on a clientserver architecture.
On the client side, the user interacts with a digital representation of the archaeological site. The application has been implemented using Unity (https:// unity. com/), a crossplatform real-time video game engine with capabilities such as 3D visualization, interaction, free navigation and illumination. Unity is available in free and chargeable versions. We have used the free version for most of the functionality, although some external proprietary assets have been added to improve the user experience. Some recent work has used this technology for similar purposes (Smith et al. 2019;Zotti et al. 2020).
In this implementation there are specific modules for managing stratigraphy. Stratigraphical units are presented as three-dimensional models captured during the excavation process. Strata and interfaces are differentiated for visualization and analysis. The user can interact with the virtual site for spatio-temporal querying. Any device with certain graphical capabilities and connected to the Internet can be used as client device.
On the server side, a spatio-temporal database using Post-GIS (the spatial extension of PostgreSQL) stores all types of information about the excavation site. Textual and spatial data, and even some 3D models are hosted natively in the database. Topological relations are included to associate vestiges that could be connected in such a way, for example, because they are close and made of the same material. Pictures of finds and/or their full-resolution models are linked to the database as external files. In all cases, this heterogeneous information is maintained, queried and visualized through the same software application. The client and server sides are bidirectionally connected through a REST API protocol. The information is retrieved from the database towards the Unity application to provide the information to the user. Additionally, the user can update the information through the GUI and send it back to the database. Both the consultation of information and the analysis process are carried out through the graphical, user-friendly interface, which simulates the tasks of observation and analysis of the archaeological process.

Data acquisition and storage
The terminology and data types used in this project are based on the excavations carried out on the Iberian-Roman city of Castulo (38 ∘ 02 ′ 10 ′′ N, 3 ∘ 37 ′ 26 ′′ O), one of the most important capitals in southern Spain during Antiquity. Castulo was originally the center of the Iberian Oretania and it later turned into a Roman city. The archaeological site contains other settlements from the Prehistory to the Late Middle Ages, which complete the historical value of this archaeological area. This complex stratigraphic and temporal sequence, which remains in our time with exceptional integrity and preservation conditions, constitutes a significant segment of the whole history of the Spanish region of Andalusia. Archaeologists working on Castulo use the following concepts to organize the information from the site: An Archaeological Site is a location where archaeologists decide that there are interesting remains to be explored and discovered through excavation (Fig. 2a). The usual way of working on an archaeological site is through excavation Campaigns that have a given start and end date. Each campaign can have different duration. In order to organize the space in an archaeological site, the archaeologists define Areas. Each area is a closed superficial perimeter that encloses excavation activities. Inside an area, a variable number of Volumes can be defined (Fig. 2b). A volume not only comprises a closed superficial perimeter, but also the ground below. As the soil from the volume is removed, the archaeologists identify Layers or stratigraphic units (Fig. 2c), determined by relevant changes in the ground (different composition, color, materials found, dating of the discoveries, etcetera).
As shown in Fig. 2, some of the concepts described are represented by 3D models. Volumes are prisms, geometric objects obtained from the UTM coordinates stored in the database. Stratigraphy, however, is presented as the resulting 3D model of the scan performed at the end of the excavation of a stratum (that is, when the base of a stratum is reached after removing its ground). Then, we take advantage of the agile and cheap techniques of acquisition of current smartphones. In particular, we used the ToF (Time of Flight) sensor of a mobile device. This technology measures distances by means of a modulated light source similar to a laser, and a sensor that captures the reflections of this light from the objects. The 3D model of a surface of about 2m 2 is obtained in only a few seconds with this technology. The final model is obtained instantly, and no post-processing is necessary. Mobile applications like 3D Live Scanner 1 , allow acquiring 3D models using this technology, including both geometry and texture. Figure 3 shows an example of a model captured with this application. Then, the archaeological site can be recreated virtually. The finds, once extracted, are cleaned and scanned individually before being relocated at The main data entities of the spatial database are depicted in the design of Fig. 4. As stated above, an area can include several volumes. As a volume is excavated, different stratigraphic units are identified and stored in the database. As shown in the figure, each stratigraphic unit record stores an identification number, the reference to its 3D model and also the information of those units above and below itself. This allows preserving the stratigraphic sequence, and enables both querying and visualization operations of the stratigraphic units, as will be discussed in the following sections.
The Element records represent any type of find obtained during the excavation (for example: ceramics, bones, tools, etcetera). Each element is associated to a stratigraphic unit, more specifically, to a deposit. As can be seen in Fig. 4, there are two types of stratigraphic units: deposits and interfaces. According to Harris, these are the two main forms of stratification units. In our design, they both inherit from Strati-graphicUnit the common attributes of any unit, such as its identification and virtual 3D representation (original_mesh). In addition, it is also stored those connections of each unit with the ones above and below, so that stratigraphic information is integrated into the database. The way of querying this information is twofold, through interaction with the graphical interface or through SQL queries.
There are two types of stratigraphic units in our database: deposits and interfaces. According to Schiffer (1987), a deposit is defined as a three-dimensional unit that can be distinguished in the field on the basis of the observable changes in some physical properties. In order to preserve the threedimensional nature of the deposit, the heights of the base and top of the deposit are stored. This information, together with all the attributes inherited from StratigraphicUnit, make up the deposit record. Therefore, a deposit represents all the 3D space between two consecutive base layers represented by their 3D models. There are two types of deposits (identified by different values of the type attribute): horizontal and vertical. The former represents the natural disposition of the ground when gravity acts, which tends to create horizontal  layers; the latter are normally human-made and are typically considered as walls. Adding 3D models of finds into the deposits from which they were extracted complements the stratigraphic information. The realistic visualization of this information can be of great help for advanced analysis.
The second type of stratigraphic units are interfaces, created by the destruction of an existing stratum and not by its deposition. Likewise deposits, interfaces can also be horizontal or vertical. Vertical interfaces are typically ditches, pits, graves, postholes, etc. On the contrary, horizontal interfaces are associated with upstanding strata and mark the levels to which those deposits have been destroyed. They are created, for example, when a wall decays and falls down, or when a building is partially demolished during alterations (Harris 1989). As feature interfaces represent destruction, they are not associated with a 3D volume, but with a surface. In our database design, interfaces inherit all their data fields from StratigraphicUnit, except for their type (vertical, horizontal), which is a specific field of this entity. The 3D model associated with an interface is the same as the one scanned during the excavation; however, for better understanding and visualization, it is treated in a different way: while 3D models associated with deposits maintain the real texture and shape, the models associated with interfaces are represented with the same shape but plain color (green or red) to highlight those destructive processes. Traditional stratigraphic drawings, as well as modern software tools, usually show interfaces in a different way. The "Results and discussion" section shows an example of 3D stratigraphic representation supported by this database.
The database also stores information for data processing based on topological criteria (Fig. 5a). Grosso modo, for each pair of elements, this information consists of three 3x3 matrices obtained by application of the Dimensionally Extended 9 − Intersection Model (DE-9IM) (Clementini et al. 1993;Clementini et al. 1994) to the 2D projections of their 3D models into the XY, XZ and YZ planes of the scene, using a distance threshold. Computing these matrices is one of the features provided natively by the database engine used (PostGIS, as mentioned in the System overview section), and allow filtering pairs of finds that could be somehow related, given their proximity when they were discovered (see Ortega et al. 2020 for more details). The historical dating system in the database design is inspired by Belussi and Migliorini (2017) and allows storing dating information in two different ways, depending on the archaeological site and find features, as Fig. 5b shows. When a find has a more or less exact dating (because it has been empirically determined or, for example, it has some type of engraving that allows determining it), one or several Calen-darDates can be assigned to it. On the other hand, those finds that can only be classified into a chronological era (an Egyptian dynasty, for example), are assigned an EraDate. The start and end of an EraDate can be set more or less precisely, as it is not compulsory to fill in the day, month and year.
Finally, there is also the excavation dating system, that allows storing a timestamp for each record as they are created during the excavation (Fig. 6). This allows us to easily revise the chronological evolution of the excavation process.
This database design is definitely oriented to enrich the interconnection of information by means of a virtual reconstruction of the archaeological site. Spatio-temporal information and the elements conforming the virtual scene are interconnected, and these relationships can be displayed through the GUI. It is therefore a matter of semantically enriching the models and complementing the chronological relationships of the Harris Matrix.

4D stratigraphy management system
Our proposal for an interactive 4D graphic application allows archaeologists to easily browse through the information stored in the database, without the need to create complex queries using languages like SQL. The interface is organized around a 3D view with which the user can freely interact and navigate, since it has been built on the foundation of the Unity game engine. Figure 7 shows the main screen of the application and its controls. Clicking on any of the highlighted areas on the site results in "opening" that area, and the volumes it contains are shown (Fig. 2b). In a similar way, clicking on a volume "opens" a view of the stratigraphic units contained in that volume (Fig. 8).
As stated above, a 3D surface model is stored for each stratigraphic unit. These models can also be viewed in isolation, selecting only the deposits or the interfaces (Fig. 9), or even both at the same time.
"Opening" a deposit allows viewing the 3D models of the finds whose locations have been registered in the database, as reviewed in the "Data acquisition and storage" section ( Fig. 10).
All the information shown in the application is retrieved from the database server at the moment it is requested through the interface. This allows working with updated information all the time.
In addition to the 3D visualization, it is also possible to query the database for the alphanumeric information related to all the data entities (areas, volumes, stratigraphic units and individual finds) through a mouse click. Moreover, the stratigraphic information about the units above and below the queried one is also shown, making the study and understanding of the stratigraphic sequence easier (Fig. 11).
As the database allows recording dating information in two ways (historical dating and excavation dating), it is possible to filter the data that is shown at any time using one or both of these criteria. The filtering is done through slider controls that allow reducing the time span to be applied in the query to the database (Fig. 12).
Focusing on the dating information, using this filtering feature allows a clean and seamless way to review the stratigraphic sequence, either based on the historical dating (typically set once the whole set of finds have been analyzed) or the excavation dating. This, together with the possibility of examining in 3D the terrain models obtained during the excavation, makes up a powerful tool to study in 4D the stratigraphy of a given archaeological site (Fig. 13).

Results and discussion
In this section we discuss how to work with the stratigraphy by managing the information system presented in the paper. We have represented a simple synthetic example covering both types of strata, deposits and interfaces, and also considering if they both are horizontal or vertical.  Figure 14a shows this example in which the labels associated with them (StratigraphicUnit::id in the database) have been superimposed. The associated Harris Matrix diagram is depicted in Fig. 14b. It can be seen that the 3D view of the strata provides an intuitive representation of stratigraphy that complements the HM diagram. It is interesting to make the stratigraphic sequence more understandable when working in multidisciplinary teams, which are increasingly frequent in large archaeological projects.
As stated in the "4D stratigraphy management system" section, the graphical interface provides new functionality for working with stratigraphy. The three-dimensional scene describes itself the spatial arrangement of strata layers and findings. Additional capabilities to manage time are configured to configure a 4D system. This virtual representation is useful to preserve the site once it has been excavated. Moreover, in those cases with a simple stratigraphy, the observation of the scenario may suffice for its study. In complex cases, this complements the Harris matrix. Additionally, the 4D system allows to lighten the time to perform the registration. A complete stratigraphical record is normally composed of four sections, as well as additional drawings of plans associated to each stratum. This is hard work that needs a lot of time, which often conflicts with the duration of the campaigns. This technology is then focused on streamlining the archaeological work, especially in those campaigns where there is a time constraint.
The graphical interface also helps in the way of querying the database. The virtual scene can be observed from any position. The base of each stratum has real appearance, preserving its three-dimensional shape, aspect and orography. Fig. 13 Filtering data by their dating information allows reviewing the stratigraphic sequence of the archaeological site Even topographic and topological constraints of the site are preserved. But in addition, the spatial database stores the relationships between layers indicating the stratigraphic units above and below. The principles of superposition, original horizontality, lateral continuity and stratigraphic succession are present and inherent in the way the information is presented. Deposits are also clearly differentiated from interfaces, so it may be considered a complementary methodology for working with stratigraphy. Figure 14 represents an example with the two versions of stratigraphy representation. The Harris Matrix is defined using the software HM Composer. Even for a simple example, the HM can be a very large scheme that is normally presented as a separate document or file. Many authors have modified and made extensions of HM for adding dating or finds in the strata. In summary, this integrated information system provides the desired capabilities that benefit most phases associated with Archaeology, from acquisition, registration and spatio-temporal analysis.
Furthermore, there is a bidirectional communication between the GUI and the information system. Any interaction with the elements in the scene causes a call to the database in order to obtain the rest of the information, as depicted in Fig. 11. This goes in relation of adapting the software tool to the archaeological work, otherwise archaeologists may be overtaken by technology if they do not consider it intuitive, or see it as alien to their methodology. Software must be adapted to archaeology methodologies and not vice versa, by means of user-friendly interfaces and the replication of their procedures as far as possible.
In any case, as in any spatio-temporal information system, advanced SQL queries can be carried out. It is not really necessary in this particular case because the same result can be achieved through the GUI, but it could be interesting for specific reports. We describe now an example considering at the same time the material of the vestige, the historical period to which it belongs, the time of discovery and the stratigraphic relationships. For example, given this statement: Show all the pottery pieces from the Roman Age that were found between June 6th, 2020 and June 7th, 2020 in the layer above the one that contained the piece with code 12345AB, together with the pieces that are likely to be related to them.
The SQL sentence to find the vestiges that meet these conditions is: In the example, we search for pieces above the layer containing the piece with code 12345AB. For that purpose, we first search for the layer that contains the referred piece. SQL sentences allows advanced queries or analysis; however, the most intuitive way of working is through the graphical environment connected bidirectionally to the spatio-temporal database. Figure 15 shows the result of this search.
This 4D system implies a change in the modus operandi regarding traditional methodologies, as Tables 1 and 2 show. When referring to traditional methods we also include the use of digital forms and databases but without the capabilities associated with and integrated system with 3D graphical user interface. Even though the change in these procedures is evident, there is a close relationship between them, and above all, a clear improvement in locating and analyzing information. Table 1 describes the finding and recording phase. The fundamental difference is in the way the information is captured, now based on the scanning process rather than on drawings or photographs. After the scan is performed, the 3D model is uploaded to the system. Table 2 reflects the way in which information is analyzed once it is integrated into the system. In the 4D integrated system this is also performed (but not necessarily) in the laboratory. In this latter case, the actions are: navigation in the 3D environment and clicking on the objects. The first action (Observe the excavated stratum) provides access to the stratum under study. Fig. 15 Top: view of a volume made of five layers. Position of the elements are marked with red dots. The element that is used as a reference for the example query is marked. Bottom: result of the example query Then, the view of the layer is depicted. Once there, actions are developed on the same scene by clicking on the finds with specific key combinations. In any of the two methodologies the HM diagram is present. Depending on the specific type of analysis or stratigraphic complexity, the HM may be used or not.
Finally, even though we have argued the numerous advantages of using the proposed technology, there are some issues to be considered. In general terms, archaeological excavations Table 1 Discovering and recording a relevant find/ stratigraphic unit using traditional methodologies vs proposed methodology. The actions described in italics are carried out on the site Table 2 Examples of analysis operations using traditional methodologies vs proposed methodology already in progress can have difficulties to be adapted to this methodology, specially in case the excavated strata have not been previously scanned. At least, the 3D model of the base of each stratum must be obtained during excavation to provide future stratigraphic analysis. This makes this technology more suitable for new excavation projects.
On the other hand, it is not easy to substitute the representation of relative chronological relationships provided by the Harris Matrix. This is indisputable in archaeological sites with complex stratigraphy. These cases also require many scanned models which could slow down the performance of the system. This delay is mostly due to the communication between client and server to transfer the models bidirectionally. It may also depend on the memory and graphics card capacity of the client device. For this reason, we have implemented some additional mechanisms to partially reduce these problems. In the analysis phase, made on the client side, the 3D model is retrieved from the server only the first time. Then, it is stored as a Unity asset on the client for further queries, reducing the data load on the network.
Another mechanism has also been considered to improve the client's capability for displaying those 3D findings associated with the layers. It consists of providing two different models of each scanned find. If an accurate visualization is required, the application can provide the richest model. This is specially useful, for instance, to remotely observe inscriptions or drawings on the finds, or for collaborative work. These models are replaced by others with less geometry when visualizing the whole stratum or the topological relationships of findings. The example of a scanned ceramic piece of Fig. 16a and b shows the original model. On the bottom, Fig. 16c and d depict the reduced model with only 1.5% of triangles. This reduces drastically the loading time between client-server; however, the textured models are very similar ( Fig. 16b and d respectively). A complete layer scene with 20 models and 48 ⋅ 10 3 triangles requires around 12 seconds to be loaded and displayed. Going beyond, a general view of an entire volume can replace the 3D models of finds by points representing their positions (as in Fig. 8). Regarding 3D models of strata, reducing triangles of the scanned layers is normally not necessary since Tof technology provides simple models. The example of Fig. 3 has 3.962 triangles and 7.457 vertices. However, in case of complex stratigraphy, they can also be reduced or simply be replaced by geometric volumes, each of them including several stratigraphic units. Any click on these bounding volumes provides detailed visualization of the specific desired strata.
Another issue that must be addressed is the paradigm shift in the modus operandi by using this technology. On occasion, this has led to a change in the way of working on an excavation, as Tables 1 and 2 reflect. For some time now, this discipline has been both benefited and overwhelmed by technology. An example of this is the capability of LiDAR sensors for detecting hidden features under the tree canopy or the sands of the desert. However, this forces work teams to become increasingly interdisciplinary. The scientific community has taken notice of this change with the appearance of new journals and numerous papers explaining specific technologies used in many different excavations. Future in Archaeology is yet to be written, but it will undoubtedly be overrun by technical innovations. However, we think that such tools and techniques must have at least, the capabilities developed in this proposal: they must be integrated into a single system, must be collaborative and remotely accessible, use friendly interfaces based on a virtualization of reality, and definitely, bring new technologies closer to the archaeological method and not the other way around. Definitely, these must facilitate work and excavation times. On the other hand, a period of adaptation to these new methods could be necessary.

Conclusions and future work
This paper describes an interactive 4D system that integrates all the information associated with an archaeological excavation including stratigraphy. Using agile and affordable technologies available in smartphones, the 3D configuration of the site is recorded during excavation to obtain a virtual archaeological site recreation. Visualizing the 3D site as if the soil around the finds had disappeared, while preserving the original layout, is one of the greatest advantages of this integrated 4D system. The scene can be observed from any viewpoint and the spatial database can be queried by clicking on the virtual finds. Moreover, stratigraphy can also be viewed together with the findings, placing them in their original positions and orientations. In fact, these capabilities provide advanced analysis possibilities. Additional tools such as temporary scrollbars make it possible to consult the stratigraphic succession in a simple and intuitive way. Certain temporal analysis processes can be carried out directly with this application, and in general it complements the information provided by the Harris Matrix. The main aim is to facilitate the work methodology and make it more agile and effective while reducing associated times.
Once the methodology and IT system has been developed, the next step is to test it on a real excavation. The artifacts used in this paper are mostly from the archaeological site of Castulo, while others correspond to artifacts with which the students of the Archaeology degree of the University of Jaén are working. However, stratigraphy has been virtualized using synthetic models, since we do not currently have access to a real site to carry out the entire capture process over several campaigns. In order to record the complete stratigraphy, or at least an important part of it, we are in contact with the scientific community in archaeology to put it into practice in the near future. In any case, and until new standards are created, this type of software tools should be complementary and a support for archaeological works. Future work will also include the addition of new chronological relationships and new functionalities in the interface to increase and facilitate the capacity for temporal analysis. as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.