Skip to content

Routing · Self-hosting · In development

Self-host routing from one .glx file

A router needs one .glx file with a routing part and no database. The builder writes that file today. The router is a Rust library with a Cloudflare Worker app around it that reads the file from R2; the source is not public yet and there is nothing to download.

Status · In development

In development, not deployed: there is no routing endpoint to call yet, on geolith.app or api.geolith.app, and no routing plan, price or key.

Detail

The file

The builder writes the routing part from an OpenStreetMap extract.

One .glx file with a routing part: a routing header, a tile index, a zstd dictionary and the graph tiles.
A file can hold a search part and a routing part; each reader reads only its own part.
Add --routing-predicted-speeds <dir> to build historical speeds into the file.
Build command
geolith --output-format routing --osm-pbf berlin.osm.pbf --routing-output berlin-routing.glx

Detail

Worker or server

Both open the file the same way: read the file header, find the routing part, keep the tile index in memory, and fetch blocks as a request needs them.

Cloudflare Worker: the router compiled to WebAssembly, the file in R2, range reads per block. A test Worker runs this today; it is not public.
Server: the same library next to a file on local disk. A packaged server binary is planned.
Both answer the same Valhalla-compatible endpoints: /route, /sources-to-targets, /isochrone, /trace-route, /trace-attributes.
No latency or cost figures: none are measured on a deployed server yet.

Guides

See it in code

Routing · In development

More on routing

Sources

  1. Self-hosting routing (planned), geolith docs (read 2026-11-08)
  2. RFC 9110 §14: Range Requests, IETF (read 2026-10-22)

Routing · In development

Follow routing progress.

Read how the router works today and what has to pass before it is deployed.