dabreegster / route_snapper

Draw routes in MapLibre snapped to a street network using client-side routing
https://dabreegster.github.io/route_snapper
Apache License 2.0
147 stars 9 forks source link

Create graphs from GeoJSON with custom costs #49

Closed dabreegster closed 9 months ago

dabreegster commented 9 months ago

Related to #22 and #4 and of possible interest to @tordans. Previously, the only built-in way to create a graph for the route-snapper was to use OpenStreetMap data, ignoring one-ways and using distance as the cost function. Now there's a second tool to turn a GeoJSON file with LineStrings and custom costs into a graph. A demo with custom costs that heavily penalize non-residential roads, causing the routes to zig-zag and avoid arterial roads in Seattle:

(Click to see video, GH isn't embedding webm) clipped.webm