β¨ Detailed insights β’ π¦ Installation β’ π Usage β’ ποΈ Datasets β’ π Related packages/frameworks β’ π License
TCX2Graph.jl is a Julia package designed to facilitate the transformation of TCX data into property graphs, enabling the analysis of overlapping paths and shared segments in cycling routes. This package simplifies the process of converting .tcx
files, commonly generated by GPS-enabled fitness devices, into graph representations that can be used for various analyses, such as detecting shared segments, mapping frequently traveled routes, and segment-based metrics.
TCX2Graph.jl employs a KDTree for efficient spatial queries, allowing rapid identification of overlapping segments across multiple cycling paths.
pkg> add TCX2Graph
using TCX2Graph
# Example to process TCX files and generate a property graph
function main()
# Path to the folder containing the .tcx files
tcx_folder_path = TCX2Graph.get_absolute_path("../example_data/files")
# Process TCX files to generate graphs and analyze paths
graph, gps_data, paths = TCX2Graph.create_property_graph(tcx_folder_path)
kdtree = TCX2Graph.create_kdtree_index(gps_data)
# Find overlapping segments and compute characteristics
overlapping_segments = TCX2Graph.find_overlapping_segments_across_paths(gps_data, paths, kdtree)
TCX2Graph.plot_individual_overlapping_segments(gps_data, paths, overlapping_segments, "./output/")
println("Overlapping segments: ", length(overlapping_segments))
end
main()
using TCX2Graph
# After detecting overlapping segments
segment_idx = 1
total_distance, total_ascent, total_descent, total_vertical_meters, max_gradient, avg_gradient =
TCX2Graph.compute_segment_characteristics(segment_idx, gps_data, overlapping_segments)
println("Segment Characteristics:")
println("Distance: $total_distance meters")
println("Ascent: $total_ascent meters")
println("Descent: $total_descent meters")
println("Max Gradient: $(max_gradient * 100)%")
println("Average Gradient: $(avg_gradient * 100)%")
Datasets available and used in the examples on the following links: DATASET1, DATASET2, DATASET3.
[1] tcxreader: Python reader/parser for Garmin's TCX file format.
[3] tcxread: A parser for TCX files written in Ruby
[4] TCXReader.jl: Julia package designed for parsing TCX files
[5] AST-Monitor: A wearable Raspberry Pi computer for cyclists
This package is distributed under the MIT License. You can find the license at http://www.opensource.org/licenses/MIT.
This package is provided as-is with no guarantees of fitness for any particular purpose. Use it at your own risk!