Skip to content

Instantly share code, notes, and snippets.

@mkj-is
Last active June 5, 2020 14:53
Show Gist options
  • Save mkj-is/3eab8978cae13773701d93982b827bfd to your computer and use it in GitHub Desktop.
Save mkj-is/3eab8978cae13773701d93982b827bfd to your computer and use it in GitHub Desktop.
Combine GPX files to one GeoJSON
#!/bin/bash
# Decompress all files (only some are compressed, primarily the newer ones)
for filename in *.gz
do
gzip -d $filename
done
# Convert all from GPX to GeoJSON
for filename in *.gpx
do
togeojson $filename > geojsons/$filename.geojson
done
# Merge the files into one in the end
geojson-merge geojsons/*.geojson > combined.geojson
@mkj-is
Copy link
Author

mkj-is commented Mar 27, 2019

Made to convert Strava archive to MapBox tileset.

Used CLI tools:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment