https://github.com/grisu48/geojson
GPX to GeoJSON converter
https://github.com/grisu48/geojson
geojson gis gpx
Last synced: 21 days ago
JSON representation
GPX to GeoJSON converter
- Host: GitHub
- URL: https://github.com/grisu48/geojson
- Owner: grisu48
- License: mit
- Created: 2017-08-04T15:12:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-12T20:49:38.000Z (over 4 years ago)
- Last Synced: 2025-02-15T13:17:43.176Z (2 months ago)
- Topics: geojson, gis, gpx
- Language: C++
- Size: 121 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# geoJson

This is a small `gpx` to `geojson` converter tool that I hacked within an hour while chatting. It uses rapidxml and is pretty fast.
Fastest way to use this tool in Linux is to use the pre-build static binaries which are published as releases in this repository.
## Build
rapidxml is included in the repository (version 1.13).
No further dependencies requiredBuild and install the tool with
make
sudo make installThe program will be installed to ``/usr/local/bin` by default
## Usage
Print the help message (right now not so useful)
geoJson -h
By default the program reads from stdin until the end and then parses the input.
Convert the file FILE.gpx to GeoJson
geoJson FILE.gpx
The file prints the GeoJson to standart output. If you want to write it to a file use -o
geoJson FILE.gpx -o FILE.json
## Demo
An an example I provide the following file from Wikiloc: [iceland-landmannalaugar-porsmork.gpx](https://www.wikiloc.com/wikiloc/view.do?id=1120806)
Test it with
geoJson -o iceland-landmannalaugar-porsmork.json iceland-landmannalaugar-porsmork.gpx
This write the file *iceland-landmannalaugar-porsmork.gpx* to *iceland-landmannalaugar-porsmork.json*
### Comparison to togeojsonBack in the time I used the nice tool [togeojson](https://github.com/mapbox/togeojson) for converting a gpx file to geoJson. This tool is written in Node.js
and I wanted hack a simpler and faster tool for doing this task. Although performance is probably not an issue for this task, I took the challenge ;-)Benchmark on my FX-8350 using *togeojson*
$ time togeojson iceland-landmannalaugar-porsmork.gpx >/dev/null
real 0m0.563s
user 0m0.680s
sys 0m0.032sSame input file, same processor, now my tool
$ time geoJson iceland-landmannalaugar-porsmork.gpx >/dev/null
real 0m0.040s
user 0m0.024s
sys 0m0.012sCompare it yourself and feel free to share!