Get time and distance spent on each road from a .gpx file. Written in NodeJS.
- Install on your machine using
npm
:
npm install -g gpx-to-roads
- Download a map file from OpenStreetMap using their export tool.
- Use the following command:
gpx-to-roads <gpx file> <map data>
Example:
gpx-to-roads input.gpx map.osm
{
"Some Street": {"distance": 30, "time": 14000}
"Another Street": {"distance": 60, "time": 40000}
}
Result is returned in JSON. distance
is in meters and time
is in milliseconds.
This tool wasn't written with performance in mind. It will most likely struggle with larger GPX files and/or map data.
PRs to improve performance are extremely welcome!