Plan de l’Aiguille (Chamonix-Mont-Blanc)#
Chargement des librairies#
[1]:
import os
import sys
# Ajout dans la variable PATH du système du chemin où est installée la librairie tracklib
module_path = os.path.abspath(os.path.join('../../../../tracklib'))
if module_path not in sys.path:
sys.path.append(module_path)
# Alias pour tracklib
import tracklib as tkl
# Ajout dans la variable PATH du système du chemin où est installée la librairie footprint2graph
module_path = os.path.abspath(os.path.join('../../..'))
if module_path not in sys.path:
sys.path.append(module_path)
[2]:
import matplotlib.pyplot as plt
import os
import time
from footprint2graph import footprint2grap
from footprint2graph import read_config
from footprint2graph.util.Outdoorvision import load_raw_tracks_split
Chargement des paramètres#
[3]:
print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print ('`````````````````````````````````````````````````````````````````````')
print (' Generate a footprint graph ')
print (' from hiking trajectories ')
print (" in the Plan de l'Aiguille, dans la vallée de Chamonix, summer 2024. ")
print ('’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’')
print ('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print ('')
""" ======================================================================= """
""" Load parameters """
""" """
config_path = r'/home/md_vandamme/7_LIB/footprint2graph/data/config_plan_de_l_aiguille.yml'
config = read_config(config_path)
print('Paramètres relevés dans la configuration: ')
print ('Résultats enregistrés dans le répertoire: ', config['output']['RESULT_PATH'])
NBITER = int(config['graph_construction']['NUM_ITERATIONS'])
print ('Number of iterations: ', NBITER)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
`````````````````````````````````````````````````````````````````````
Generate a footprint graph
from hiking trajectories
in the Plan de l'Aiguille, dans la vallée de Chamonix, summer 2024.
’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Paramètres relevés dans la configuration:
Résultats enregistrés dans le répertoire: /home/md_vandamme/4_RESEAU/ZTEMPZ3/
Number of iterations: 2
Chargement des données#
Les données proviennent de la plateforme Outdoorvision. Après avoir été formatées au format CSV, elles sont chargées dans une collection qui servira d’entrée au pipeline.
[4]:
""" ======================================================================= """
""" Chargement de la collection de traces """
""" """
# chemin où sont stockés les traces Outdoorvision:
tracespathsource = r'/home/md_vandamme/5_GPS/OV/CHAM/walk/'
# Paramètre : Coordonnées de la zone d'étude sur laquelle on construit le réseau
# Polygone sous la forme d'un tableau de X et de Y
X = [1000852, 1001838, 1001852, 1000853, 1000852]
Y = [6541520, 6541524, 6540842, 6540839, 6541520]
fmt = tkl.TrackFormat({'ext': 'CSV',
'srid': 'ENU',
'id_E': 1, 'id_N': 0, 'id_U': 3, 'id_T': 2,
'time_fmt': '2D/2M/4Y 2h:2m:2s',
'separator': ';',
'header': 0,
'cmt': '#',
'read_all': True})
collection = load_raw_tracks_split(config['output']['RESULT_PATH'],
tracespathsource, fmt, X, Y)
Loading and split outdoorvision track data...
Reading track data...
Number files to load: 21211
Starting split ...
1000 / 21211
2000 / 21211
3000 / 21211
4000 / 21211
5000 / 21211
6000 / 21211
7000 / 21211
8000 / 21211
9000 / 21211
10000 / 21211
11000 / 21211
12000 / 21211
13000 / 21211
14000 / 21211
15000 / 21211
16000 / 21211
17000 / 21211
18000 / 21211
19000 / 21211
20000 / 21211
21000 / 21211
Number of tracks after split: 631
Lancement du pipeline#
[5]:
#
footprint2grap(config, collection, 'ERROR')
-----------------------------------------------------------------
-----------------------------------------------------------------
ITERATION 1
-----------------------------------------------------------------
-----------------------------------------------------------------
Starting segmentation and resampling...
Starting segmentation ...
Number of tracks to resample: 688
Stage 1 finished: segmentation and resampling.
Starting rasterization and vectorization (iteration 1)
100% (341 of 341) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (846 of 846) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (403 of 403) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (663 of 663) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (1273 of 1273) |####################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (621 of 621) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (618 of 618) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (2711 of 2711) |####################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (1113 of 1113) |####################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (967 of 967) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (963 of 963) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
Stage 2 completed: rasterization and vectorization.
Starting topology creation for the network
/home/md_vandamme/4_RESEAU/ZTEMPZ3/network/tmp_in.csv not exists
/home/md_vandamme/4_RESEAU/ZTEMPZ3/network/tmp_out.csv not exists
50% (16 of 32) |############ | Elapsed Time: 0:00:00 ETA: 0:00:00
100% (32 of 32) |########################| Elapsed Time: 0:00:00 Time: 0:00:000000
100% (32 of 32) |########################| Elapsed Time: 0:00:00 Time: 0:00:00
Building [100 x 74] spatial index...
Stage 3 completed: adding topology to the skeleton.
Starting map-matching, aggregation, and conflation of GNSS trajectories.
Stage 4 completed: map-matching, aggregation, and conflation.
-----------------------------------------------------------------
-----------------------------------------------------------------
ITERATION 2
-----------------------------------------------------------------
-----------------------------------------------------------------
Starting new dataset for the next iteration.
100% (1293 of 1293) |####################| Elapsed Time: 0:00:00 Time: 0:00:000:00
0% (0 of 1293) | | Elapsed Time: 0:00:00 ETA: --:--:--
Number of reconstructed tracks : 1293
Attract points toward the centroid of neighboring trajectory points
Create index and index all observations not map-matched
Pull points toward the centroid of neighboring trajectory points
100% (1293 of 1293) |####################| Elapsed Time: 0:05:33 Time: 0:05:330227
New dataset created.
Starting rasterization and vectorization (iteration 2)
100% (147 of 147) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (180 of 180) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (123 of 123) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (115 of 115) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (149 of 149) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (144 of 144) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (123 of 123) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (195 of 195) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (519 of 519) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (111 of 111) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (207 of 207) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (236 of 236) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (399 of 399) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (430 of 430) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (379 of 379) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (289 of 289) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (346 of 346) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (960 of 960) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (333 of 333) |######################| Elapsed Time: 0:00:00 Time: 0:00:00
Stage 2 completed: rasterization and vectorization.
Starting topology creation for the network
81% (66 of 81) |################### | Elapsed Time: 0:00:00 ETA: 0:00:00
100% (81 of 81) |########################| Elapsed Time: 0:00:00 Time: 0:00:00
100% (81 of 81) |########################| Elapsed Time: 0:00:00 Time: 0:00:00
Building [100 x 87] spatial index...
Stage 3 completed: adding topology to the skeleton.
Starting map-matching, aggregation, and conflation of GNSS trajectories.
WARNING: TRAJECTORY FUSION HAS NOT CONVERGED (#ITER = 25 - CV = 0.4308281593414602)
Stage 4 completed: map-matching, aggregation, and conflation.
Merging the mobility network with the result of iteration 2.
100% (40 of 40) |########################| Elapsed Time: 0:00:00 Time: 0:00:00
Building [100 x 74] spatial index...
End building the mobility network.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
`````````````````````````````````````````````````````````````````````
FIN
’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Visualisation du réseau de mobilité pédestre final#
[6]:
from footprint2graph.util.PlotRes import plotResultatFinal
plotResultatFinal(config['output']['RESULT_PATH'], '2')