Skip to content

wheelstransit/wheels-router-nano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheels Router Nano

License: MIT Demo (Hong Kong)

Wheels Router Nano is:

  • a multi-modal trip planner
  • should runs on WASM
  • uses least data as possible
  • no bloat, but no code golf as well

Wheels Router Nano is not Wheels Router Service. Wheels Router Nano does not account for the fares, and might have differances in it's results.

Nano is not designed to handle large feeds, although it may have the capability to do so. Check out MOTIS!

Maintained by Wheels Labs, a part of Wheels Softworks

Contributing

  • We welcome code contributions. however, ai slop pull request will be closed instantly.
  • if you did use AI in the process, read it yourself before submitting the PR. remove anything you don't need. make sure every line is correct, necessary, and as clean as it can be. because if you aren't willing to put in that time, why should we?

Setup

Prerequisites: Rust, wasm-pack

Build the data file from a GTFS zip and optional OSM extract:

cargo build -p pipeline-rs --release
./target/release/pipeline --gtfs data/gtfs.zip --osm data/region.osm.pbf -o data/region.wheelsrouter

OSM is optional. Without it, transfers use a 3 km radius instead of the walk graph:

./target/release/pipeline --gtfs data/gtfs.zip -o data/region.wheelsrouter

Build the WASM package:

wasm-pack build --target web --out-dir pkg --release -- --features wasm

Usage

From Rust:

let bytes = std::fs::read("data/region.wheelsrouter").unwrap();
let router = wheels_router_nano::Router::load(&bytes).unwrap();

let result_json = router.plan_json(r#"{
    "origin": "37.793,-122.397",
    "destination": "37.788,-122.417",
    "depart_at": "2026-03-09T10:00:00Z",
    "max_results": 5
}"#).unwrap();

From WASM/JS:

import init, { WasmRouter } from './pkg/wheels_router_nano.js';

await init();
const data = new Uint8Array(await (await fetch('data/region.wheelsrouter')).arrayBuffer());
const router = new WasmRouter(data);

const plans = router.plan({
    origin: '37.793,-122.397',
    destination: '37.788,-122.417',
    depart_at: '2026-03-09T10:00:00Z',
    max_results: 5,
});

Request parameters:

Parameter Required Description
origin yes "lat,lon"
destination yes "lat,lon"
depart_at no ISO 8601 departure time (UTC)
max_results no max plans to return (default 15)
max_transfers no max transfers allowed (default 3)
max_walk_distance no max access/egress walk in meters (default 1600)
walking_speed no "slow", "normal", or "fast"
Wheels Labs

About

100% local RAPTOR based trip planner with pedestrian support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors