scieee AI-readable full text Open interactive document viewer

Análisis de trayectorias GPS de senderismo en función al terreno

Caelles Codinas, Pau

Abstract

L'àmbit de les direccions generades automàticament ha experimentat avenços notables, principalment en entorns urbans i interiors, però no tant en el context de les rutes de senderisme. Els reptes de navegació en terrenys naturals impulsen l'exploració de solucions innovadores per generar instruccions verbals precises i personalitzades. Aquesta investigació aborda els reptes de generar automàticament instruccions verbals per a rutes de senderisme a partir de dades geomètriques, centrant-se en la centralitat de la trajectòria d'una ruta de senderisme dins d'una regió del terreny. L'estudi explora diverses mesures dissenyades per calcular com es relaciona una trajectòria amb la porció de terreny que travessa, anomenades Mesura de la Vora, Mesura dels Pesos, Mesura de l'Àrea, Mesura de Fréchet i Mesura de Dynamic Time Warping. Mitjançant una àmplia experimentació, DTW emergeix com el mètode òptim constantment per avaluar la centralitat del camí.

Full text

id184237   ANÁLISIS DE TRAYECTORIAS GPS DE SENDERISMO EN FUNCIÓN AL TERRENO PAU CAELLES CODINAS Thesis supervisor: RODRIGOIGNACIOSILVEIRA(DepartmentofMathematics) Thesis co-supervisor: FABIANMAXIMILIANKLUTE(DepartmentofMathematics) Degree:Bachelor'sDegreeinInformaticsEngineering(Computing) Bachelor's thesis Facultat d'Informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) - BarcelonaTech 23/01/2024  L’`ambit de les direccions generades autom`aticament ha experimentat aven¸cos notables, principalment en entorns urbans i interiors, per`o no tant en el context de les rutes de senderisme. Els reptes de navegaci´o en terrenys naturals impulsen l’exploraci´o de solucions innovadores per generar instruccions verbals precises i personalitzades. Aquesta investigaci´o aborda els reptes de generar autom`aticament instruccions verbals per a rutes de senderisme a partir de dades geom`etriques, centrant-se en la centralitat de la traject`oria d’una ruta de senderisme dins d’una regi´o del terreny. L’estudi explora diverses mesures dissenyades per calcular com es relaciona una traject`oria amb la porci´o de terreny que travessa, anomenades Mesura de la Vora, Mesura dels Pesos, Mesura de l’` Area, Mesura de Fr´echet i Mesura de Dynamic Time Warping. Mitjan¸cant una `amplia experimentaci´o, DTW emergeix com el m`etode `optim constantment per avaluar la centralitat del cam´ı. 1 El ´ambito de las indicaciones generadas autom´aticamente ha experimentado avances notables, principalmente en entornos urbanos e interiores, pero no tanto en el contexto de las rutas de senderismo. Los desaf´ıos de navegaci´on en terrenos naturales impulsan la exploraci´on de soluciones innovadoras para generar instrucciones verbales precisas y personalizadas. Esta investigaci´on aborda los desaf´ıos de generar autom´aticamente instrucciones verbales para rutas de senderismo basadas en datos geom´etricos, centr´andose en la centralidad de la trayectoria de una ruta de senderismo dentro de una regi´on del terreno. El estudio explora varias medidas dise˜nadas para calcular c´omo se relaciona una trayectoria con la porci´on de terreno que cruza, denominadas Medida del Borde, Medida de los Pesos, Medida del ´ Area, Medida Fr´echet y Medida de Dynamic Time Warping. A trav´es de una extensa experimentaci´on, DTW emerge como el m´etodo consistentemente ´optimo para evaluar la centralidad de la trayectoria. 2 The realm of automatically generated indications has witnessed notable advancements, principally in urban and indoor environments, but not so much in the context of hiking routes. Navigational challenges in natural terrains prompt the exploration of innovative solutions for generating accurate and personalized verbal directions. This research addresses the challenges of automatically generating verbal directions for hiking routes based on geometric data, focusing on the centrality of a hiking route’s trajectory within a terrain region. The study explores various measures designed to calculate how a trajectory relates to the portion of terrain it crosses, named the Border Measure, the Weights Measure, the Area Measure, the Fr´echet Measure, and the Dynamic Time Warping Measure. Through extensive experimentation, DTW emerges as the consistently optimal method for assessing trajectory centrality. 3 Contents 1 Context 5 2 Background 7 3 Scope and obstacles 8 4 Methodology and monitoring 10 5 Project planning 11 6 Budget 15 7 Sustainability report 18 8 Problem definition 19 9 Centrality measures 23 10 Implementation 29 11 Experimentation 32 12 Conclusions 45 13 Future work 46 4 1 Context 1.1 Introduction Mountain routes have always captivated explorers, offering a challenge and a way to connect with nature. As a hiker starts following a new route, the need for accurate and efficient navigation becomes obvious. The most straightforward method is to follow a map and a route, but it is often more natural to directly receive spoken or written directions from the hiker’s point of view. Often, we can get spoken directions from someone familiar with the route or maybe from someone coming back from the destination of our route who can guide us. Sometimes, we might find them written in a hiking blog or even in an old hiking diary. However, what if there are no verbal indications at all for a specific route? Could we get them somehow? The solution might come with the “Hiking Directions from Geometric Data” (HDGD) project from the UPC Research Group on Discrete, Combinatorial and Computational Geometry (DCCG). The HDGD project, from which this work is born, aims to design and develop a way of generating verbal directions for a route automatically from a given terrain map of the area and the trajectory of the route. It might seem that just a terrain map and a route don’t offer enough information to generate a whole set of reliable verbal indications. However, the reality is that there is a lot to deduct from the way a hiking path relates to the terrain it’s traversing, and this is going to be our focus in this project. To automatically give directions based on how the hiking route relates to the different regions of terrain it traverses, first, it is necessary to concisely identify how the trajectory relates to each one of the regions and then quantify that relation. That is not a trivial task, although it may look like it. Given the infinitude of shapes a region and a trajectory can adopt, defining a measure that works universally becomes a tricky task. In this project, we will explore this problem and design, implement, and test several measures that quantify the crossing of a hiking path through a terrain region. Figure 1: Example of contour map. In colors, the different types of regions. In black, the hiking route 5 1.2 Problem overview The automatic generation of indications for a hiking route given a terrain map and a hiking route is not a straightforward task. Us humans, we often use expressions like “walk across this plain” or “walk along the shore” when giving indications, and these cannot be directly generated from a terrain map and a path. In order to generate these kind of indications automatically, we first need to translate the relation between the region and the path to a numerical value, quantify it. Our goal is to obtain one or more measuring techniques that return, consistently, a high value if the path crosses the region through the center, a low value if it travels along the boundary of the region or doesn’t traverse it at all, and anything in between. To be able to work effectively with terrain regions and hiking paths and obtain a numerical value representing their relation, it is convenient to discretize the problem. We will represent the terrain region with a polygon, and the route with a polygonal line. The value representing the crossing of the line through the polygon will be bounded to [0,1]: 0 if it travels along the border and 1 if it crosses through the middle. 1.3 Stakeholders The solutions developed are aimed, first of all, at the HDGD project. In order to generate correct descriptions for hiking routes, it is necessary to have a reliable way of measuring the relation between the routes and the regions they traverse, so the group working on the HDGD project has an interest in the work on this thesis. Secondly and indirectly, the developed solutions are aimed at companies or teams that want to integrate the automatic generation of instructions in natural language for any hiking route tracking application. When they use the automatic generation of hiking directions in natural language, they will be using the measure or measures studied here so, indiretly, they have an interest in this work too. 6 2 Background The objective of this work, as already mentioned above, is to find solutions that allow us to consistently measure the relation of a route with the region it traverses with the idea of later automatically generate a series of instructions in natural language. Within the scope of the HGDG project, there is already considerable research into the automatic generation of route descriptions in natural language. Most of the research, however, focuses on the automatic generation of directions for urban routes or inside buildings (Rousell & Zipf, 2017)[8]. Some examples are the automatic generation of directions on subway routes (Fraczak & Lapalme, 2002)[4], or the automatic generation of indications on emergency exit routes inside buildings for blind people (Wang et al., 2012 )[10] There is relatively little research related to the automatic generation of directions on hiking trails. One of the related papers deals with precisely the opposite case to ours; the generation of schematic maps from a textual description of a hiking route (Belouaer et al., 2016)[1]. Figure 2: Schematic map of a natural environment generated from verbal route descriptions Regarding the specific scope of this TFG, that is, the design and implementation of solutions to identify and quantify the relation between a hiking path and the terrain region it crosses, there is no related research done or at least published. It is expected that most solutions will have to be designed from scratch, rather than extracted from or based on related works. There is some research, however, on understanding landmarks, route description and hiking, like the work of Kettunen et al. from 2013[7], that investigated the ways in which people perceive and remember landmarks in nature with the aim of accurately selecting them when creating maps or route descriptions. 7 3 Scope and obstacles Once the problem to be addressed has been contextualized, it is necessary to define the real scope involved in solving it. In this section, both the generic objectives and the corresponding sub-objectives will be defined. Finally, various obstacles and risks that may interfere with the success of the project will be analyzed. 3.1 Objectives The main objective of this TFG is to find solutions that allow to identify and quantify the crossing of a hiking route through the terrain region it traverses from the viewpoint of computational geometry. The solutions designed should return, ideally, satisfactory values for any combination of a trajectory and a terrain region, represented as a polygonal line and a polygon, while following a series of properties that we will see in subsequent sections. This main objective can be divided into several sub-objectives, listed below: •Criterion definition: Rigorously define the way to decide if a path “crosses” or “travels along” a polygonal region; define a criterion to quantify the extent to which a polygonal line passes through the middle of the region or the edge. •Algorithm design: Design robust and efficient algorithms that offer us consistent results and adapt to the wide range of complexity of the starting data, e.g. polygonal lines that self-intersect. •Implementation of the algorithms: Implement the corresponding algorithms in code for the subsequent experimentation. 3.2 Requirements In addition to the main objective and the sub-objectives, a series of non-functional requirements will be taken into account: •Flexibility and extendability: The proposed solutions must be flexible and easy to extend if the needs of the project require it, either because new functionalities are added or because the precision of the route analysis is desired. •Accuracy: In this work it is expected that the results will be satisfactory in enough of the cases to automatically create a reliable series of route directions. •Efficiency: Even though it is not the main concern in this project, the algorithms created should be efficient. Both the polygons that make up the terrain regions and the polygonal lines that represent the GPS trajectories can end up being made up of many vertices. The execution time should be acceptable for complex data inputs. 8 6 Budget In this chapter, an economic analysis is carried out with the aim of identifying and evaluating the costs associated with this TFG to determine its financial sustainability. These costs are divided into categories that include personnel costs, generic costs, contingency costs, and unforeseen costs. 6.1 Personnel Costs First, we need to identify the roles of the staff who will be involved in this project: the project manager and the programmer. The role of project manager is shared between the director, co-director and author of the TFG, while the role of programmer is assumed individually by the author of the work. Table 4.1 shows the rates in euros per hour corresponding to each role, which have been obtained from the gross wages in accordance with the remunerations in software projects according to the Talent.com page. These values have been adjusted to include social security contributions, which involves multiplying gross wages by 1.3 to obtain total staff remuneration. Now that we have these values, we can move forward to calculate the cost associated with each activity. This calculation is carried out through an estimate of the cost for each of the tasks that have been defined in the Gantt diagram. The details of the profiles involved in each task and the costs associated with its execution are shown in Figure 4. Role Gross Salary Social Security Compensation Project manager 19€/h 5.7€/h 24.7€/h Programmer 11€/h 3.3€/h 14.3€/h Table 2: Gross salary, contribution to the social security and remuneration of the project roles 6.2 General expenses These expenses are calculated in a general way, since they are not directly linked to the tasks of the project. They include depreciation, work space and electricity consumption. 6.2.1 Amortizations Hardware: During the course of the project, only a MacBook Pro 2021 laptop will be used at a cost of €2000. Assuming an average useful life of 6 years (72 months), the amortization of this resource is 4/72 ×2000= €111. Software: All the software used in this project is free, so the depreciation in this area is €0. 15 Code Name Man. Prog. Man. cost Prog. cost Total cost T1 Meetings 8h 8h 152€88€240€ T2 State of art study 15h 0h 285€0€285€ T3 Scope 25h 0h 475€0€475€ T4 Planning 20h 0h 380€0€380€ T5 Budget 10h 0h 190€0€190€ T6 Sustainability report 5h 0h 95€0€95€ T7 Documentation 10h 10h 190€110€300€ T8 Framework development 0h 40h 0€440€440€ T9 Criteria definition 0h 30h 0€330€330€ T10 Implementation 0h 60h 0€660€660€ T11 Experimentation 0h 40h 0€440€440€ T12 Thesis 70h 0h 1330€0€1330€ T13 Presentation 20h 0h 380€0€380€ Total: 5545€ Table 3: Tasks with their cost per role and total 6.2.2 Work space The project will be developed entirely remotely, so there is no added cost for the workspace. The expenditure in this area will be €0. 6.2.3 Electricity consumption After checking the current cost of electricity, which is €0.18 per kWh and the consumption of the laptop, which is around 30W, we can approximate the cost of keeping the laptop running. The cost for 350 hours of project would be €1.89 Concept Cost Amortizations 111€ Work space 0€ Electricity consumption 1.89€ Total 112.89€ Table 4: Cost of general expenses individually and in total The general expenses will be €112.89 16 6.3 Contingencies It is necessary to take into account the possibility that unforeseen events and unexpected complexities may arise during the course of the project, which may result in an increase in its final cost. As a precautionary measure against this type of situation, a contingency item is reserved. Typical contingency levels in software development projects typically range from 10% to 20% of the total project cost. In this case, we will choose a low value, 10%, since it is not a job susceptible to critical unforeseen events. We calculate this cost as follows: (Total CPA + Total CG) ×0.10 Therefore, the contingency cost is (€5545 + €112.89) ×0.10 = €565,789 17 7 Sustainability report My training in Computer Science has led me to understand the importance of sustainability and to consider the environmental impact of projects. I have learned to value ethics and efficiency in the use of resources, both in my personal life and in the developments I carry out. In addition, my previous experiences have reinforced my belief that society does not give enough importance to social and environmental sustainability in projects. Companies often put excessive weight on economic profit and completely abandon the social and environmental sphere. I believe that each project must aim to meet society’s needs, improve people’s quality of life and minimize environmental impact. 7.1 Environmental dimension This work is part of a research project. To work, I will only use a laptop loaned from the company where I work, which is reused between workers, and the internet connection. The total energy consumption is very low, as we have seen previously. Regarding the consumption of paper or other consumable materials, paper will only be used in the final delivery of the report, when printing the work in physical form. 7.2 Economic dimension The cost of the project is described in the previous chapter and is broken down appropriately in order to distinguish the costs associated with human resources and those associated with materials. It seems difficult to further reduce the cost of the project because there is no section of the budget where a cost overrun or an unfairly inflated item is evident, the project in general is already quite economical. 7.3 Social dimension On a personal level, this work will give me experience working in the field of computational geometry and improve my programming skills with Python and with the Matplotlib tool. It will also give me experience working in a small research team, improving my management and coordination skills with the rest of my colleagues. Regarding the usefulness of this project at a collective level, I think that the project in which my work is framed can be of great help to lovers of hiking, especially to the elderly, who may be better off receiving the directions of a route in the form of directions instead of receiving a map and route full of small details for the view. 18 8 Problem definition 8.1 Definitions In order to ensure clarity and precision in the subsequent discussions, this section provides a comprehensive set of statements and definitions for key concepts and terminology employed throughout the thesis. Let’s begin by stating that, from this point onwards, we will adopt the convention of working within the two-dimensional Euclidean space, R2. That is, in the subsequent sections of this document we will be working with pairs (x, y) where xand yare real numbers. As we have stated previously in Subsection 1.2, in order to simplify the problem we are going to represent pieces of terrain as polygonal regions and route trajectories as polygonal lines. Definition 1. Polygonal region: We define a polygonal region as a geometric entity in the Euclidean plane represented by a sequence of vertices. It can be expressed as: P={(xi, yi)|xi, yi∈R2, i = 1,2, . . . , n} where nis the number of vertices and (xi, yi) are the coordinates of each vertex. The line segments connecting consecutive vertices form the edges of the polygon, and the last vertex is connected to the first, resulting in a closed shape. Everything contained between these edges conforms the polygonal region P. Definition 2. Polygonal path: Apolygonal path Tis a sequence of connected line segments in the two-dimensional Euclidean space, represented by a set of vertices. It can be expressed as: T={(xi, yi)|xi, yi∈R2, i = 1,2, . . . , n} where nis the number of vertices, and (xi, yi) are the coordinates of each vertex. The line segments connecting consecutive vertices form the edges of the polygonal path. The path may include self-intersections, allowing for complex trajectories. Before starting to comment on the measures that allow us to quantify the relation between a polygonal region and a polygonal path, we need to first define the idea of centrality: Definition 3. Centrality: Let Pbe a polygonal region and Tbe a polygonal path. The centrality of Twithin Pis defined as a measure C(P, T ) that quantifies the positioning and relationship of the path Twith respect to the polygonal region P. The centrality measure C(P, T ) is a function being defined on VP×VTand giving values in [0,1]. C:VP×VT→[0,1],0≤C(T, P )≤1 19 In most of the measures we’re gonna discuss, we use the idea of polygon’s boundary and polygon’s centroid. For clarity, we are going to define them next. Definition 4. Boundary: The boundary of a polygonal region Pin a two-dimensional space is formally defined as follows: The boundary BPis the closed piecewise-linear curve formed by the line segments connecting the consecutive vertices of P. Definition 5. Centroid: The centroid of a polygon Pin the Euclidean plane R2is a point denoted by c(P) = (xc, yc), where xcand ycare the averages of the x-coordinates and y-coordinates of the polygon’s vertices, respectively. Mathematically, for a polygon P represented by the set of vertices VP={(xi, yi)|i= 1,2, . . . , n}, where nis the number of vertices, the centroid is calculated as follows: xc=1 n n X i=1 xi, yc=1 n n X i=1 yi The centroid c(P) is the point that balances the polygon with respect to both the x-axis and the y-axis and serves as a representative central location for the polygon. It’s important for our work to note that the centroid c(P) lies inside of Pif Pis a convex polygon, which can be defined as follows: Definition 6. Convex polygon: A polygon polygon is convex if and only if all of its interior angles are less than 180º. For the purpose of evaluating the centrality of a trajectory, in some of our measures, we will compare it with an ideal path that always evaluates with maximum score. Definition 7. Ideal path: An ideal path Iwithin a polygonal region Pand an entry point q∈Bis formally defined as a straight line segment passing through qand the centroid cof P, and bounded to P’s domain. I=←→ qc ∩P The two measures of our measures that will evaluate the centrality of a polygonal path within a polygonal region are based on two existing similarity measures, the Discrete Fr´echet Distance and the Dynamic Time Warping, respectively. Definition 8. Discrete Fr´echet distance: The Fr´echet Distance between two polygonal lines A=a1, a2, . . . and B=b1, b2, . . . is defined, by Eiter and Mannila (1994)[3], as follows: 20 DF D(A, B) =                    0 if Aand Bare empty ∞if Aor Bis empty (not both) max(dist(a1, b1),min( DF D(A[2, n], B[2, m]), DF D(A, B[2, m]), DF D(A[2, n], B))) otherwise Definition 9. Dynamic Time Warping (DTW): The Dynamic Time Warping distance between two polygonal lines A=a1, a2, . . . and B=b1, b2, . . . is defined, by Chen et al. (2005)[2], as follows: DT W (A, B) =                    0 if Aand Bare empty ∞if Aor Bare empty (not both) dist2(a1, b1) + min( DT W (A[2, n], B[2, m]), DT W (A, B[2, m]), DT W (A[2, n], B))) otherwise The two measures above use the distance between a point aand a point b dist(a, b), which is defined as follows. Definition 10. Distance: The distance between two points in a Euclidean space is the length of the line segment that connects them. It can be calculated using the Pythagorean theorem: dist(a, b) = p(b1−a1)2+ (b2−a2)2] 8.2 Problem statement Let Pdenote a polygonal region, defined by the set of points VP, that represents a terrain region, and Ta polygonal path, defined by the set of points VT, that represents a trajectory. Let also Bbe the boundary of P,cthe centroid of P, and qthe first intersection point of Twith B. Our goal is to define measures that quantify the centrality of Twithin Pwhile following a series of properties, defined in the subsection below. 21 8.2.1 Centrality measure properties 1. Non-intersection If the path doesn’t intersect with the polygon, return 0: C(T, P ) = 0 if T∩P=∅ 2. Border traversing If the path goes through the border of the polygon, return 0: C(T, P ) = 0 if T∩P⊆B 3. Ideal path pentrality If the path is a straight line that goes through the centroid, return 1: C(T, P ) = 1 if I=←→ qc ∩P 4. Direction neutrality The orientation of T does not influence the outcome of the centrality measure: C(P, T ) = C(P, T ) 5. Vertex independence Result is independent of the number of vertices. 6. Self-intercepting paths Accepts self-intersecting paths. 22 9 Centrality measures To tackle the problem of quantifying the centrality of a trajectory crossing a polygonal region, we’ve designed five different centrality measures based on different approaches and with various properties. We’ve named them based on their approach to computing the centrality: Border Measure, Weights Measure, Area Measure, Fr´echet Measure, and DTW Measure. In this section, we will define them, describe their respective algorithms, and comment on their characteristics. 9.1 Border Measure Overview This measure evaluates the crossing of a trajectory Tthrough a polygonal region Pbased on the distances of its vertices to P’s border. Definition Let VPbe the set of vertices of P,VTthe vertices of Tand V′ Tthe set of points of VTthat lie inside P. For each t∈V′ Tcompute the distance to p,pbeing the point in P’s boundary that is nearest to s. Then, compute the sum dof the distances dist(s, p) to calculate the average distance. Finally, normalize the value dividing it by r, which is the distance between P’s centroid and its nearest point on the boundary. Input Set of polygon vertices VPand set of path vertices VT. Output Value representing the centrality of Trelative to P, between 0 and 1. 1if V′ Tis empty then 2return 0; 3end 4d←0; 5foreach t∈V′ Tdo 6q←nearest point to s on P’s boundary; 7d←d+dist(t, q); 8end 9return min(1,d |V′ T|×r); Algorithm 1: Border Technique Development This algorithm was designed based on the first approach to defining the centrality of a trajectory studied in this project. The idea underlying this strategy is simple: Tis more centered in Pif its vertices are far from P’s border and less centered if they are closer to it. Considerations This strategy, however, proved to have an important flaw: the first and last vertices of a straight path inside Pare always going to be closer to the border, making it impossible to obtain a maximum centrality value for all paths that we’ve defined as ideal, and thus not satisfying Property 3. 23 9.2 Weights Measure Overview This measure evaluates the crossing of a trajectory Tthrough a polygonal region Pby considering the belonging of each vertex of Tto a set of scaled-down versions of Pand assigning it a weight based on that. Definition Let Sbe a list of scaled-down versions of Pcentered at P’s centroid and sorted by size in descending order, Wthe predefined list of weights sorted in ascending order corresponding to the polygons of S,VTthe set of vertices of Tand V′ Tthe set of points of VTthat lie inside P. For each t∈V′ T, find the highest isuch that t∈Siand add Wito the total sum k. Finally, divide kby the reference value r, which is an predefined value representing the optimal score. Input Set of polygon vertices VPand set of path vertices VT. Output Value representing the centrality of Trelative to P, between 0 and 1. 1if V′ Tis empty then 2return 0; 3end 4k←0; 5foreach t∈V′ Tdo 6i←maximum isuch that t∈Si; 7k←k+Wi; 8end 9return min(1,k r); Algorithm 2: Weights Technique Development This algorithm was designed on a similar principle as the Border Technique seen before, but with the opposite idea: Tis more centered in Pif its vertices are closer to P’s centroid, and less centered if they are away from it. The approach of assigning weight to scaled-down versions of Pwas chosen for two main reasons. Firstly, to keep the sense of centrality among polygonal regions with different shapes, e.g. a very elongated polygon. Secondly, to be able to easily decide to which extent the centrality of the vertices affected the returned value by modifying the weight of each layer. Considerations One of the challenges faced while designing this algorithm was choosing the value rto normalize the total sum k. It needs to be a value representing the optimal score, but it can’t just be the score of giving every vertex in Tthe maximum weight since that would make it impossible for most of the paths we consider central to obtain a maximal evaluation. That’s why for this implementation we chose to set rto the total sum kof an hypothetical straight path of equidistant vertices passing through P’s centroid: r=|VT| × Pw∈Ww |W| 24 •Save case: Persists the current geometric scenario, the polygon and path, to a CSV file, allowing users to save and later revisit their created scenarios. This visualization framework made the implementation of the different algorithms much easier, since we could instantly see if some measure was behaving unexpectedly and take care of it. Figure 3: Screenshot of the visualization framework. In grey, the polygon. In red, the trajectory. In the bottom-left corner, the return values of all the measures at that instant. 10.4 Automatic testing After all algorithms were implemented and working, it was time to put them to test under a set of previously designed cases to compare them and see their performance over various scenarios. The automatic testing was more straightforward to develop and is implemented in the file test all cases.py. The script iterates through all the files in the defined directory with the prefix ”case” and, for each, loads the scenario, runs all algorithms on it, and adds the results to the output table. In Section 11 we will analyse each one of the cases used in the automatic testing in relation to each one of our centrality measures and then comment on the results as well as comparing the performance of the measures. 31 11 Experimentation In this section we are going to comment, one by one, eleven test cases carefully designed to represent the widest set of scenarios within the scope of our work. For each case we will give a quick overview, a detailed description of the scenario, a comment on the main objectives of the case and a description of that case’s results. After going through all cases, we will do a general analysis of all the results. The experiments were carried on a MacBook Pro 2021, with Apple M1 Pro processer, 32GB RAM, and running on macOS Monterey 12.6. The version number of the libraries used are the following: •matplotlib 3.8.0 •numpy 1.26.0 •shapely 2.0.2 •tabulate 0.9.0 11.1 Cases Case 1 Overview In Case 1, we explore a simple scenario featuring a convex polygon and an straight-line path with all the vertices outside the polygon. This experiment aims to test the behavior of our different measurement techniques toward ideal paths and paths with no vertices inside the polygon. We expect to obtain maximum scores for Area, Fr´echet, and DTW techniques and minimum ones for Borders and Weights. Scenario This scenario consists of a convex irregular octagon and a straight path formed by only the two vertices of its endpoints. The path passes through the polygon centroid and divides it perfectly into two halves. 32 Figure 4: Case 1 scenario Objectives The two main goals of the first experiment are to evaluate the performance of the measurements when applied to an ideal path scenario and to see how the vertexdependent techniques respond when the path is formed by very few vertices that are, in addition, positioned outside the polygon. Results As expected, the area, Fr´echet, and DTW techniques returned 1, since the path is straight, goes through the centroid, and acts as an axis of symmetry of the polygon. The Borders and Weights techniques returned 0, also as expected, since they only take into account vertices inside the polygon. Borders Weights Area Fr´echet DTW 0 0 1 1 1 Table 6: Experiment 1 results 33 Case 2 Overview In Case 2, we analyze a scenario similar to the one in Case 1, but with the path line having some intermediate vertices. In this experiment, we intend to show the behavior of our methods when the path is formed by multiple vertices, in contrast to Case 1. We expect to obtain maximum scores for Area, Fr´echet, and DTW techniques and high, near-to-maximal scores for Borders and Weights. Scenario This scenario consists of a convex irregular octagon like the one in Case 1 and a straight path formed by seven vertices equally spaced. The path passes through the polygon centroid and divides it perfectly into two halves. Figure 5: Case 2 scenario Objectives The main objective of this experiment is to show that the Border and Weights techniques work when there are vertices of the path that lie inside the polygon and to see how they behave on an ideal path with evenly spaced vertices. Results As expected, the area, Fr´echet, and DTW techniques returned 1. The Borders technique returned a lower value than predicted, but it is not an unexpected result since two of the five vertices involved in the calculation are on the border, lowering the score. The Weights technique returned an expected high but not maximal value since it evaluates based on the position of vertices rather than precisely detecting an ideal path. Borders Weights Area Fr´echet DTW 0.4 0.821 1 1 1 Table 7: Experiment 2 results 34 Case 3 Overview In Case 3, we explore a scenario formed by a convex polygon and a path with a zigzagging shape. This experiment aims to challenge some of the techniques, that may fail with paths of this nature. We expect to obtain a high value for the Area technique, an intermediate value for the DTW technique, and low values for the rest. Scenario This scenario consists of a convex irregular nonagon and a path formed by twelve vertices, situated close to its borders alternating sides, making the path adopt a zigzagging shape. It’s worth noting that the path divides the polygon into two regions of similar area, and it doesn’t have any vertex in the center. Figure 6: Case 3 scenario Objectives This experiment has two goals. The main one is to show the behavior of the Area technique when dealing with a path that is far from ideal but divides the polygon equally. Secondly, to see how does the Fr´echet technique behave when some vertex is close to the border.. Results As expected, the Borders, Weights, and Fr´echet techniques returned low values. In the case of the Fr´echet technique, we obtained a low value because the Fr´echet distance of the path is almost equal to the maximum for the polygon. The area method returned a very high score since the two polygon sections formed by the path line have similar areas. Borders Weights Area Fr´echet DTW 0.059 0.158 0.993 0.115 0.439 Table 8: Experiment 3 results 35 Case 4 Overview In Case 4, we explore a scenario where the path line passes very close to the border on one side of the polygon from start to end. In this experiment, we want to show how our measurement techniques perform when dealing with a path that travels along the border of one side of the polygon. We expect to obtain low scores with all the methods, with the Weights one returning a slightly higher one. Scenario This scenario features a convex irregular nonagon and a path formed by seventeen vertices differently spaced, situated close to the right border of the polygon, making the path travel alongside it, entering from the inferior part and exiting through the upper, without touching or crossing it. Figure 7: Case 4 scenario Objectives The objective of this experiment is to see how the measuring methods behave when applied to scenarios where the path traverses the polygon following one of its sides, with all the vertices placed very closely to the border. Results The results of applying our measuring techniques were the expected: we obtained low values from every technique and a slightly higher one from the Weights one. The Area technique returned a score slightly higher than expected. Borders Weights Area Fr´echet DTW 0.063 0.158 0.126 0.088 0.095 Table 9: Experiment 4 results 36 Case 5 Overview In Case 5, we look at the worst case scenario of the path traversing the polygonal region, where the path intersects with the polygon only on its exact boundary. In this experiment, we want to show what value our measurement techniques return when dealing with a path that travels exactly on the border of the polygon. We expect to obtain the minimum score of 0 with all the methods. Scenario This scenario consists of a convex irregular nonagon and a path formed by seven vertices, five of which (the five central ones) coincide with five consecutive vertices of the polygonal region. All contact points between the path and the polygon belong to the polygon’s boundary. Figure 8: Case 5: Boundary traversal scenario Objectives The sole objective of this experiment is to assess if the measuring methods follow Property 2 and return 0, the minimal value, when applied to scenarios where the path traverses the polygon precisely through its boundary. Results The results of applying our measuring techniques were the ones we expected: we obtained 0 from every method, proving that they all satisfy Property 2, returning 0 when all the points of the intersection between the polygonal region and the path belong to the polygon’s boundary. Borders Weights Area Fr´echet DTW 0 0 0 0 0 Table 10: Experiment 5 results 37 Case 6 Overview In Case 6, we look at the worst-case scenario of the path not intersecting the polygonal region. In this experiment, we want to show what value our measurement techniques return when dealing with a trajectory that passes next to the polygon without intersecting it at any point. We expect to obtain a minimum score of 0 with all the methods. Scenario This scenario showcases a convex irregular nonagon and a path formed by sixteen vertices differently spaced, thirteen of which lie in the polygon’s boundary. The path follows the ideal trajectory until it approaches the center of the polygon, where it abruptly heads to the right border of the region and comes back to follow the ideal trajectory right before reaching it. Figure 9: Case 6 scenario Objectives The sole objective of this experiment is to asses if the measuring methods follow Property 1 and return 0, the minimal value, when applied to scenarios where the path doesn’t intersect with the polygon at any point. Results The results of applying our measuring techniques were the ones we expected: we obtained 0 from every method, proving that they all satisfy Property 1, returning 0 when none of the points in the path belong to the polygonal region’s domain. Borders Weights Area Fr´echet DTW 0 0 0 0 0 Table 11: Experiment 6 results 38 Case 7 Overview In Case 7, we explore a scenario where the path line follows the ideal trajectory, quickly deviates towards the region’s border, and continues to follow the ideal trajectory. In this experiment, we want to show how the Fr´echet technique reacts to outliers in the path in contrast to the DTW technique. We expect to obtain intermediate to high scores with all the methods except for the Fr´echet method, where we predict a low return value. Scenario This scenario features a convex irregular nonagon and a path formed by seventeen vertices differently spaced, situated close to the right border of the polygon, making the path travel alongside it, entering from the inferior part and exiting through the upper, without touching or crossing it. Figure 10: Case 7 scenario Objectives The main objective of this experiment is to test the behaviour ofthe Fr´echet technique when dealing to outliers, especially compared to the other similarity-based method we’re studying, the DTW technique. Results The results of applying our measuring techniques were more or less the expected: we obtained high values from the Weights and Area techniques, intermediate ones from Weights and DTW, and a disproportionately low return value from the Fr´echet technique. This last result makes sense, as the trajectory getting so close to the border resulted in the path’s Fr´echet distance to the ideal path being almost equal to the region’s border Fr´echet distance to it. Borders Weights Area Fr´echet DTW 0.457 0.996 0.913 0.084 0.603 Table 12: Experiment 7 results 39 Case 8 Overview In Case 8, we analyze a scenario where the path line does a half-turn and goes back before reaching the center. In this experiment, we want to show how the different techniques react to a path that exits the polygon on the same “side” it entered. We expect to obtain low to intermediate scores with all the methods except for the Fr´echet method, where we predict a minimal value of 0. Scenario This scenario features a convex irregular nonagon and a path formed by ten vertices, eight of which lie inside the polygon. The trajectory formed by the vertices enters the polygon, and when it approaches the centroid, it turns and exits the polygon from the side adjacent to the entrance one. Figure 11: Case 8 scenario Objectives The main objective of this experiment is to show how does the Fr´echet technique performs when a path exits the polygon near to where it entered it. Results The results in this case were the expected except for the Weights technique. It returned a near-to-maximal score when we were expecting a medium one. The Fr´echet technique, as predicted, returned 0 because of the distance between the final vertices of the ideal path and our ending vertices. Borders Weights Area Fr´echet DTW 0.471 0.987 0.259 0 0.272 Table 13: Experiment 8 results 40 References [1] Lamia Belouaer, David Brosset, and Christophe Claramunt. From verbal route descriptions to sketch maps in natural environments. pages 1–10, 10 2016. [2] Lei Chen, M. Tamer ¨ Ozsu, and Vincent Oria. Robust and fast similarity search for moving object trajectories. In Proceedings of the 2005 ACM SIGMOD International Conference on Management of Data, SIGMOD ’05, page 491–502, New York, NY, USA, 2005. Association for Computing Machinery. [3] Thomas Eiter and Heikki Mannila. Computing discrete frechet distance. 05 1994. [4] Lidia Fraczak, Guy Lapalme, and Michael Zock. Automatic generation of subway directions: Salience gradation as a factor for determining message and form. 09 1998. [5] Sean Gillies et al. Shapely: manipulation and analysis of geometric objects, 2007–. [6] J. D. Hunter. Matplotlib: A 2d graphics environment. Computing in Science & Engineering, 9(3):90–95, 2007. [7] Pyry Kettunen, Katja Irvankoski, Christina M. Krause, and L. Sarjakoski. Landmarks in nature to support wayfinding: The effects of seasons and experimental methods. Cognitive processing, 14, 02 2013. [8] Adam Rousell and Alexander Zipf. Towards a landmark-based pedestrian navigation service using osm data. ISPRS International Journal of Geo-Information, 6(3), 2017. [9] Guido Van Rossum and Fred L. Drake. Python 3 Reference Manual. CreateSpace, Scotts Valley, CA, 2009. [10] Shuihua Wang and Yingli Tian. Camera-based signage detection and recognition for blind persons. In Klaus Miesenberger, Arthur Karshmer, Petr Penaz, and Wolfgang Zagler, editors, Computers Helping People with Special Needs, pages 17–24, Berlin, Heidelberg, 2012. Springer Berlin Heidelberg. [11] Rodrigo I. Silveira Kevin Buchin Stef Sijben Ross S. Purves Patrick Laube Dongliang Peng Kevin Toohey Yaguang Tao, Alan Both and Matt Duckham. A comparative analysis of trajectory similarity measures. GIScience & Remote Sensing, 58(5):643– 669, 2021. 47