Match GPS traces against OpenStreetMap data to find where you haven't gone yet.
This is a weekend hack, and setting things up is going to be somewhat manual. If you want a version of this tool that works well, check out wandrer.earth.
All of the heavy lifting is outsourced to some core parts of the OpenStreetMap software stack:
osmium
for filtering a OSM PBF exportgpsbabel
for converting FIT files into GPXpostgis
for geospatial storage + queryingosm2pgsql
to ingest OSM data intopostgis
ogr2ogr
/gdal
to ingest GPX files intopostgis
carto
/kosmtik
for map stylingmapnik
to render tiles
For more information about how these pieces fit together, see switch2osm.
Matching GPS traces to OSM paths is done through a rather naive distance check. A more fully-fledged implementation of this idea would use map-matching, as provided by a tool like GraphHopper or OSRM.
mkdir -p data/
# Any file ending in [.fit, .fit.gz, .gpx, .gpx.gz] will be processed.
cp -R YOUR-GPS-TRACES-DIR/ data/traces/
# Bring up our database
docker-compose up postgis -d
# This does a lot of work, `make` could take a while:
#
# 1. Download region extract from geofabrik
# 2. Process region extract and ingest to database
# 3. Split OSM ways into smaller segments
# 4. Ingest GPS traces to database
# 5. Match each GPS trace point against the ingested segments
make
# Bring up kosmtik on http://127.0.0.1:6789/
docker-compose up
This project reuses some code from GPL-2.0-licensed osm2pgsql, meaning this repository falls under the same conditions.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.