Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPX & TCX Visualization & Splitting Tool

This project provides a set of Python scripts for visualizing and manipulating GPS data from .gpx and .tcx files. It's designed for cyclists, runners, and outdoor enthusiasts who want to analyze their activity data.

Features

1. GPX Distance Splitter (main.py)

A graphical user interface (GUI) application built with tkinter that allows you to:

  • Split GPX Files: Extract a specific segment from a GPX track based on start and end distances in kilometers.
  • Visualize Tracks: Automatically generates an HTML map comparing the original track with the newly split segment.
  • Overlay GeoJSON Data: Display points of interest (e.g., train stations) from a GeoJSON file on the map to see how they relate to your route.
  • Save & Load Configuration: Remembers your last-used file paths and settings for convenience.

2. TCX Activity Visualizer (tcx_viewer.py)

A command-line script that:

  • Parses TCX Files: Extracts GPS coordinates, heart rate, and speed data from .tcx files.
  • Calculates Key Statistics: Computes total distance, duration, average pace, average/max speed, and average/max heart rate.
  • Generates an HTML Summary: Creates a detailed and beautifully styled HTML page with a folium map of your route and a table of all key statistics.

How to Use

Prerequisites

You need Python installed, along with the following libraries:

pip install gpxpy haversine folium lxml

Running the GPX Splitter

  1. Run the main application from your terminal:
    python main.py
  2. Input GPX File: Click "Browse..." to select the .gpx file you want to split.
  3. Output GPX File: Click "Save As..." to choose a name and location for the new, smaller .gpx file.
  4. Stations GeoJSON (Optional): If you have a .geojson file with points of interest (like treinstation.geojson), select it here.
  5. Start and End (km): Enter the start and end distances for the segment you want to extract.
  6. Split and Visualize: Click the button. The script will create the new GPX file and open a map in your web browser showing the original and split tracks.

Running the TCX Viewer

The TCX viewer is designed to be called from another script or run with a file path. To use it, you would typically import it:

from tcx_viewer import create_tcx_visualization

# Path to your TCX file
tcx_file = 'path/to/your/activity.tcx'

# Generate and open the summary
create_tcx_visualization(tcx_file)

This will generate an _summary.html file in the same directory as the TCX file and open it automatically.

Project Files

  • main.py: The main GUI application for splitting GPX files.
  • tcx_viewer.py: The script for parsing and visualizing TCX files.
  • treinstation.geojson: An example GeoJSON file containing train station data.
  • config.json: A configuration file automatically generated by main.py to store your settings.
  • README.md: This file.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages