Skip to content

keyan/route_planner

Repository files navigation

route_planner

A road network routing engine modeled after OSRM and built using educational resources provided by Dr. Hannah Bast in her course Efficient Route Planning.

Purely an academic exercise, not intended for production usage.

Overview

A road network router using OpenStreetMap data. Currently the demo server uses A* routing with landmark heuristics.

Screenshot of web frontend

Future improvements:

  1. Replace A* usage with contraction hierarchies
  2. Improved webserver and error handling for clients, currently not clear when attempting to route outside of the configured network
  3. Investigate techniques for handling larger regions, currently OSM XML parsing and connected component computations are very slow for large graphs

Usage

Demo

A live demo using vector tiles provided by MapBox and configured with a small graph containing a region within Seattle WA is available at: http://demo.keyanp.com/route_planner

You can make direct requests to the demo routing server as well:

$ curl http://demo.keyanp.com/route?47.619872,-122.347477,47.598289,-122.334700

Build from source

You will need a C++11 compatible compiler (g++) and make.

Install dependencies (Debian):

$ apt-get update && apt-get install -y g++ make

Install dependencies (MacOSX):

$ brew install make
# Follow prompts to install Xcode developer tools
$ g++

Download boost:

$ make install

Build and run benchmarks:

$ make install build && ./main

Local server

Build and run in server mode:

$ make build && ./main [port]

Development

Run tests with:

$ make test

A Debian VM is provided to allow for use of gdb and valgrind without running into issues with MacOSX:

# Run Debian VM and login
$ vagrant up && vagrant ssh

# Keep local dir in sync with VM (run from host machine)
$ vagrant rsync-auto