mario-s / gpx_split_rs

GPX file splitter written in Rust
Apache License 2.0
0 stars 0 forks source link

GPX file splitter

This tool can split a route or track in a GPX file into smaller chunks. It will create new files, where each one has a suffix to the filename like so _FILENAME1.gpx.

Inspired by my earlier project which uses Python, but this time in Rust.

Usage

The type of splitting is controlled with command line arguments. Here are some samples to cut a track or route.

The points at a location for splitting must not be embedded in a track or route. For instance the content of POI.gpx would look like this:

<?xml version="1.0"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
creator="Desktop App" version="1.1"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata>
    <link href="http://www.garmin.com">
      <text>Garmin International</text>
    </link>
    <time>2024-01-06T16:25:43Z</time>
    <bounds maxlat="44.025105033069849" maxlon="12.406672211363912" minlat="41.984547637403011" minlon="10.077079888433218"/>
  </metadata>
  <!--this is a splitting point for a track/route -->
  <wpt lat="42.178661786019802" lon="12.14837808161974">
    <ele>0</ele>
    <time>2021-05-11T10:38:41Z</time>
    <name>Agriturismo "Il marchese del grillo"</name>
    <sym>Restaurant</sym>
  </wpt>
</gpx>

Help

gpx_split --help

Verbose

For more information during the process, run the application with the environment variable RUST_LOG

RUST_LOG=debug gpx_split <ARGS>