Tool for concatenating GPX files
Project description
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:
-
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. Theconcatenate_files
method extracts tracks from the input files using theGPXFile
class and appends them to the output GPX file's XML structure. If colorization is enabled, theGPXColorizer
class assigns distinct colors to the tracks and adds color metadata to the GPX file. -
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. -
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. -
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 theGPXConcatenator
class with input file paths, an output file path, and flags for metadata and colorization. Theconcatenate_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 --input-dir <input-directory> --output-file <output-file-name> --enable-metadata --enable-coloring
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 --enable-metadata
flag enables metadata in the output file, and the --enable-coloring
flag enables coloring of the tracks.
Command-line Arguments
The following command-line arguments are available:
-
--input-dir
: Specifies the directory containing the input GPX files. The default value isinput
. -
--output-file
: Specifies the name of the output GPX file. The default value isoutput.gpx
. -
--enable-metadata
: Enables metadata in the output GPX file. This is an optional flag. -
--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 --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.
_ _ _
(_) | | (_)
_ __ _ _ __ ___ | |__ _ __ _ __ _ _ __ _ __ __ _
| |/ _` | '_ ` _ \| '_ \| '__| |/ _` | '_ \| '_ \ / _` |
| | (_| | | | | | | |_) | | | | (_| | | | | | | | (_| |
|_|\__,_|_| |_| |_|_.__/|_| |_|\__,_|_| |_|_| |_|\__,_|
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gpx_concatenator-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3ad1fa611bb590d57d5a65d371a580d6bb3d163689be736254630eceff26842 |
|
MD5 | db3c7b3e928b03563da01ea0575c9c42 |
|
BLAKE2b-256 | b208da3695bced97f8cfa53f46fc92a32e667ca7fd1862401793b0299ed9a122 |