Skip to main content

GPX Concatenator

GPX Concatenator is a Python project that provides a set of scripts for concatenating and colorizing GPX (GPS Exchange Format) files.

Files

The project consists of the following files:

  1. gpx_concatenator.py: This file contains the GPXConcatenator class, responsible for concatenating multiple GPX files. It takes a list of input file paths, an output file path, and optional flags to enable metadata and colorization. The concatenate_files method extracts tracks from the input files using the GPXFile class and appends them to the output GPX file's XML structure. If colorization is enabled, the GPXColorizer class assigns distinct colors to the tracks and adds color metadata to the GPX file.

  2. gpx_colorizer.py: This file contains the GPXColorizer class, which colorizes tracks in a GPX file. It assigns distinct colors to each track based on its name and adds color information to the GPX file's XML structure.

  3. gpx_file.py: This file contains the GPXFile class, providing methods for working with individual GPX files. It initializes with a file path, parses the GPX file's XML structure, and extracts metadata and track elements.

  4. main.py: This file serves as the entry point of the project. It demonstrates how to use the GPXConcatenator class to concatenate and colorize GPX files. The script initializes the GPXConcatenator class with input file paths, an output file path, and flags for metadata and colorization. The concatenate_files method performs the concatenation and colorization process.

Installation

To install gpx-concatenator, you can use pip, the Python package manager. Open a terminal and run the following command:

pip install gpx-concatenator

Usage

Once installed, you can use the gpx-concatenator command to concatenate and colorize GPX files. Here's an example usage:

gpx-concatenator -i <input-directory> -o <output-file-name> -m -c

Replace <input-directory> with the directory containing the input GPX files, and <output-file-name> with the desired name of the output GPX file. The -m flag enables metadata in the output file, and the -c flag enables coloring of the tracks.

Command-line Arguments

The following command-line arguments are available:

  • -i, --input-dir: Specifies the directory containing the input GPX files. The default value is input.

  • -o, --output-file: Specifies the name of the output GPX file. The default value is output.gpx.

  • -m, --enable-metadata: Enables metadata in the output GPX file. This is an optional flag.

  • -c, --enable-coloring: Enables coloring of the tracks in the output GPX file. This is an optional flag.

For more information on available command-line arguments, use the -h, --help flag:

gpx-concatenator --help

Input Files

Place the GPX files that you want to concatenate in the specified input directory. The files will be concatenated in alphabetical order based on their names.

Output File

The concatenated GPX file will be created with the specified name in the current working directory. If the file already exists, it will be overwritten.

License

This project is licensed under the MIT License.

 _                 _          _                         
(_)               | |        (_)                        
 _  __ _ _ __ ___ | |__  _ __ _  __ _ _ __  _ __   __ _ 
| |/ _` | '_ ` _ \| '_ \| '__| |/ _` | '_ \| '_ \ / _` |
| | (_| | | | | | | |_) | |  | | (_| | | | | | | | (_| |
|_|\__,_|_| |_| |_|_.__/|_|  |_|\__,_|_| |_|_| |_|\__,_|

Release files for gpx-concatenator 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpx-concatenator 1.0.8
File Size Uploaded
gpx-concatenator-1.0.8.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpx-concatenator 1.0.8
File Interpreter ABI Platform
gpx_concatenator-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / gpx-concatenator-1.0.8.tar.gz

Download URL gpx-concatenator-1.0.8.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2682dea4f5f9c14606191fb4348c54cba62bf72620963a9c0fd114ed66d1aa1a
BLAKE2b-256 checksum
How to use checksums
34f991b67bba3b14eda029169e9af7c527ea18d1011f1970f38a4e96ebc1b7e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / gpx_concatenator-1.0.8-py3-none-any.whl

Download URL gpx_concatenator-1.0.8-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c96d9bda7f4ad2698e46de2f23f88244573592b82cd819a99ef9cf4846884f88
BLAKE2b-256 checksum
How to use checksums
8f344df851688a2c7bc5b848192ca7c2eea891ed10f844c5de098bb18e2bedcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page