This is a tool for processing GPS data in GPX format. It provides four subcommands:
gpx from-toml [FILENAME]
: converts a TOML file into a GPX filegpx json-coords [FILENAME]
: extracts coordinates from a GPX filegpx reduce-points [OPTIONS] FILENAME
: compresses a GPX file by reducing the number of pointsgpx reduce-precision [OPTIONS] FILENAME
: reduces the precision of a GPX file's lat/lon values
To install the program, run the following command:
go get github.com/stayradiated/gpx-cli
To use the program, run the gpx
command followed by the subcommand you want to use. For example, to extract coordinates from a GPX file, run:
gpx json-coords path/to/gpx/file.gpx
Each subcommand has its own set of options and arguments. To see the available options and arguments for a subcommand, run:
gpx [SUBCOMMAND] --help
To convert a TOML file into a GPX file, run:
gpx from-toml path/to/toml/file.toml > path/to/gpx/file.gpx
This will write the GPX file to the specified file path.
To extract coordinates from a GPX file, run:
gpx json-coords path/to/gpx/file.gpx
This will print the coordinates to standard output in JSON format.
To compress a GPX file by reducing the number of points, run:
gpx reduce-points --count=100 path/to/gpx/file.gpx > path/to/compressed/gpx/file.gpx
This will compress the GPX file by reducing the number of points to 100 and write the compressed file to the specified file path.
To reduce the precision of a GPX file's lat/lon values, run:
gpx reduce-precision --precision=4 path/to/gpx/file.gpx > path/to/reduced-precision/gpx/file.gpx
This will reduce the precision of the GPX file's lat/lon values to 4 decimal places and write the result to the specified file path.
This program is licensed under the MIT license. See the LICENSE
file for more information.