Skip to content
LocusQ

Router

What it is

A Go gateway with one authenticated API in front of OSRM, Valhalla, GraphHopper and OpenTripPlanner, with graphs built from your own OSM extract and GTFS.

Route and nearest go to OSRM, matrix and trip to Valhalla, match and isochrone to GraphHopper, and transit to OpenTripPlanner. The map is fixed, so an answer always comes from the same engine.

No country is built in. make graphs downloads an OSM extract and an optional GTFS feed, checks their checksums, builds every engine's graph in capped containers and reuses unchanged inputs.

The gateway refuses to start without an API key, binds 127.0.0.1, rate-limits /v1 per client IP before checking the key, and serves /metrics only on an internal port.

Install

The repositories and packages are private while LocusQ is in private release. Ask for access and say which tools you need.

Build graphs

Needs Docker with Compose v2 and nothing else on the host. Each build step waits for enough free memory and runs in its own capped container.

bash
export ROUTER_CACHE_DIR=$HOME/.cache/locusq
make graphs COUNTRY=<name>

Start the gateway and engines

Profiles are osrm, valhalla, graphhopper, otp and monitoring. Only the gateway publishes a port, 127.0.0.1:8080 by default.

bash
export ROUTER_API_KEYS="$(openssl rand -hex 24)"   # comma-separated, each >= 16 chars
export ROUTER_TIMEZONE=Europe/Paris                  # the graph's IANA zone (transit date+time)
export ROUTER_PROBE_POINT=2.35,48.85                 # lon,lat inside your OSRM graph (required with OSRM)
export ROUTER_UID=$(id -u) ROUTER_GID=$(id -g)       # the uid that built the graphs (GraphHopper writes a lock file)
docker compose --profile osrm --profile valhalla up -d --build
curl -s http://127.0.0.1:8080/health

Minimal usage

Clients send Authorization: Bearer <key>. The capability layer wraps the engine answer in an envelope; the engine layer (/v1/router/{direction,navigation,graph,transit}/...) relays it unchanged.

bash
curl -s http://127.0.0.1:8080/health

Product page: Router. Release notes: Changelog.