Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
convert GraphHopper exported gpx to geojson suitable for importing into umap
# usage: directions.gpx > directions.geojson
# see
mkdir $TMPDIR
ogr2ogr -f geojson $TMPDIR/tr.geojson $1 tracks
jq '.features' $TMPDIR/tr.geojson > $TMPDIR/tracks.geojson
ogr2ogr -f geojson $TMPDIR/rp.geojson $1 route_points
opencc < $TMPDIR/rp.geojson | jq '.features | map(.properties+={_storage_options: {"iconClass": "Ball"}} | )' > $TMPDIR/route_points.geojson
jq -s '.[0] + .[1]' $TMPDIR/tracks.geojson $TMPDIR/route_points.geojson
rm -rf $TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment