2.2.1. CoordFinder Algorithm
One of the main features of GOGIRA is the capability to find the cartographic coordinates of a physical target in the landscape. This is the role of the CoordFinder algorithm, developed in the Python programming language.
For the structure of the algorithm itself, all cartographic coordinates are expressed in the WGS84/UTM reference system, this is necessary because the software requires metric rather than angular coordinates. Considering that the field test area is in northwest Italy, the coordinate system chosen was the WGS84/UTM Zone 32N.
Inputs required are (i) the global cartographic coordinates of the mapper in WGS84/UTM Zone 32N, (ii) the local spherical coordinates of the target as azimuthal and zenithal angles (A), (iii) a DTM covering the area of the mapping survey, (iv) DTM resolution [m] and (v) extent in WGS84/UTM Zone 32N.
The operating principle of the algorithm is based on the intersection of the “Line Of Sight” (LOS) projected by the mapper’s position coordinates through the sighted target (
Figure 2A,B), with the DTM virtual land surface (
Figure 2C).
LOS is first calculated on the 2D horizontal plane (Equation (1)). The target point is projected onto a circle with (i) the East-North mapper coordinates as origin, (ii) arbitrary radius, and (iii) rotated clockwise from north by the azimuth angle (
Figure 2A,B). The “m” hLOS
N coordinates are calculated for the “n” hLOS
E values, where “m” and “n” are respectively the north and east size of DTM. tc
(E,N) are the east and north target point coordinates on the horizontal circle; mp
(E,N) are the mapper east and north coordinates.
The vertical component of LOS (vLOS) is calculated similarly to hLOS. The target point is projected on a semicircle with: (i) origin set to x = 0, and y = “mapper elevation”; (ii) arbitrary radius; (iii) counterclockwise rotation from the horizontal by zenith angle (
Figure 2C). The vLOS
Z straight-line is calculated for the “x” vLOS
X values (Equation (2)), where “x” corresponds to hLOS
E number of values. tc
z,x are the elevation and distance target point coordinates on the vertical semicircle; mp
z is the mapper elevation coordinate.
A topographic profile (
Figure 2C) is made using DTM elevation data along hLOS
N(E). The starting point is the mapper position, and the end point is the last pixel of the DTM along the profile line.
The difference between elevation values of vLOSz and topographic profile return the “delta” curve. The first minimum value, excluding the mapper position, is the intersection point between LOS and DTM, this point corresponds to the target sighted. From the target cell indexes and the DTM’s georeferencing matrix, cartographic target coordinates are obtained in WGS84/UTM Zone 32N.
The CoordFinder algorithm is iterated for each target point of a mapped geomorphological shape, returning a list of georeferenced coordinates that are saved to a text file (.txt) in Well Known Text (WKT) format [
29]. WKT is an Open Geospatial Consortium standard to represent spatial data in a textual format and the QGIS import procedure is quite simple and fast (see
Section 2.3.4). Moreover, attributes such as morphogenetic agent and geomorphological shape code can be saved in the same text file in Comma Separated Values (CSV) format. It is possible to distinguish attributes from geometry in the import procedure, described in
Section 2.3.4 for QGIS 3.16.
It is essential to highlight the importance of the cartographic reference system chosen for the algorithm. The UTM system is a metric reference system, which is fundamental for the calculus of the algorithm itself. To test CoordFinder in a different region of the globe where other reference systems are needed, one must use a metric reference system for all the georeferenced data of the project.
2.2.2. Tools
DNC need tools to transpose 3D real-world objects into a 2D digital map representation [
7]. In the GOGIRA system this can be done using MARVIN CU with UGO and Range-R spherical coordinate acquisition devices.
UGO and Range-R are prototypes based primarily on Open-Source (OS) technology [
30]. This allows for easy development and modification of the devices with low-cost sensors and components. Both devices were developed using a Arduino Nano board (
Table 1), a robust OS microcontroller board for reliable electronic project development [
31,
32,
33,
34,
35,
36]. It mounts the ATmega328 microcontroller and has a series of analog and digital input/output pins, as well as a useful I2C (Inter Integrated Circuit) and SPI (Serial Peripheral Interface) communication protocol, which allows interfacing various sensors. For both devices, the software was developed with the C++ programming language. Third-party software libraries were used to interface the OS Arduino Software IDE (Integrated Development Environment) and the Arduino microcontroller (
Table 2).
UGO was designed to be cheap and reliable; it is a tripod-based device that can obtain measures of azimuth and zenith angles of a real-world sighted target (
Figure 2). Components are chosen to be inexpensive and reliable to create a simple yet robust device to solve a single task with minimum waste of resources. The components list is:
n° 2 Rotary potentiometer;
n° 1 Rotary encoder;
n° 1 HC-05 Bluetooth module;
n° 2 Arduino Nano microcontroller;
n° 1 MPU6050 Inertial Motion Unit (IMU);
n° 1 SSD1306 OLED display;
n° 1 SD-card module;
n° 1 Toroidal bubble-level;
n° 1 9-volt battery cell;
n° 1 Red-dot optical sight;
n° 1 Tripod.
A fixed, static body is mounted on the tripod. The main body can twist around a rotational axis orthogonal to the horizontal plane. All electronical components, a toroidal bubble-level, and a 9-volt external battery cell are mounted on the main body. The optical sight twists around a second rotational axis perpendicular to the first one and jointed to the main body (
Figure 3).
The working principle is simple: the optical sight twists around the horizontal axis (±50° from horizontal) and the vertical axis (300° ± 10°). Angle values (in degrees) are calculated by the product of voltage values read on the rotary potentiometer’s pins, and the conversion factor specific for each resistor (
Figure 4).
Two Arduino Nano boards were wired in serial SPI communication to extend the total memory available; this was necessary because of their small RAM (
Table 1), and the total memory required by the software and modules. The “master” Arduino board is responsible for the angle data read, the user input commands and the control display. The “slave” Arduino board receives the data from the “master”, saves it on an SD card as a new record in “.txt” format, and sends it to MARVIN CU using the HC-05 Bluetooth communication module.
For UGO’s calibration procedure (see
Section 2.3.1), a double system was performed: the analog toroidal bubble-level and the digital system based on MPU6050 6-axes IMU. The MPU6050 calibration was made for the specific chip mounted on the prototype (
Figure 5A,B). Pitch and roll angles are evaluated using a Kalman filter that combines accelerometric and gyroscopic values in a fusion-data algorithm [
51].
Range-R is a device thought to solve a similar task to UGO but with significantly different features. Instead of azimuth and zenith, Range-R obtains heading angle (direction from magnetic north) and pitch angle (inclination of sight axis with respect to the horizontal plane) of the sighted target. With the BNO055 sensor data, a Nine Degree Of Freedom (NDOF) system [
52] was made. This allows for free movement of Range-R in the 3D space, and no tripod is required as is the case for UGO. The component list is quite simple and consists of:
n° 1 Arduino Nano microcontroller;
n° 1 BNO055 Attitude and Heading Reference System (AHRS)
n° 1 SSD1306 OLED display;
n° 1 HC-05 Bluetooth module;
n° 1 optical sight 10x zoom;
n° 1 9-volt battery cell.
The BNO055 allow to provide an AHRS (Attitude and Heading Reference System): the triaxial magnetometer, gyroscope and accelerometer values are processed by the fusion-data built-in algorithm [
53] to obtain pitch, roll and heading (
Figure 6) values. The fusion-data algorithm is “Bosch Sensortec”, a proprietary software wherein source-code is unavailable, so it was used as “black box” providing output heading, pitch, roll and calibration status.
Sensor calibration (see
Section 2.3.1) requires only a few seconds. Gyroscope and magnetometer calibration is easy, but the flat horizontal surface required for accelerometer calibration (
Figure 5A) can be difficult to find in natural environments. To overcome this problem, the calibration procedure was performed during the device assembly phase and offset values (
Figure 5C) are set automatically without further procedures by the user. Calibration status is given by BNO055 internal software as a numeric variable from “0” (system is non-calibrated) to “3” (fully calibrated) for each triaxial sensor, and for the whole system (
Figure 6). If any values fall to “2” or below, calibration is required to obtain better data accuracy. This often happens for magnetometers when magnetic/ferromagnetic or electronic devices are brought close to the BNO055 sensor.
Data read from BNO055 by the Arduino Nano microcontroller are displayed on an OLED screen and sent to MARVIN through the HC-05 Bluetooth module. Local backup is not yet implemented because of the Arduino Nano RAM limitation (
Figure 6), and the device is too small for a double Arduino board solution, as for UGO.
To collect the spherical coordinates measured by UGO/Range-R, the MARVIN Android application was developed with “MIT App Inventor”, an online development platform that uses a block-based programming language [
54,
55]. The MARVIN Graphic User Interface (GUI) was built to easily allow the addition of information about morphogenetic agents, shape type, and the cartographic coordinates of the mapper (WGS84/UTM Zone 32N).
Furthermore, it is possible to see the collected data in real time, to save the mapped shapes or to delete wrong shapes. Every record is related to a single geometry and its attributes, the format adopted is the CSV and the geometry is expressed as Well Know Text (WKT) format. The saved data are stored in three text files (.txt) located on a smartphone’s internal memory, named as the WKT geometry type. Every record was saved in the proper file to separate point, linear, and polygonal geometries.
For the acquisition of measuring station coordinates, both for UGO and Range-R, a Garmin eTrex 20x single frequency GNSS receiver was used. Data was manually insert in MARVIN for each measuring station. This function will eventually be implemented directly on the devices to simplify the mapping procedure and ensure reliability, especially for Range-R which can be used dynamically without a ground-fixed tripod, as is the case for UGO.
The mechanical body structure of UGO and Range-R were an ad hoc design using “Autodesk Fusion 360” CAD (Computer-Aided Design) software and made with an “Ender 3 Pro” 3D printer.
Finally, a semi-automatic import procedure and geomorphological legend is still being implemented [
56]. It counts 61 forms of 7 morphogenetic agents (
Table 3) following the “guidelines for geomorphological cartography” published by ISPRA (Istituto Superiore per la PRotezione Ambientale) [
57]. The symbology chosen is just a part of the whole legend cited, the selection was closely related to the geomorphological elements expected to be found during the case-study fieldwork related to the purpose of the current paper (see
Section 2.4).
In order to simplify the ISPRA proposed multiscale approach [
57], only one geometry type for each legend element (point, line or polygon) was selected. The choice was made because the devices’ maximum range does not allow for mapping all the geomorphological scales. Although this simplification has the disadvantage that the possibility of mapping geomorphological elements on very different scales is lost, it was not considered influential for the present work. Since one cannot use the GOGIRA system for mapping large-scale areas from only one measuring station, the mapper must change location to obtain a proper LOS. Furthermore, it is important to remember that the main purpose of the GOGIRA system is the mapping of real-world elements from a mapper’s direct observation and provides an ability to detect small geometries which are difficult to identify on a DTM hillshade, topographic map, or satellite imagery, making GOGIRA useful for highly detailed NC.
The import procedure is very simple and uses the “Add Delimited Text Layer” QGIS import layer option, a function that allows the import of WKT shapes and relative attributes from a CSV file. Following a simple procedure (
Section 2.3.4), it is possible to automatically apply the symbology categorization prepared ad hoc for the GOGIRA system. For this purpose, a library [
56] was made for the symbols chosen using automatic symbol orientation and “geometry generator” such as for landslide or conoid flow direction.