A routing engine compatible with *.osm.pbf files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Stephen 3826c6e314 Decreased RAM requirements 2 months ago
script First commit 2 months ago
src Decreased RAM requirements 2 months ago
.gitignore First commit 2 months ago
Cargo.lock First commit 2 months ago
Cargo.toml First commit 2 months ago
README.md Decreased RAM requirements 2 months ago

README.md

Rustic Roads

This is routing engine designed for *.osm.pbf files, written in rust. It is very WIP and very experimental.

TODO

  • More API endpoints
  • Take intersections into account when calculating time
  • Better road speed defaults
  • Lower RAM usage

Usage

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.

Performance

My Ryzen 2700X is able to process 20,000 dests in 1.5 seconds on a single core. Two dests take around 13ms.