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

Fix some issues with the GeoJSON importer #54

Closed dabreegster closed 7 months ago

dabreegster commented 7 months ago

@tordans,

The logic to split LineStrings by shared points seems to work and produce a correct correct graph file now: image

But still the router is acting as if there's no valid roue between nodes that should be connected: image

I'm still not sure what the problem is, continuing to debug

dabreegster commented 7 months ago

An example of the splitting. Before: image

Gets turned into: image

dabreegster commented 7 months ago

Oh. The debugger reveals the node IDs on the edges are completely wrong. There's a very silly problem with the importer somewhere.

dabreegster commented 7 months ago

Alright, the problem is fixed. I blame trying to do vaguely algorithmic work before coffee!

Give GH pages a few minutes to deploy, then try importing again -- everything should work as expected. You can also clone this repo, cd geojson-to-route-snapper; cargo run --release -- --input your_file.geojson