Track Segment Aggregation#

algo.fusion module

This module provides functions aimed at producing the best geometric representation of network edges from a topological skeleton.

It includes a main function that orchestrates the aggregation of track segments assigned to skeleton edges with topology, as well as a secondary function that performs track segment merging using the tracklib library.

aggregate_track_segments_by_edge

Orchestrates track segment aggregation for each edge.

aggregate_track_segments_on_edge

Computes the median track representation for a given edge using tracklib.

Aggregate by edge#

aggregate_track_segments_by_edge(network, SEARCH, RESPATH, iteration_index)[source]#

Orchestrates track segment aggregation for each edge.

This function (main) reads all candidate track segments to be merged from files of the form mapmatch/resultmm_<iteration_index>.csv.

If an edge length is below the SEARCH threshold, no merging is performed and the original skeleton edge geometry is used instead.

For each edge, a result file is written containing the edge identifier, median track collection geometry, and number of contributing tracks, stored under geometry/fusion<iteration_index>/<edge_id>.csv.

The main statistical indicators are saved in aggregate<iteration_index>.json

Parameters#

networktkl.Network

The simplified skeleton with a topology.

SEARCHfloat

Minimum edge length for track merging.

RESPATHstr

Output directory for storing results defined in the configuration file.

iteration_indexint

Current iteration number.

Returns#

merged_trackstkl.TrackCollection

Collection of median tracks per edge.

Aggregate track segments for an edge#

aggregate_track_segments_on_edge(TRACKS)[source]#

Computes the median track representation for a given edge using tracklib.

The function aggregate_track_segments_on_edge prepares the collection of track segments for merging and calls the tracklib algorithm to compute the median track representation for each edge.

Parameters#

TRACKStkl.TrackCollection

Une collection de traces candidates à la fusion

Returns#

median_tracktkl.Track

The merged track, representing the best geometric representation of a set of tracks following exactly the same path, defined from an origin point to a destination.