a-b-street / utils

Common Rust code used in several projects
Apache License 2.0
0 stars 0 forks source link

Refactor graph code #2

Open dabreegster opened 4 months ago

dabreegster commented 4 months ago

This isn't really related to Sev Snape, I'm just exploring this idea here first.

I'm duplicating lots of backend code between projects to turn OSM data into a graph, do point-to-point routing, and floodfill / calculate isochrones. Some projects are starting to need multiple modes as well, like a-b-street/severance_snape#18 here. If there was something more generic, what would it look like?

Requirements

dabreegster commented 4 months ago

A first idea

Just start very concretely by refactoring code in this project, see if it helps substantially, and then try using in the LTN tool also.

dabreegster commented 4 months ago

Decided to take a simpler approach to start. Instead of serving up a generic graph, just make some common functions that can be used. It's the caller's responsibility to transform the resulting structs into their own objects. Embedding custom data made the final code less structured, and the scraping was simple only for sev snape, not LTN

dabreegster commented 4 months ago

Could consider using in: