|
7 months ago | |
---|---|---|
script | 7 months ago | |
src | 7 months ago | |
.gitignore | 7 months ago | |
Cargo.lock | 7 months ago | |
Cargo.toml | 7 months ago | |
README.md | 7 months ago |
This is routing engine designed for *.osm.pbf files, written in rust. It is very WIP and very experimental.
You will need a *.osm.pbf file to import. We can use New Brunswick's:
wget http://download.geofabrik.de/north-america/canada/new-brunswick-latest.osm.pbf
Next, we will convert it into a graph and tree. This uses a decent amount of RAM, especially for larger files, but you can use a large swap file if you don't have enough free memory.
cargo run --release -- preprocess new-brunswick-latest.osm.pbf
Finally, we can start the server.
cargo run --release -- serve new-brunswick-latest.osm.pbf
Now, you can POST http://localhost:3030/v1/table
with a body like the following:
{
source: [0, 0],
dests: [[0,1], [1, 2], [13.5, -34.23]]
}
Coordinate order is [lat, lon]. This will return an array of times in milliseconds.
My Ryzen 2700X is able to process 20,000 dests in 1.5 seconds on a single core. Two dests take around 13ms.