VIGO 1.0.0Open-source transit routing you can explain
Build a network. Answer a transport question.
VIGO 1.0.0 turns GTFS timetables and OpenStreetMap streets into a reusable City, then answers three questions about it: how to make a journey, how long every trip takes, and how far people can get. It runs on your own machine, explains each answer, and never needs an internet connection to route.
A Scenario changes the service one query sees, such as a new line or a removed route, so you can measure a proposal against today's network. Compare sets two saved Results side by side without routing again.
Choose your interface
Interface
Best for
What it needs
Engine (vigo)
Queries, resident streams and the HTTP API
One native executable; no Node, Python or network access
Compiler (vigo.mjs)
Building Cities and scenario collections; it can also query them
Node.js 24.18 or newer, with its bundled native kernel
Studio
Inspecting service, planning journeys, and exploring Reach and scenarios
The desktop application
Python (import vigo)
Studies, batches, notebooks and journey tables
A platform wheel with a headless engine
The engine, the compiler and Python open the same City directories, and for the same City and request the engine and the compiler return the same public JSON Result.
Built to be explained
Every answer carries its evidence. A Route Result says whether each walk follows mapped streets or an assumed station link. A Matrix keeps unreachable pairs null, never zero. A Reach surface records its grid so two runs can be compared cell by cell. Known limits state plainly what the model does not establish.
Exact search. Transit is one exact connection scan over the prepared timetable, with published transfer rules and frequencies. See how VIGO computes answers.
Stable data. Published Cities stay readable by later releases without rebuilding. See the prepared-data contract.
Stable results. The public vigo.route.v1, vigo.matrix.v1 and vigo.reach.v1 schemas only gain optional fields. See public results.
Offline. Queries never fetch anything. This guide works offline too: press / to search, and open saved Results in the Result viewer.
How this guide is organized
Section
Read it to
Get started
Install VIGO, build a City and learn the four core ideas
Guides
Do one task: build a City, plan journeys, compute matrices, map Reach, test a scenario, use live data
Studio
Use the desktop application
Deploy and operate
Run the HTTP service, size it, upgrade it
Reference
Look up every command, flag, request field, Result field, endpoint and environment variable
How VIGO works
Understand the algorithms, what is exact, and what the model leaves out
VIGO has four entry points. Most projects need only the engine: vigo build compiles a City once from raw data, and vigo answers queries from it for as long as you like. The compiler runs the same build and queries from Node.js.
You want to
Install
Requirements
Build Cities from GTFS and OSM, query them or serve HTTP
Engine archive (VIGO-Rust-…)
Nothing else
The same from Node.js tooling
Compiler archive (VIGO-CLI-…)
Node.js 24.18 or newer
Explore networks visually
VIGO Studio (VIGO-Studio-…)
The desktop application
Script analyses and notebooks
VIGO Python (VIGO-Python-…)
Python 3.10 or newer and the wheel for your platform
Download archives from VIGO releases. Each archive targets one operating system and CPU; City data moves freely between the supported 64-bit platforms. Each archive has a .sha256 checksum, and the engine and compiler archives hold a manifest.json that hashes every file.
Engine
Extract the engine archive and check the executable:
The executable contains the routing kernels, the City loader, the JSON interface, the HTTP server and SQLite. The archive also holds this guide (guide.html), the OpenAPI document, the engine reference as README.md, the native field reference, a verification record and licenses.
Compiler
The compiler archive contains vigo.mjs, its matching native kernel (vigo-routing-kernel.node), the vigo executable it uses for Reach, license notices and a checksum manifest. Keep the files together and check them with Node.js 24.18 or newer:
The compiler builds Cities and scenario collections and runs Route, Matrix, Reach, Stream and Compare against them. It bundles neither Node nor City data. Its reference is the compiler guide, which ships in the archive as README.md.
Build from source
Use Node.js 24.18 or newer, npm 11.6 or newer, the Rust toolchain pinned in rust-toolchain.toml, and a C toolchain for the bundled SQLite. Build on the operating system and CPU that will run VIGO:
Shell
git clone https://github.com/hytangs/vigo.git
cd vigo
npm ci
npm run build:cli-runtime
npm run build:standalone
build:cli-runtime produces the compiler, public/vigo.mjs, and its native kernel. build:standalone produces the engine at target/release/vigo. npm run build also compiles Studio, and npm run studio opens it. On a machine with 4 GiB of memory or less, the build selects low-memory compiler settings automatically; see build from source on a small machine.
Name the commands
The guides call the engine vigo and the compiler vigo-build. In a POSIX shell:
Shell
alias vigo="/absolute/path/to/vigo"
alias vigo-build='node "/absolute/path/to/vigo.mjs"'
From a source checkout, point them at target/release/vigo and public/vigo.mjs. On Windows, use .\vigo.exe and node .\vigo.mjs, or define your own functions. Both accept --name value and --name=value and reject unknown options.
Studio and Python
VIGO Studio is the desktop workspace. It imports GTFS and OSM into its own project library and opens this guide offline under Settings → Documentation. See VIGO Studio. macOS Studio builds are ad hoc signed, not notarized: if macOS blocks the first launch, verify the download's checksum, then choose Open Anyway under System Settings → Privacy & Security.
VIGO Python is versioned separately and its platform wheels include a headless engine. Follow your first Python query.
Supported platforms
macOS 13.5 or newer on Apple Silicon (Python wheels need macOS 14), Linux with glibc 2.39 or newer on x64 and ARM64 (built on Ubuntu 24.04), and Windows x64. There are no 32-bit or Windows ARM64 binaries. For an older Linux, build from source there.
In about ten minutes you will build a City for Boston and Cambridge from public data, plan a journey from Harvard Square to South Station, compute a small matrix, and map where you can reach in 45 minutes. A City is the prepared data directory, here ./boston.
You need the engine, named vigo, plus curl, unzip and Osmium Tool. The commands use a POSIX shell; on Windows, use WSL for the download and extract steps.
feed_start_date and feed_end_date give the published interval. The feed used to check this tutorial covers 2026-09-25 through 2026-12-12, and the examples use Monday 2026-10-05. With a later download, pick a date inside its interval and check calendar.txt and calendar_dates.txt: a date inside the interval does not mean every route runs that day. Times are local MBTA service times in America/New_York.
2. Build the City
Cut a smaller street extract around central Boston and Cambridge, then build:
The complete-ways strategy keeps every node of the ways crossing the rectangle. This extract covers the tutorial's places, not street access for the whole MBTA network; for a wider study, enlarge it or use the full Massachusetts PBF. --prepare-date compiles that day's timetable now, so a fresh engine process does not have to. Keep the providers' notices when you share data; see OpenStreetMap attribution.
VIGO writes one complete ./boston directory and leaves an existing output alone unless you pass --replace. vigo info shows the City's name, revision, sources, counts and limitations. Keep the whole directory: the inspection output identifies the City but contains no routing data.
3. Plan a journey
Save route.json. Coordinates are [longitude, latitude]:
In a terminal, the first command prints a short itinerary; the second saves the full JSON Result. To ask when to leave to arrive by 09:00, override the clock and the time direction:
Flags override fields in the request file. In JSON, the same choice is "time": "09:00", "timePreference": "arrive_by", which both runtimes accept.
4. Read the Result
Read status first. ok comes with a journey; not_found is a valid answer meaning no journey meets the date, walking limit, transfer cap and horizon you asked for. Then read journey.departureTime, journey.arrivalTime and the ordered journey.legs. Clocks are local service-day HH:MM:SS; durations are whole seconds.
Trip IDs and times depend on the feed you downloaded, and this is scheduled routing without live delays. Check warnings and each walk's quality before treating a path as passenger guidance; walking evidence explains station costs and assumed links. Open route-result.json in the Result viewer to see it as a timeline.
5. Compute a matrix
Save matrix.json. The rows are Harvard Square and Kendall Square; the columns are South Station and Copley Square:
surface.valuesSeconds is a row-major raster starting at the northwest corner, and areas holds a GeoJSON polygon for each cutoff. A Reach surface is modeled travel time; it is not a count of jobs or people. See Reach.
7. Keep the City loaded
A one-off command opens the City every time. For repeated work, keep one process resident. Save queries.ndjson with one request per line:
Each output line echoes its id; check every status, because one failed line does not end the stream. To serve applications over HTTP, start the service and call it from a second terminal:
Open http://127.0.0.1:8080/ to read this guide from the running service and send requests from the API console on the HTTP API page. When you measure speed, keep the City build, a fresh process's first answer, and answers from a resident process separate.
VIGO has four nouns and three questions. Once these are clear, every interface behaves the way you expect.
GTFS + OSM ──build──▶ City ──(optional Scenario)──▶ Route | Matrix | Reach ──▶ Result
City
A City is a compiled model of a transport network, built from GTFS and OSM. It is one complete directory, so its timetable, streets and prepared indexes cannot drift apart. Each build is a new, immutable revision; Scenarios and Results stay tied to the revision that produced them.
A City reopens without its raw GTFS or OSM. Building prepares the street indexes and station access. The first query for a new set of active services prepares a timetable, which --prepare-date can do ahead of time; dates with the same active services share it. A resident process keeps everything ready between queries. Changing the underlying data needs a new build.
Scenario
A Scenario is an immutable set of changes applied to one City revision: planned service changes, one live transit state, or one supplied traffic state. Requests carry them as scenario, realtimeSnapshot and traffic. Walking limits, departure times and cutoffs remain query options, and a complete alternative GTFS feed is a new City revision, not a Scenario.
VIGO rejects an unsupported combination before computing. It never silently drops a change or moves a Scenario to another City revision. See Scenarios.
Query
Query
What it computes
Notes
Route
Travel between ordered places, with legs, transfers and walking
Depart-at or arrive-by; via points, alternatives and departure windows are options
Matrix
Travel time between sets of origins and destinations
A single origin is a one-row Matrix; journeys are optional
Reach
Where the network can take you within stated time limits
As reached streets, areas or contours
Depart-at minimizes arrival time, then boardings, then walking. Arrive-by maximizes departure time; among journeys leaving at that time and arriving by the deadline, it minimizes boardings, walking and actual arrival.
Reach is not accessibility. An accessibility measure also needs opportunities, such as jobs, people, schools or clinics, and a stated way to combine them.
Result
A Result is the immutable answer to one Query: status, values, warnings, the City revision, the Scenario if any, and metadata to reproduce it. Compare is an action on two compatible Results, not a fourth query. Keep the original request and the full Result together; the query echo is useful but does not archive every input. See public results.
Choose a supported combination
Query
Travel mode
Time
Supplied changes or observations
Route
Transit
Depart-at or arrive-by; via points and windows have their own rules
Realtime Trip Updates and Alerts; a planned-service Scenario in the engine
Route
Walk, Drive or Bike
Either direction; a dated Bike route checks timed roads and turns
Traffic for Drive
Matrix
Transit
A shared departure or deadline
Realtime Trip Updates in the engine
Matrix
Walk, Drive or Bike
Street travel times; a dated Bike matrix checks timed roads and turns
Traffic for Drive
Reach
Transit with walking, Walk, Drive or Bike
Depart-at from an origin or arrive-by at a destination
A planned-service Scenario and realtime Trip Updates for transit in the engine
"In the engine" means the vigo executable and its HTTP API; the compiler and Python reject that combination. vigo capabilities describes the build you run. Queries default to scheduled data. Traffic needs both the traffic object and routingDataMode: "realtime"; VIGO never fetches a traffic provider unless vigo serve is told to poll one. A visible vehicle, an alert or an added trip is not by itself a routing update.
Outcomes
Route and Reach Results use ok or not_found. A completed Matrix is ok, with null for unreachable cells.
An invalid or unsupported request fails with an error: exit code 2, or HTTP 4xx. A failure during computation is an error too, never a Result.
Python Results use ready and blocked; those names belong to the Python API.
Studio background tasks report queued, running, ready, cancelled or error.
Time
Service dates use the City's timetable timezone. A GTFS event at 25:10 belongs to the service date it was published on, even though it happens after midnight. Request clocks may exceed 24 hours, so always give the exact service date with the clock. Realtime observation timestamps are a separate clock, used only to admit or reject predictions.
VIGO keeps four durations separate: Build, Open, Compute and End-to-end. Reusing an open process saves opening work; it never reuses an answer.
A City is built once by vigo build and then opened read-only by any number of engine processes, Python sessions or compiler queries. The compiler's vigo-build build and Python's vigo.build() run the same Rust compiler and write the same City. The quickstart shows a complete Boston build; the engine reference lists every option.
Choose inputs
Input
Requirement
GTFS
One or more static GTFS ZIP files
OSM
One .osm.pbf covering every origin, destination, stop and transfer location you will query
Keep the original files, their checksums and their download date: URLs such as latest are not frozen datasets. GTFS support lists the GTFS features VIGO uses and those it reports as unsupported.
Reuse identical prepared streets from another City
--replace
Replace an existing output
A build is staged: a failed build leaves the previous City in place. --replace writes and flushes the new City first, then swaps it in; if a crash interrupts the swap, the next build or compiler query of that path finishes or reverts it. Ctrl-C or a termination signal removes the unfinished build. A successful replacement removes its backup, so use a separate output directory when you need a rollback copy.
Import and street preparation happen at build time and are separate from query time.
Combine several GTFS feeds
Repeat --gtfs and give each feed a stable, unique scope:
A scope names a source feed, not a route. The combined City namespaces stops, routes, trips, services and transfers by scope, so equal IDs in different feeds never collide. Use the same scopes when you rebuild the same sources. In Studio, add each ZIP under City → Data sources; removing a feed rebuilds the combined timetable from the rest.
Before combining feeds:
Use compatible service dates: a trip runs only on days its own calendar activates.
Keep all agencies in one timezone. A City with several agency timezones cannot route.
Avoid importing two editions of one agency's timetable unless you mean to.
Keep declared transfers and check street coverage between the feeds. Nearby stops alone do not prove a usable connection.
Large regions and low memory
Builds use disk-backed SQLite temporary storage and compact node lookups, report progress during long phases, and compile GTFS and OSM at the same time only when installed memory, free memory and load allow it. Each step releases its working memory before the next. Keep the output and temporary directory on a local filesystem (inside WSL, the Linux filesystem rather than /mnt/c), with room for the source database, temporary sorts and the finished City.
Regional street preprocessing can still exceed 2 GiB. Add disk-backed swap on the build machine, or build on a larger machine and copy the complete City to the server: build memory and query memory are separate requirements.
Driving preparation accepts up to 40 million vertices (VIGO_DRIVE_ACCELERATOR_MAX_NODES) and 20 million edges (VIGO_DRIVE_ACCELERATOR_MAX_EDGES), which fits national extracts such as Switzerland's. A larger network fails with its counts; raise the limits, or omit driving with --street-modes walk or walk,bike. Street preparation must write the walking index before the City is sealed, so a City that could not open is never published.
Timetable repairs
A build repairs small backward arrival or departure times by delaying an event to the one before it, by at most ten minutes per event. Stops, trips and permissions are kept, and the GTFS file is unchanged. Trips that need a larger correction are excluded whole. Repairs (repaired_trip_times, marked approximate) and exclusions (backward_trip_times) appear as build warnings and in the City's limitations, with up to 32 example trip IDs. Published times such as 24:10:00 are valid; a reset to 00:10:00 is not read as the next day. Broken references and duplicate stop sequences still fail the build.
Copy and load a City
A City contains network.json, routing/project.sqlite, prepared access files, and an osm directory with street snapshots, access profiles and hierarchy indexes. Member names vary with the preparation version. Copy the whole directory, never single files.
The engine checks source identities, formats, station and access profiles, and required index files. It rejects missing or stale preparations and an unexpected SQLite WAL. Complete a City by building it again; never delete WAL files to get past validation. The engine reports timing.timetableSource: "prepared_snapshot" in the trace when it reuses a prepared timetable, and "source" when it prepared one from SQLite; both give the same schedule.
Update a network
Treat a published City as immutable while any process has it open. Build updates into a new directory, start a service on it, check readiness and a known query, switch traffic, then stop the old service. The engine has no upload endpoint, downloader or hot reload. See Upgrade and rollback.
Older Cities may lack optional street names for map points. The prepared-data contract shows how to add them without rebuilding.
Scenario collections
To compare several timetables over one street network, build a scenario collection: one shared street graph, several transit scenarios and a default. Each request picks a member with scenarioId. See Scenario collections for the manifest.
Check status, then the chronological journey.legs. A not_found Result can reflect the date, the timetable, street access or your constraints; it does not mean the places are disconnected. When no journey is found lists the checks.
Walking and transit
Transit Route and Matrix compare a direct OSM walk by default, so a short trip between coordinates can return walking when it arrives sooner. Set requireTransitRide: true to require a boarding, or "mode": "walk" to ask for walking alone.
maxWalkKm (default 1.2) limits each walk to and from transit.
A direct walk is limited by maxStreetKm (default 50), or by maxWalkKm when allowLongWalk is false. Walk mode always uses maxStreetKm, which accepts 0.05–1000 km.
horizonMinutes (default 480, 1–2880) bounds the timetable search. For depart-at transit, every boarding and alighting must happen within it, but the final walk can finish after it: the horizon is not a door-to-door limit.
allowStreetTransfers: false keeps changes to the same stop or to members of one station. Walking to the first stop and from the last stays allowed. Studio calls this Allow walks between stations or stops.
Transfers and time reserves
maxTransfers accepts 0–31: 0 allows one boarding, 1 two. Staying aboard the same vehicle is not a transfer. The cap constrains the search itself, so a slower route is found when the fastest one has too many changes. A finite cap cannot be combined with transit via points.
minimumTransferBufferMinutes (0–60, default 0) adds time before each later boarding, after the transfer walk and the feed's own minimum transfer time. It never delays the first boarding, the final walk or staying aboard. arrivalBufferMinutes plans an arrive-by request against an earlier deadline. Both are planning margins, not delay predictions; see Time reserves.
The engine adds no buffer of its own. Same-stop changes honor published GTFS minimum transfer times and forbidden transfers, and a published platform-to-platform rule takes precedence over the station walking fallback. Studio starts with a one-minute buffer, which Preferences can change.
How a journey is chosen
VIGO's objective is earliest arrival. Equal arrivals prefer fewer boardings, then less walking, then a stable order. Arrive-by first finds the latest departure; among journeys leaving then and arriving by the deadline, it prefers fewer boardings, less walking, then earlier actual arrival, so a slightly later on-time arrival can avoid a needless change.
Via-point routes compare complete journeys, so walking a segment can replace a short ride when both catch the same onward vehicle. Up to eight partial journeys are kept at each via point and up to five complete choices are returned; this bounded search does not list every itinerary. How VIGO computes answers explains the algorithm and its guarantees.
Several journeys
Alternatives."alternatives": 3 asks a depart-at transit Route for more journeys at the requested time. The default pareto ranking keeps genuine trade-offs between arrival, boardings and walking; "alternativeRanking": "ranked" lists the earliest distinct journeys, even when one beats another in every respect. See alternative journeys.
Departure windows. The engine's windowMinutes repeats the search every minute toward later departures (or earlier deadlines) and keeps up to five distinct choices. The compiler's departureWindowMinutes is a centered depart-at window of ±0–30 minutes. Windows sample whole minutes; they are not continuous timetable profiles. See journey windows.
Services on the same leg.sharedLegs: true lists other trips that could replace one leg, with their observed frequency. See shared-leg services.
Read the Result
The public vigo.route.v1 Result contains status, a journey with chronological legs and durations in seconds, warnings, and meta. Every leg has a quality that says where its line came from and whether its street path was verified. Public results defines every field.
When no journey is found
A not_found Result has journey: null, a reason (code and message) and an access report for each end. Each report gives the maximumWalkMeters searched, the candidateCount of stops found, and a code:
access.*.code
Meaning
available
Stops were reached; the failure lies in the timetable or the limits
outside_selected_budget
No stop within maxWalkKm, but one within the wider probeWalkMeters; suggestedWalkMeters is its distance. A wider limit is a new question, and still may not give a journey
street_access_unverified
A stop is near in a straight line (nearestStop), but no walking path reaches it
none_within_walk_budget
The point attaches to the streets, but no stop is within the limit or the probe
The point lies outside the City's streets; coverageBounds gives their extent
station_access_unavailable
A named stop has no usable access in this City
VIGO never raises your walking limit by itself. no_path means no scheduled itinerary under the request's limits on that date; changing a limit is a new question, so save it as a new request. diagnostics: "trace" adds the search limits and candidate details.
Stations, access and geometry
Free coordinates and GTFS stops attach to the nearest street the same way in Route and Matrix. A parent station does not give free movement between its platforms: declared station paths keep their direction and time. When GTFS omits a pathway's traversal_time, VIGO prices its length at walking speed; stairs and fare gates without times use labeled estimates. A missing time never becomes a zero-time link. Walking evidence explains station costs in detail.
The walking limit covers each continuous walk to or from transit; a transfer walk cannot extend the final walk past it. A point that snaps to the street carries an endpointConnector on its first or last walk: the straight hop already included in the cost, with streetPathVerified: false. A connector is not evidence of a mapped or legal path.
Matrix calculates travel times between sets of origins and destinations in one request, from a shared departure or to a shared deadline. The Matrix reference lists every field.
Send a matrix request
To find when people must leave several places to reach one destination by 09:00, save arrival-matrix.json:
Use exact stop IDs ({"stopId": "..."}) or coordinates. Walk, Drive and Bike matrices need coordinates.
Read the result
durationsSeconds[originIndex][destinationIndex] gives each pair's time, in request order. null means unreachable, never a zero-minute trip, and a completed matrix can contain both. With includeJourneys: true, journeys has the same shape; includeGeometry: true adds lines to them without another search.
For arrive-by, every pair shares the deadline, and a duration runs from the latest departure to the deadline, so it includes any wait at the destination. The matching journey gives the actual arrival. Use includeJourneys: false when only times matter.
Choose constraints
The Route rules apply: a direct walk competes unless requireTransitRide: true; maxWalkKm bounds each walk to and from transit; maxTransfers accepts 0–31; horizonMinutes bounds the timetable search, not the trip. allowStreetTransfers, minimumTransferBufferMinutes and arrivalBufferMinutes behave as in Route.
Transit Matrix uses the scheduled timetable, or a realtime snapshot in the engine. Drive Matrix can use supplied traffic; see Streets and traffic.
Share work across pairs
Results keep input order, including repeated endpoints. The engine accepts up to 65,536 pairs in an 8 MiB request; the compiler accepts up to 100,000 pairs in 16 MiB. Pairs share timetable searches:
Workload
Timetable searches
Depart-at, one origin, many destinations
One forward scan
Depart-at, many origins
One forward scan per distinct origin
Arrive-by, many origins, one destination
One reverse scan
Arrive-by, many destinations
One reverse scan per distinct destination
So group work by shared endpoint, date, clock and constraints, and request times only when that is all you need. Matrix journeys can pick a different equally good journey than Route when ties exist. disableCache: true skips endpoint caches but keeps same-request sharing and the loaded City.
Reach finds the streets and areas reachable from one origin within a time budget, by transit with walking, or by walking, driving or cycling alone. Arrive-by Reach asks the reverse: from where a destination can be reached by a deadline. The Reach reference lists every field.
mode: "walk" maps walking alone and needs no service date. mode: "drive" routes to each cell center over the directed road network with free-flow speeds; it takes no traffic or transit scenario. mode: "bike" needs a City with bicycle streets. The engine can also run transit Reach on a realtime snapshot; the compiler and Python keep Reach scheduled.
For arrive-by Reach, send a destination instead of an origin, with "timePreference": "arrive_by" and the deadline as time. Each value is how long before the deadline a traveler must leave that place, including any wait after an early arrival. Walking keeps each street's permitted direction toward the destination.
Set the analysis resolution
Option
Meaning
cutoffsMinutes
Time budgets, 1–240 minutes; fractions allowed
maxWalkKm
Walking budget for transit Reach
walkSpeedKph
Walking speed, 1–8 km/h
extentRadiusKm
Extent of the grid, 1–40 km
rasterSize
Cells per side: the engine accepts 16–1024; the compiler 48, 64, 96, 128, 192, 256, 384, 512 or 1024
surfaceSampling
street samples reached streets; cell-center routes to each cell's center
The extent sets the analysis grid; it is not a trip-distance limit. Cutoffs, walking limits and the network decide what is reachable. Keep extent, resolution, sampling and constraints identical when comparing Results.
Choose the output
The default reachFormat: "full" returns the requested grid and the full reached extent. surface.valuesSeconds is row-major from the northwest corner, with null for unreached cells; read it with its bounds and dimensions. fullSurface covers the full reached extent when it differs.
areas are GeoJSON polygons around reachable cells, with holes and islands kept. contours interpolate the sampled times. The raster stays the reference for numbers. For a map, reachFormat: "map" returns only the full reached-area polygons and their bounds; map output cannot be compared. includeStreetEdges: true (--street-edges) adds the directed street intervals reached; see street evidence.
Compare with R5 and OTP
Street sampling records the earliest reached part of each street in a cell and leaves cells away from reached streets empty; a filled cell does not establish a route to its center, and area totals count sampled cells, not walkable land. Use surfaceSampling: "cell-center" for a surface of travel times to grid points.
When comparing tools, match the origin, date, departure time, modes, walking and transfer rules, cutoff, extent and grid before comparing polygons. VIGO Reach evaluates one departure time. Conveyal's R5 can summarize a departure window at a chosen percentile, and OTP's Travel Time API uses a departure-time snapshot, so match the time statistic first; VIGO's Monte Carlo option computes window percentiles. VIGO rasters are in seconds, while requests use cutoffsMinutes.
For a numerical comparison, compute travel times to the same coordinates with Matrix, then classify them at the same cutoff. A longitude/latitude grid and a Web Mercator grid do not share cell centers. Check station entrance costs, boarding slack and GTFS transfer minimums in representative journeys. For a transit Matrix that matches Reach's walking budget, set requireTransitRide: false and allowLongWalk: false. See Conveyal's methodology, OTP's Travel Time API and the GTFS transfer rules.
All-day Reach
The engine's allDay option repeats depart-at transit Reach every five minutes over a service-day window and reports, for each cell, how many departures reach it within each cutoff. It is a measure of how often a place is reachable, not of jobs or people. See All-day Reach.
A Scenario is an immutable set of planned changes tied to exactly one City revision. Scenarios never edit the imported GTFS or OSM. Several compatible changes can coexist; conflicts need an explicit resolution. Drawing a line in an editor changes nothing until it is attached to a valid service.
In VIGO 1.0.0, planned service changes apply to transit Reach in every runtime, and to transit Route in the engine and in Studio. The Scenario reference lists every field.
Planned service
A planned service states what changes and enough to run it: ordered stops, travel times, and a departure schedule. A Reach request can include this scenario:
operation is add, augment or replace. excludedRouteIds and excludedTripIds remove scheduled service.
Replace a branch and keep its trips
replace defaults to scheduleMode: "preserve-trips" and needs sourceRouteId, sourcePatternId and the selected-branch scope. Studio and the compiler load the trips active on the query's service date, including calendar exceptions, and the previous day's trips still running after midnight. Each affected trip gets exactly one replacement, keeping irregular gaps, per-trip running times, dwell, and pickup and drop-off restrictions. Editing stops never adds departures or reverse service.
When a branch keeps its trips, the road path divides each trip's original running time among the edited gaps. Retained stops keep their dwell; addedStopDwellMinutes (default 0.35) adds dwell at inserted stops. The first retained stop anchors the timing: an extension before it departs earlier, and later edits shift downstream times. At least one original stop must remain. These are modeled times, not a vehicle or crew schedule.
Set a frequency instead
To change the timetable deliberately, use scheduleMode: "frequency" with headwayMinutes, startMinutes and endMinutes; Studio calls this Departures → Set frequency and hours. It can replace a whole route, and add and augment use it by default. New lines take road timing from segmentDistancesKm and averageSpeedKph, plus dwellMinutes. Reverse service is an explicit choice. A run arrives, dwells, then departs, and does not dwell at either end. A frequency service runs every service day, including runs that continue past midnight.
Edit a shared edge in Studio
Selected branch only keeps a change on the chosen pattern. All branches serving this exact A → B edge applies one inserted gap to every occurrence of that ordered stop pair on the same feed and route, but not to B → A. The editor lists the affected branches before running. Use selected-branch scope for moved stops, extensions or several gaps. Studio requires a completed road path before running a road-following Scenario.
Test a planned service change
Run a baseline Reach and a Scenario Reach with the same origin, date, time, walking assumptions, sampling and grid. Save baseline-reach.json:
The speed, headway and hours are illustrative; the defaults add service in both directions with 0.35 minutes of dwell. This does not establish a drivable alignment, an achievable running time or a vehicle requirement.
Run both and compare the saved Results with the compiler:
Compare reports after minus before. counts splits cells reachable in both into faster, slower and unchanged, and counts newly and no-longer-reachable cells separately; a negative meanChangeSeconds means faster modeled travel among the comparable cells. Read all counts together. Compare checks the grid but not every setting, so keep the requests identical apart from the Scenario. A larger area is not a population benefit: an accessibility study also needs opportunity data and an explicit measure. The engine's vigo compare takes both Results in one request; see Compare requests.
Transit Route can use GTFS-Realtime Trip Updates and Service Alerts, and in the engine so can transit Matrix and Reach. This chapter explains how predictions are admitted and how to read the outcome; the realtime input reference lists every field.
Connect live feeds in Studio
Open City → Data sources → GTFS-RT live feeds, or feed settings in Network.
Paste an endpoint URL and choose what it contains. A combined endpoint may contain several entity types.
In a City with several timetables, select the endpoint's Timetable.
Choose Add feed for each endpoint, then Connect live.
Expand Feed status for individual failures and freshness.
Data
What VIGO uses it for
Trip Updates
Predictions and cancellations for routing; trip and station inspection
Vehicle Positions
Map locations, vehicle details and service observations; never routing
Alerts
Notices on legs; NO_SERVICE alerts close service in the engine
Studio allows up to 16 endpoints. A refresh has a 30-second deadline, 20 MB per feed and 40 MB in total, and rejects more than 200,000 entities or 500,000 stop predictions; at most four downloads run at once. A failed endpoint does not discard the others. Reimporting a timetable discards the retained observation until a fresh fetch binds to the new City.
Supply observations to the engine
One-off commands never open feed URLs. A request carries a realtimeSnapshot with routingDataMode: "realtime", or vigo serve --realtime-pollpolls the feeds and routes on its latest snapshot. In a multi-feed City, each record can carry sourceScope, the feed's build scope; a single-feed City uses raw GTFS IDs.
Keep source timestamps intact. Rewriting them to look current changes the input and is not a replay of the observation.
Scheduled and realtime modes
routingDataMode is scheduled or realtime; Studio shows Realtime and Scheduled · Research. The command-line runtimes default to scheduled. Scheduled research needs an explicit date and time, removes realtime and traffic observations, and never substitutes another date. Both modes use the same algorithms, stops, walking and transfer rules; only the timetable differs.
How predictions are applied
A request compiles the complete snapshot into a separate realtime timetable. Nothing is selected by endpoint or truncated: an oversized snapshot is rejected whole. Each valid matched update replaces its scheduled trip; canceled and deleted trips lose their rides; unreported trips keep scheduled times. Depart-at, arrive-by, transfer caps and windows all search this timetable. A query fixes its observation clock once, and the compiled view is cached until the input or its freshness changes.
A trip delay propagates forward until a stop-specific prediction replaces it, and a prediction never moves earlier calls. An absolute time takes precedence over a delay; arrival and departure stay separate. NO_DATA resets the delay, and SKIPPED removes boarding and alighting at that call. Repeated stops need an unambiguous sequence.
Admission and coverage
An update must identify an active trip on the selected service day and feed. Ambiguous, contradictory, invalid, unsupported and stale records are excluded and counted. Feed and record timestamps are checked separately: at most 180 seconds old and at most 60 seconds ahead of the captured clock.
An unreported scheduled prefix can conflict with the first prediction of an early-running trip. VIGO removes that prefix only when all its departures and the first prediction are before the observation time, and reports pastPrefixTrips and omittedPastPrefixStops. It does not reconstruct past events.
Added, duplicated and unscheduled trips are unsupported for routing, although Studio can display added service. Vehicle Positions and alert text never create predictions. VIGO does not compare the GTFS-Realtime feed_version with the static feed's, so connect the matching timetable edition yourself.
Read the realtime status
Read meta.realtime.status with its counts. routingDataMode: "realtime" records the request; it does not mean predictions changed anything.
Status
Meaning
applied
Updates were applied and none was rejected
partial
At least one update was applied and at least one was rejected
stale_fallback
Nothing was applied and freshness checks failed
no_matches
Nothing was applied for other reasons; see the unmatched, date, duplicate and invalid counts
Studio also reports cancellations_only (only cancellations applied) and scheduled_fallback (no realtime timetable was available; read fallbackReason).
coverage.complete is about the supplied updates, not the share of scheduled trips that report. A fully admitted cancellation snapshot can legitimately return no journey. Keep these fields with the answer.
Investigate live service in Studio
Start in Network: check the observation time and reporting coverage, then choose a route in Routes. Compare scheduled and predicted events at the same stop, and read a vehicle's position separately from its predictions. Use Route → Realtime for journeys on admitted predictions. For a reproducible analysis, use Scheduled mode with an exact date and time; for an incident review, keep the observation, its identity, coverage and the Result. See Network and Routes.
Verification
The runtime's Rust tests (crates/vigo-runtime/src/realtime/tests.rs) cover delay propagation through dwell, skipped and no-data calls, early predictions that omit a past prefix, trip replacement and the classification of every update in feed order. npm run check:standalone runs test/check-realtime-polling.mjs and test/check-realtime-alerts.mjs, which poll real protobuf feeds through vigo serve and check snapshot publication, inline snapshots overriding the server's feeds, failed and malformed reads, and Service Alerts, and npm run check:gtfs checks the decoder and journey quality with live updates. These checks establish that the algorithm applies predictions correctly in the tested cases, not that predictions are accurate.
A City built with OSM answers Walk, Drive and Bike Route and Matrix, and gives transit its walking access. Walk uses the directed pedestrian graph; Drive uses the directed road graph at free-flow speed unless the request supplies traffic. VIGO never replaces a missing street path with a straight line. Street Route needs coordinates and returns full geometry; street Matrix returns distance and duration per pair without building every path.
Coordinate network attachment
A free coordinate attaches to its nearest pedestrian vertex or two-way edge. If that attachment belongs to a fragment with no transit access, VIGO can recover to the nearest connected component within 80 m. The connector counts toward walking time and limits, and the returned line includes it. Reach origins use the same rule.
Drive attaches a free coordinate to the nearest drivable road and enters or leaves it mid-segment, in its own direction. The straight gap is a walk at walking speed, returned as its own leg and counted against maxWalkKm; with no road within that limit the Result is not_found. Roads within 25 m of the nearest stay as alternatives, which keeps both carriageways of a divided road available. A traffic closure makes a road impassable; it does not move the point.
Stops keep their prepared positions. Recovery never adds a street edge or a transfer, and a connector is an assumption, not evidence of a surveyed entrance or a safe crossing. A point with no eligible street within the radius stays unreachable.
Authorized endpoint access
Builds default to public pedestrian access: private paths stay outside the walking graph. Movable gates without restrictions inherit the path's permission; private, locked and time-restricted gates stay excluded. An explicitly walkable platform area connects the paths that share its nodes.
For people authorized to use internal roads at their own homes and destinations, such as a campus or gated community, build with --private-access=endpoints. In Studio, choose City → Street network → Pedestrian access → Authorized endpoints before importing the OSM PBF. Mapped private streets are then usable only within the origin's or destination's own internal area, up to the first public street with transit access. The public middle of the journey and transfers never use them, all internal walking counts toward the limit, and access=destination gates are allowed. Transit diagnostics report walkingAccessPermission: "authorized_endpoints". This assumes the traveler is authorized; it does not infer ownership, gate hours or missing links.
Names for map points
Studio labels map clicks with local street names, intersections, named areas or nearby stops. Names describe a point; they never move it or change routing. They come from optional tables written during OSM import; Cities without them fall back to stop names. The native operation places.describe exposes the same lookup.
Supplied traffic
No traffic provider is connected by default. OSM supplies the road graph and free-flow estimates; transit feeds are not a road-speed model. Never describe a drive without applied traffic as a current traffic estimate.
Drive Route and Matrix accept a traffic object with routingDataMode: "realtime". It customizes the road graph for that request: a fixed set of costs, not a forecast that evolves during the trip.
This fragment shows the schema with illustrative values; a full request also needs the mode and endpoints. Use the actual observation time and the geometry of the observed directed road.
Contract
Behavior
Time
observedAt is required; validity defaults to 300 seconds, at most 1800; times more than 60 seconds ahead are rejected
Expiry
Expired traffic reports stale_fallback and uses baseline costs
Geometry
Endpoint pairs or 2–512 coordinates, matched to a connected directed path; ambiguous paths are rejected
Edge indices
Need the City's exact streetSourceFingerprint; indices are not portable between builds
Costs
Travel time, speed, slowdown factor or closure; never faster than baseline
Overlap
The largest cost wins, including closures
Read meta.traffic.status with its matched and unmatched counts. Only applied means supplied costs changed the model. VIGO does not model every turn penalty, signal or intersection delay, parking, or traffic changing during the trip. vigo serve --ndw-poll polls Dutch NDW travel times, and vigo traffic-import converts NDW files; see Drive traffic.
Bike Route, Matrix and Reach use a directed bicycle network with access rules, contraflow, surfaces, mapped incline, dismount sections and turn restrictions, including restrictions that apply only at certain times.
Bicycle permissions cannot be recovered from an older City's walking or driving graph; rebuild from OSM to add them. Studio prepares bicycle streets on new OSM imports. Bicycle data is optional: Cities without it keep their other modes.
Use the same bike object for Matrix and Reach. Depart-at, arrive-by and via points are supported. maxStreetKm bounds each routed segment, including walks at its ends; maxWalkKm bounds each endpoint's walk. Public journeys report bike legs and cyclingSeconds, separately from walking and waiting.
Preferences and traffic stress
profile is balanced (default), quiet or fast. balanced and quiet avoid traffic exposure; fast minimizes estimated travel time. Preferences choose the route; the reported duration is always the estimated physical travel time at speedKph (5–40, default 18), adjusted for surface and mapped incline.
maxLts (1–4) sets the highest estimated level of traffic stress the rider will cycle. On busier links the rider pushes the bike at 4 km/h where walking is allowed, shown as walking legs with geometrySource: "osm-low-stress"; otherwise the link is excluded. The estimate follows the road-class, speed and lane rules of Conveyal's published LTS implementation, with valid lts, lts:forward and lts:backward OSM tags taking precedence, plus a few VIGO refinements for directional lanes, high speeds and wide roads. It is an OSM estimate, not observed safety. A stress limit needs a City built with bikeStressVersion: 1; older Cities answer ordinary bike requests.
Timed roads and turns
With a serviceDate and a known City timezone, depart-at and arrive-by routes evaluate weekly road access, one-way directions, dismount periods and turn restrictions at the moment the bicycle enters each segment. The search can wait for a road or turn to open, or take a detour; waiting appears as a gap between legs, and reported duration includes it. Weekday lists and ranges, time windows and overnight windows are supported. Holidays, seasons, weather and opening-hours rules with semicolons are treated conservatively. Without a usable date and timezone, timed roads are excluded and conditional turn restrictions apply all day. Diagnostics report the timingPolicy used.
Walking to and from the bike network
New Cities walk to the bicycle network along the public pedestrian graph, with verified geometry; coincident roads or bridges never become a junction. Short straight snaps from a coordinate stay unverified and are limited to 80 m. A bicycle=dismount section is a walking leg. Older Cities without this join keep straight connectors; rebuild to enable network walks.
What the model does not include
Bike has no live traffic, wheelchair profile, bike sharing, or bicycles aboard transit. Hills come from OSM incline tags, not terrain data. Ordered bike via points are routed segment by segment, which does not guarantee the best route over all of them. Missing OSM access or condition data cannot establish that a route is safe to ride. How VIGO computes answers explains the search.
A wheelchair City applies the strict wheelchair-strict-v1 profile to Route, Matrix and Reach: unknown accessibility is excluded, and a no-route answer is never replaced by an unrestricted route.
Serve and query it like any City. Requests inherit its profile; "wheelchair": true (or --wheelchair) requires a wheelchair City and false rejects one. Wheelchair Cities reject Drive, realtime transit and query-time scenario overlays. Rebuild the City when the inputs change.
What the profile requires
Vehicles and stops. GTFS wheelchair_accessible=1 for trips and wheelchair_boarding=1 for boarding and alighting, including inheritance from the parent station. An accessible vehicle can pass an inaccessible stop. The search finds accessible journeys directly, including later vehicles; it does not filter an unrestricted journey.
Station paths. A pathway needs a positive wheelchair_traversal_time, or step-free mode with width at least 0.9 m, slope at most 8.3% and a traversal cost. Elevators need no slope. Stairs and escalators are always excluded. A station that declares entrances is entered only through accessible entrances and paths; a platform of a station without entrances is reached from the street when its own or inherited wheelchair_boarding is 1. Optional wheelchair_length gives a distance priced at 4.8 km/h; a published wheelchair time takes precedence. Fare gates between accessible nodes use their published time or a five-second estimate.
Streets. Chosen at build time with --wheelchair-streets and reported as accessibility.streetEvidence:
Value
Build option
OSM ways used
inferred-step-free-v1
Default, or --wheelchair-streets inferred
Ordinary pedestrian ways, including ways without wheelchair or surface tags, after the filters below
wheelchair-yes-only
--wheelchair-streets verified
Only ways tagged wheelchair=yes
Both exclude steps, escalators, inaccessible or limited nodes, raised kerbs, conditional access, widths below 0.9 m and inclines above 8.3%. Inferred evidence also excludes rough surfaces, poor smoothness, mountain trails, and unpaved paths, tracks and bridleways; wheelchair=yes overrides those filters, and an incline of up, down or yes needs it. A mapped kerb must be lowered or flush. Few cities tag every sidewalk, so verified evidence alone usually leaves little network.
In Studio
Studio prepares wheelchair routing with every single-timetable City: once its GTFS ZIP and OSM PBF are imported, it builds the profile from those original files in the background, with progress in Tasks. If VIGO stops before preparation finishes, it starts again the next time the City is opened. Source fingerprints are checked, and importing a new timetable or OSM file prepares the profile again; Prepare wheelchair routing in Route's journey settings rebuilds it on request. While Route is open, the prepared profile stays loaded beside the ordinary City, so switching wheelchair routing on or off answers at once. Studio supports this for single-feed, scheduled Route without via points or scenarios; use the engine for wheelchair Matrix and Reach. From a source checkout, node scripts/attach-studio-wheelchair.mjs /path/to/Studio-City /path/to/wheelchair-city attaches a City built with the compiler.
Limits
Every Result carries accessibility with the profile, its street evidence and its limitations. Attachments from a coordinate to the network are geometric; door-to-street access is not verified. Live elevator outages, temporary barriers and individual chair dimensions are not modeled. Strict requirements can leave sparse coverage, and a no-route answer is not evidence that no accessible trip exists. Sources: GTFS Schedule, MBTA pathways and OSM wheelchair tags. npm run check:wheelchair runs the public regression.
Route and Matrix can include conditional service from GTFS Flex: on-demand zones, location groups, booking rules and continuous pickup and drop-off. Add "flex": {} to the request; rebuild older Cities to import Flex records.
VIGO checks zone containment (including holes), calendars, pickup and drop-off windows, walking limits and driving reachability over OSM. On-demand travel time uses the feed's safe_duration_factor and safe_duration_offset, falling back to durationFactor (default 1.5) and durationOffsetSeconds (default 300). Timed fixed-stop booking service keeps its published times. Continuous stopping follows the directed GTFS shape, with intermediate times interpolated and labeled interpolated_shape. A deviated route keeps its fixed calls: a rider is picked up in time for the vehicle to reach the next fixed stop on schedule, with assumption deviated_route.
How Flex joins fixed service
Flex and fixed service share one timetable search. A Flex ride ending at a stop becomes access to the scan, and one starting at a stop becomes egress, so a journey can use Flex at either or both ends, departing or arriving by. Each Flex ride counts as a boarding; transfer restrictions, minimum times and the buffer apply. A combined journey is returned only when it is strictly better than the scheduled one.
The search first scans with optimistic Flex values. When its winner uses Flex, VIGO prices the walks on the street graph and the clocks exactly; if the priced walks lengthen the winner by more than 60 seconds, it searches again. A winner within that margin is returned and can be up to 60 seconds later than the best conditional journey. The optimistic scan ignores transfer rules, so it can miss a Flex journey that depends on a transfer that exists only through a rule; when a rule at a Flex interchange contradicts it, VIGO composes the conditional and scheduled parts separately.
Booking
journey.legs[].quality.flex carries the timing assumption and the feed's booking rules: messages, phone numbers, URLs and notice. bookingStatus: "required" means the journey is conditional: VIGO has neither booked it nor checked the deadline or capacity. bookingConfirmed: true records only the caller's claim.
Planned zones
A Route or transit Reach scenario can include flexZones: id, name, a GeoJSON Polygon geometry, startMinutes, endMinutes, averageSpeedKph and waitMinutes. Travel time is the wait plus straight-line distance at the speed. Both ends of a zone ride must lie in the zone, and fixed-transit interchanges must be stops inside it. Reach evaluates zone egress at the raster resolution, so it has discretization error that point Route does not.
Limits
Flex rejects realtime, scenario overlays, journey windows and alternative policies; Matrix is limited to 4,096 cells, and Reach does not accept imported Flex. Wheelchair Flex requires a wheelchair City and an explicitly accessible vehicle. Work is bounded without failing: after 4,096 walkable pickup and drop-off pairs, 65,536 rides to or from stops, or 65,536 priced drives, the search returns what it found with a flex_search_truncated warning. Each feed's Flex catalog is limited to 32 MiB; past it, the build omits continuous-stopping and booking trips first, then on-demand trips, and reports flex_catalog_limit. Vehicle availability is not modeled. Never present Flex estimates as guaranteed departures. test/check-flex*.mjs hold the public regressions.
A single Route, Matrix or Reach answers for one departure time. Travel time by transit can change a lot from minute to minute, and a planned frequency service has no fixed timetable yet. Add monteCarlo to a request to repeat it over a departure window and sampled schedules, and get travel-time percentiles instead of one value. The engine, the compiler, Studio (Analyze → Departure window) and Python's monte_carlo option use the same sampler. No City rebuild is needed.
Send it with vigo matrix --city city --request request.json, a stream line, or POST /v1/matrix. A Route request uses origin and destination and returns a distribution for that pair, not an itinerary. Reach uses its origin, bounds, raster size, cutoffs and sampling mode.
monteCarlo field
Default
Meaning
startMinutes, endMinutes
Required
The departure window [start, end) in minutes after midnight, within one civil day
draws
200
1–10,000 samples, rounded up to an equal number per minute
Every minute in the window has equal weight. If a sampled planned frequency service (see Planned timetables) can affect the window and horizon, draws are rounded up to an equal number per minute: 200 requested over 120 minutes gives 240 samples. Otherwise, including every GTFS timetable, there is one sample per minute whatever draws says, because each minute has only one answer.
GTFS exact_times=0 entries are read as fixed departures: a vehicle at the start of each end-exclusive window and then every headway, the same in every sample. For each sample, each sampled planned frequency service receives one uniform integer-second phase in [0, headway). Its vehicles then repeat at that headway within the end-exclusive service window. All stops, transfers, origins and destinations in that sample see the same realization. Published trips and fixed services stay the same in every sample.
This models unknown schedules and variation in when passengers leave. It assumes on-time operation, riders who know the realized timetable, and no crowding. It does not estimate delays or reliability. The approach follows the published frequency-routing methodology of Conveyal Analysis.
Reading the result
vigo.distribution.v1 records the full request, City revision, engine version, request fingerprint, seed, method version, requested draws and actual sample count. durationsSeconds[p][i] contains the destination-wise nearest-rank percentile. Matrix cells are flattened in origin-major order; Reach cells use the returned grid layout. reachableSamples[i] counts finite outcomes.
Unreachable samples participate as positive infinity; their selected quantile is JSON null. Zero remains a valid travel time. No-itinerary outcomes are not removed before computing percentiles. Query errors abort the analysis instead of entering the distribution as unreachable observations. The inverse empirical CDF uses index max(0, ceil(percentile * sampleCount / 100) - 1).
A seed reproduces results for the same engine, City, scenario, query selectors and sample plan. Changing the number of draws or the timetable can change the sample plan. This is not a guarantee of identical random phases across unrelated City builds or differently ordered service entries.
Observation storage is limited to 64 MiB per request and percentile output to one million values. Repeated Matrix endpoints share observations; the final results preserve every requested pair and its order. Reduce the number of distinct pairs, raster size or draws if the request exceeds it. This limit covers observations, not total process RSS, resident networks, result serialization or City loading. Studio uses a 96×96 simulation grid. Matrix resolves endpoint walks once per request. Reach limits street propagation to paths that can enter the requested grid, using displacement bounds derived from the actual stored edge lengths. This adds only four cached numbers, without another per-node index. Queries reuse resident street data and restore ordinary routing semantics on both success and error.
Planned timetables and coordinated transfers
A scenario may add, replace or remove service using the existing portable scenario contract. Frequency services default to sampled schedules during Monte Carlo analysis. Set exactTimes: true to use fixed departures beginning at the service start, repeating at the headway, excluding the service end. Explicit preserve-trips schedules also stay fixed. Existing implicit single-time scenario timetable behavior is retained for compatibility.
Studio's line editor can add, copy and remove timetable rows, with individual weekday and exact-departure controls. The native contract accepts the same timetables array on a service:
Rows replace the top-level frequency window. ISO weekdays use 1 for Monday through 7 for Sunday; omitting them means every day. Times after midnight remain on their own service date, so a weekday row's runs after midnight continue into the next day's clock, as scheduled service does. Every row is end-exclusive. Overlapping rows add independent service, with independent random phases in simulation. IDs must be unique within a service; a service accepts at most 32 rows. A missing row-level exactTimes inherits the service's setting. Rows cannot be combined with preserve-trips schedules.
A unidirectional, non-exact service can coordinate with another service:
The child departs its selected stop two minutes after the parent's selected stop. At a terminal the arrival offset is used. References must identify one frequency service; cyclic dependencies, exact services, ambiguous bidirectional services, multiple active timetable rows and invalid stop indexes are rejected. Phasing is available in native Monte Carlo requests; Studio currently exposes the exact-times switch. Phasing relates runs on the service date; a service's runs on adjacent service days keep independent phases. Unequal headways align only when their cycles coincide; phasing does not change headways or guarantee every vehicle a transfer. Transfer buffers still apply.
Speed and dwell edits
With scheduleMode: "preserve-trips", an optional service timing object changes running and standing time separately while keeping every trip's first departure:
Segment indexes start at zero; stop indexes refer to the edited stop order and must be after the first stop. Omitted selections cover the entire pattern. Moving times are divided by speedFactor; 1.2 means 20% faster travel, not 20% less time. Dwell times can be multiplied by dwellScale or replaced with dwellMinutes, but not both. Downstream times accumulate the changes; boarding permissions, trip identities and baseline data are preserved. Invalid indexes, non-monotone input times and excessive adjusted times are rejected.
Studio exposes whole-pattern speed and dwell controls when keeping scheduled departures. Segment and stop selections are available through the native API. These edits also work for ordinary single-time scenario routing.
Opportunity counts and decay
An optional monteCarlo.accessibility computes indicators from each destination's travel-time percentile. This is not the mean of accessibility computed separately for every draw. Matrix counts follow destination order and are reused for every origin; Reach counts follow the returned grid's row-major order.
Counts may be fractional and must be finite and nonnegative. Results contain layers[].access[percentile][origin][cutoff], in weighted opportunities, and dualSeconds[percentile][origin][threshold], the minimum time to accumulate the specified number of opportunities. Insufficient reachable opportunities produce null, including when routing's horizon truncates the search.
Available decay functions are:
Type
Parameters and interpretation
step (default)
Weight 1 strictly below the cutoff, otherwise 0.
exponential
Cutoff is the half-life.
fixed-exponential
Positive decayConstant in inverse seconds, at most 1; ignores cutoff.
logistic
Positive standardDeviationMinutes; cutoff has weight 0.5.
linear
Positive widthMinutes; tapers from 1 to 0 symmetrically around cutoff.
Unreachable destinations receive zero weight. The routing horizon remains a hard limit even for decay functions with long tails: choose a horizon sufficient for the intended analysis and retain it with results. At most 16 layers, 16 cutoffs and 16 dual thresholds are accepted; aggregate output is bounded to one million indicators. Spatial uploads and polygon-to-grid conversion are separate from this engine request.
Current boundaries
The mode is scheduled depart-at transit with walking access/egress. Realtime, Flex, traffic, via points, per-draw itineraries and arrival windows are rejected. Street-sampled Reach measures reachable street portions; cell-center Reach routes to the cell coordinates. Keep that choice and the grid fixed when comparing opportunities. Studio saves the simulation settings in JSON, CSV and GeoJSON exports, and retains native distributions in its JSON result. Its simulated surfaces do not report per-stop percentile counts.
Validation uses synthetic scheduled/frequency feeds, independently enumerated vehicle departures, minute-by-minute exact results, coherent duplicate origins, phased transfers, unreachable mass, repeatability and resident-state cleanup. Run npm run check:monte-carlo; native decay and rank checks run with the Rust unit tests. These are correctness checks, not evidence of worldwide routing quality or feature parity with another product.
VIGO supports explicit time reserves that change which journey is chosen. It does not estimate an on-time probability, a travel-time distribution from delays, or a calibrated confidence interval: scheduled and admitted realtime times are point estimates. For variation due to departure time and planned frequencies, see Monte Carlo.
Use reserves in a routing request
Control
Applies to
Meaning
minimumTransferBufferMinutes
Transit Route and Matrix, either direction
Extra minutes before each later boarding, after walking and published minimums
arrivalBufferMinutes
Arrive-by transit Route and Matrix
Plan against a deadline this many minutes earlier
Both are integers 0–60, default 0. A positive arrival reserve needs a deadline at least as large as the reserve and a horizon exceeding it by at least one minute; the earliest departure stays the one implied by the original deadline and horizon. Via points reject a positive reserve, because composing segments would apply it repeatedly; Walk, Drive, Reach and native operations reject an arrival reserve.
For Harvard Square to South Station, save reserved-arrival.json:
VIGO plans arrival by 08:55, allows departure no earlier than 07:00, and requires three extra minutes at each change. These are illustrative preferences, not an MBTA delay estimate, and a tighter request can legitimately find no journey.
Route clocks still describe the chosen timetable journey, and a Matrix duration keeps its deadline-minus-departure definition. diagnostics.timeReserves in the trace records both deadlines, both margins and calibratedProbability: false. A transfer reserve can absorb some lateness, but it does not model early departures, missed-connection recovery, crowding, cancellations, correlated delays or uncertain walking.
Calibrate probabilities before offering them
GTFS-Realtime StopTimeEvent.uncertainty has no defined statistical meaning, and an omitted value means unknown. It must not become a standard deviation or a 90% interval without a validated, provider-specific model. See the GTFS Realtime reference.
A calibration study would keep historical forecasts and outcomes, match the exact feed revision and trip, estimate errors by route, direction, time of day and lead time, and validate on later dates. For Boston, the MBTA LAMP exports are a possible input; VIGO does not download or fit them. Delays on one vehicle or corridor are correlated, so multiplying transfer probabilities does not give a journey probability.
Reproduce the implemented contract
npm run check:standalone (test/check-standalone-parity.mjs, test/check-standalone-http.mjs and test/check-service-calendar-boundaries.mjs) and the recorded corpus case route-arrive-by-reserve (npm run check:corpus) cover the reserve on Route and Matrix, invalid values, HTTP requests and service-date boundaries. They establish modeled feasibility, not on-time performance.
Route shows boarding prices from the imported GTFS feed. In Studio, expand a leg's fare for product names, payment methods and the agency's fare link; JSON Results carry the same data in each transit leg's fare.
These are prices for a new boarding, not an optimized journey fare. Multi-leg journeys deliberately have no total, because transfers, discounts, passes and existing tickets change what a rider pays. A missing price does not mean free travel, and price never affects route choice.
Data and matching
The importer keeps fare tables and their references in an optional fare_catalogs table that travels with the City. Cities built before fares were added need their GTFS reimported.
Fares v2 takes precedence when fare_products.txt exists. Matching uses networks, areas, rule priorities, timeframes and the default rider category. MBTA's transfer_only extension is honored, so a free-transfer product never becomes a free new boarding.
Fares v1 supports flat, route and origin–destination zone prices. Zone-traversal (contains_id) rules stay unpriced.
Timeframes use the local date and time at the validation stop, including daylight-saving changes and times after midnight.
Ambiguous networks, conflicting products, missing references and unsupported conditions stay unpriced. An unreadable fare catalog never discards a route.
Transfer totals, joined fare legs, passes, non-default rider categories and fare-based routing are not implemented.
Matching follows the GTFS Schedule reference. No agency prices are built into VIGO. Fares are looked up only after the route is chosen, so they never slow a search. node test/check-gtfs-fares.mjs holds the public regressions.
Open a JSON Result from the engine, the compiler or the HTTP API. The viewer shows its status and main answer, draws a journey timeline, a matrix table or a Reach raster, and keeps the source JSON beside it. Files are read on your device and never uploaded; the viewer accepts up to 25 MiB.
Route uses journey, Matrix uses durationsSeconds, and Reach uses surface.valuesSeconds or map-only areas. Durations are seconds, and null means unreachable. Keep geometry qualifications and warnings with the answer.
Python's Result.to_dict() keeps its own minute-valued payload; read it with the Python Results guide. The viewer accepts public engine schemas only.
Open a Result
Files are read in this window and never uploaded. Up to 25 MiB.
VIGO Studio puts Network, Route, Analyze and City views over the same routing engine. It keeps its own project library and works offline once a City is imported.
Settings and documentation
Open Settings → Documentation from the City library or the sidebar to read this guide offline. Press / to search; links to external pages open in your browser. Reading documentation does not open a City.
Open a City
Select a project in the Studio library and import GTFS and OSM. Rebuild when the feed or street extract changes. Studio stores projects in its own library format and cannot open City directories built by the compiler in this release. Opening a City prepares walking; driving opens when you select Drive. Background tasks shows preparation progress.
Network
Use Network for reporting coverage and service events, and Routes for trip times, station boards and line views. Network and Routes explains playback, live timing and added service.
Route
Plan
Pick an origin and destination on the map. Add point inserts a via point before the destination, up to eight points in total; click a row to pick it again, use the arrows to reorder it, or remove it. Reverse flips the order. You can also type a coordinate command in Search VIGO, such as route 38.90, -77.05 to 38.91, -77.03 at 08:00, then choose Plan this journey. The route form does not search place or station names.
Choose a travel mode. Realtime transit departs now; Scheduled shows the date, time and depart-at or arrive-by controls. Transfer caps are disabled while via points are present. Rerun route submits the same points again, and New route clears them.
Choose a network
Network chooses what a transit route runs on: the City timetable, one imported timetable, or a saved scenario. Selecting one feed uses its own prepared store and mixes in no other feed. A scenario route uses its timetable group's schedule with removed routes canceled and planned lines added; planned lines run on their stated headway and hours, and new planned stops are reached on foot. Rides on planned service are labeled Planned. Realtime is unavailable while a scenario is chosen. A project may set defaultRoutingFeedId in its Studio metadata to choose the default network.
Journey choices
Sort journeys by Earliest, Fewer transfers or Less walking. Each card shows arrival, total time from your requested departure, transfers, walking, and its trade-off against the earliest arrival. Sorting keeps the selected journey and does not search again; arrow keys, Home and End select another, and Details opens its itinerary.
Later departures add the engine's ranked search at the requested time to the window: up to 64 candidate vehicle chains within fifteen minutes of the earliest arrival, of which at most ten are shown, distinct lines and stops first. A journey is removed when another leaves no earlier, arrives no later, walks no more and boards no more, in the whole minutes Studio shows. Services are grouped only when their stops, ride geometry and access paths match. This is a bounded search, not every possible itinerary.
With Arrive by, Route options offers Exact time or Earlier arrivals. Earlier arrivals searches each deadline in the 20 minutes before the requested arrival and lists up to five distinct journeys, the latest departure first, plus a walk when possible. A deadline close to midnight searches the previous service day.
Save a journey
Choose a format beside Save in the journey details. JSON keeps the plan, diagnostics and a summary separating initial wait, journey duration and total elapsed time. Markdown is a readable itinerary whose clocks can exceed 23 hours. GeoJSON keeps leg geometry and its source. CSV records each leg's trip and service-clock times; clock_service_date names the midnight those minutes count from. Saving never reruns the query. Save all keeps every completed alternative, including those beyond the five visible cards.
Recent
Reopen recent Route Results for the current City revision, with their request, status, warnings and timing.
Analyze
Reach
Choose an origin on the map, or use Choose origin to search imported stops by name or ID or to enter coordinates. Run Reach, then switch between Reachable area, Reached streets and cutoffs; changing the displayed cutoff reuses the Result. Arrive by maps where a destination can be reached from by a deadline; the clock becomes the Deadline.
With street sampling, the map also shades the land beside reached streets: each cell within a straight walk of 100 m takes its fastest nearby street plus that walk, never across mapped water, so the area narrows where time runs out and land farther from every reached street stays empty. The inspector labels these values as off-street estimates. Shading is display only; area metrics and the saved raster keep the street samples.
Click a destination to see its estimate and request a journey there; with the map focused, Enter inspects its center. The journey keeps the analysis origin, date, time, timetable and limits. Planned service changes affect the scenario map but are not rebuilt in the destination journey; the panel labels the difference.
Save offers the full JSON, the selected cutoff's area geometry, or a CSV summary. total_processing_ms measures the whole analysis; area_source distinguishes an exact-cutoff area from a display-raster calculation.
Scenarios
Studio saves scenarios and timetable groups in the City folder, in .vigo/scenarios.json, shortly after each edit. They survive restarts and reimports and travel with the City; a scenario naming a route a reimport removed reports it when run. A copy saved from another window is never overwritten. Road tracing follows the City's streets between the ordered stops; a disconnected segment is explained, never drawn as a straight "road". Use the engine, the compiler or Python for Matrix.
City
Data sources
City → Data sources lists GTFS feeds, OSM coverage, counts and warnings. To remove a source, select the trash button, check the name and confirm Delete source. Removing a GTFS feed rebuilds the combined timetable from the rest; removing OSM removes street routing until another import. Your original files are kept, and deletion is unavailable during import or preparation.
Preferences
Choose appearance, storage location and map preferences. The default City folder is ~/Documents/Vigo Projects. On macOS, Studio does not scan the library until you choose Open library folder, when macOS may ask for permission.
Local OSM is the default basemap: main roads, rivers, lakes and coast from the City's own PBF, with no tile service, API key or network connection. Cities imported before the local map index need one fresh OSM import. Online OpenStreetMap and CARTO styles are optional.
Studio troubleshooting
Playback shows no trips
Check the exact service date, calendar.txt, calendar_dates.txt, the selected direction and pattern, and whether the playback time falls between a trip's first departure and last arrival.
An access path crosses a block
Access lines come from OSM streets. Rebuild from current OSM, confirm the point lies within coverage, and inspect the street leg. Studio never replaces a missing street path with a straight jump.
A date is rejected
Use an exact YYYY-MM-DD date inside the feed's service range. Studio applies the same calendar rules as the command line.
A loading indicator is not advancing
Background tasks show measured progress for steps with a known total; the percentage belongs to that step, not the whole import. Steps without a total show elapsed time and the age of the last update. If updates pause, use Reconnect to task: the task may still be running. Confirm that the City folder is readable and writable and that macOS has granted access.
Open Network in VIGO Studio to inspect the City's timetable, live reports and service events. It has Network and Routes tabs; use Route for journeys and Analyze for Reach.
Read the evidence
What you see
What it represents
How to use it
Scheduled time
A GTFS arrival or departure on the selected date
The published plan
Predicted time
A matched, admitted Trip Update for that trip and stop
Compare with the same scheduled event
Vehicle position
A reported location at its own observation time
Locate the vehicle; check its age separately
Estimated playback
A position interpolated along the scheduled trip
Explore the timetable and geometry
Service event
A computed delay, spacing change or source alert, with timestamps
Inspect its evidence and age
None of these is a verified history of arrivals, and a missing prediction stays unknown. A vehicle marker or an added trip does not mean Route can use that trip; routing has its own admission rules.
Investigate a condition
Start with coverage. Check the snapshot time, feed freshness and reporting counts in Network. Reporting counts routes with current trip reports; it is not the share of passengers covered.
Follow the route. Open Routes, select the route and read Trip times on the relevant date. Use Stops to confirm direction and pattern, then Updates for service evidence.
Compare the same event. Open the station board or select a vehicle in Line view. Compare arrival with arrival, or departure with departure, at the same stop, with both observation times visible.
Keep the observation.Export observations or Export report keeps the evidence and its timestamps.
Inspect a route or station
Choose a route in Routes to see Trip times; select a trip and date to compare scheduled and predicted times. Stops opens directions and patterns, and Updates opens service evidence. Select a stop for its arrivals board; All routes returns to the catalog. Selection is shared across Network, Routes, the map and the line view; Network map clears it.
Patterns and scheduled playback
A route's Stops view shows directions, patterns, ordered stops, service span and published geometry. Patterns are labeled by their first and last stops. Direction IDs 0 and 1 are feed labels, not compass directions. Times such as 25:10 stay on their GTFS service day.
Scheduled playback is labeled Estimated: vehicles dwell at stops and follow their shape between timed calls, so positions are approximate. Live positions are drawn separately, with a bearing arrow when reported.
Vehicle timing and line view
In Routes, select a route and choose Line view: two tracks show each direction's stops and reported vehicles. Select a vehicle to compare scheduled and predicted arrival and departure at its reported stop. If that stop has no usable timing, Next prediction names a later stop without substituting its time. The browser requests only the selected route or vehicle, every ten seconds.
Stop placement follows the Vehicle Position's stop ID, sequence and status; it never snaps to roads or interpolates. Missing or conflicting identities stay unplaced.
Arrival comes from the incoming connection and departure from the outgoing one; delay compares the same event at the same stop.
Opposite directions share a station list only when their sequences are exact reverses.
Branches and repeated stops stay distinct. Skipped stops, missing predictions, duplicates and stale observations never become current timing.
Spacing is schematic: it shows stop order, not distance or headway. The ↔ warning marks both vehicles of a compressed pair.
Added service
Trips declared ADDED or NEW in GTFS-Realtime appear in the line view and Trip times even when absent from the static timetable. Their reported stops supply placement and timing; scheduled times and delays are unavailable. Added-service display does not make a trip available to journey routing.
Evidence limits
Predicted spacing is not measured headway, and forecast changes are not actual vehicle progress. Reporting coverage is not service health. Network inspection does not establish delay causes, recovery forecasts or passenger impacts, and VIGO does not dispatch vehicles or publish messages. npm run check:agency holds the public regressions; matching follows the GTFS Realtime reference.
Run the engine as the HTTP service. It opens a prepared City or scenario collection without Node, Python, Studio or an internet connection. Build the City with vigo build, on the server or on a larger build machine, and mount the complete directory read-only.
Build and check the image
From the repository root with Docker installed:
Shell
docker build -f deploy/Dockerfile -t vigo:1.0.0 .
The image contains the engine with this guide embedded, license notices and a Debian glibc runtime, and runs as UID/GID 65532. Its compiler matches rust-toolchain.toml; City data, JavaScript dependencies, desktop bundles and build caches are excluded. Check the image before using it:
Shell
npm ci
npm run build:cli-runtime
npm run check:deployment -- --image vigo:1.0.0
The check builds public synthetic inputs and exercises the real Compose service: a read-only City, authentication, Route, Matrix, Reach, scenario switching, readiness, restart and resource limits, and it confirms that queries never change City files. CI runs it on Linux x64 and ARM64. The small fixture is not a metropolitan memory or latency result: measure your own City and requests before choosing production limits.
Start the service
Make the City directory readable by UID 65532, and keep every referenced directory inside the mounted City or collection.
Shell
export VIGO_IMAGE=vigo:1.0.0
export VIGO_CITY=/absolute/path/to/prepared-city
# Set VIGO_API_TOKEN through your shell or deployment secret store (16+ characters).
docker compose -f deploy/compose.yml up -d--wait
The service binds to 127.0.0.1:8080 on the host; put an HTTPS reverse proxy in front of it for remote clients. Query endpoints require Authorization: Bearer ...; readiness and this guide are public.
GET /v1/info reports the City, memory and scenario residency. For a scenario collection, pass scenarioId with each query. The HTTP API lists every endpoint and status code.
Resource controls
Compose defaults to 2 CPUs, 2 GiB of memory and no swap, two native threads, two resident scenarios, and one query worker with a bounded queue. It uses a read-only root filesystem and City mount, drops Linux capabilities, limits processes, and keeps two 5 MB log files.
Compose variable
Default
Meaning
VIGO_IMAGE
Required
The image you built and checked
VIGO_CITY
Required
Absolute path to the City or collection on the host
VIGO_API_TOKEN
Required
Bearer token, at least 16 characters
VIGO_LOCAL_PORT
8080
Loopback port on the host
VIGO_CPUS / VIGO_MEMORY
2 / 2g
Container CPU and memory limits
VIGO_MEMORY_SWAP
Equal to VIGO_MEMORY
Memory plus swap; equal values disable swap
VIGO_THREADS
2
Threads per query (RAYON_NUM_THREADS)
VIGO_MAX_RESIDENT_SCENARIOS
2
Collection members kept loaded
VIGO_ENDPOINT_CACHE_MAX_BYTES
8388608
Endpoint cache budget
VIGO_SHAPE_GEOMETRY_CACHE_MAX_BYTES
8388608
Shape cache budget
VIGO_MAX_QUEUE
8
Waiting queries
VIGO_MAX_CONNECTIONS
16
Open HTTP connections
VIGO_MAX_BODY_BYTES
8388608
Largest request body
VIGO_REQUEST_TIMEOUT_MS
10000
Request and response I/O deadline
VIGO_QUERY_TIMEOUT_MS
30000
Queue plus computation deadline
Other engine variables, such as VIGO_RESIDENT_HEAP_BYTES and VIGO_PREPARE, keep their defaults unless you add them to the Compose file. Before raising limits, read Resource limits: extra processes are not a free speedup, and swap is never counted as RAM.
The worker keeps its City and workspaces, puts short queries first, and gives waiting analytical work a bounded turn. A deadline or cancellation stops running work and restarts the worker, and readiness is unavailable meanwhile. A full queue returns 503 instead of accepting unbounded work. Responses are limited to 64 MiB; split large matrices or omit geometry.
GET /healthz checks the HTTP process and GET /readyz the worker. The container runs vigo health against /readyz; the probe loads no City and needs no shell or curl. The restart policy restarts exited containers, not merely unhealthy ones.
Run without Docker
The engine archive runs directly: vigo serve --city ./city --host 127.0.0.1 --port 8080, checked with vigo health --port 8080. For a Linux host, install the matching binary, create an unprivileged account, make the City readable, and keep the token in a protected environment file. A systemd unit:
Set VIGO_CITY and VIGO_API_TOKEN in the environment file. Stop the service through systemd so its worker stops too. Scale out with several service processes, each with its own City and queue; there is no shared queue, distributed cache or tenant management. The Docker and systemd recipes are deployment examples; the container check above is the tested configuration.
Operate and upgrade
Prepare a new City in a separate directory, check saved requests against it, and switch the image and City together. Never replace files a running service has mapped, and keep the previous image and City for rollback; see Upgrade and rollback. Service benchmarking records startup, first-query and sustained latency, memory and disk use. Stop the service with docker compose -f deploy/compose.yml down; the City stays on the host.
To offer a public journey planner on top of a service, see the public route planner.
This page explains how VIGO uses CPU and memory, and how to size a deployment. The Compose defaults suit a 2 CPU, 2 GiB container; environment variables lists every control.
Processes and threads
The HTTP service runs one supervised query worker with bounded admission, deadlines, cancellation and recovery. A query can use several threads (RAYON_NUM_THREADS), and endpoint access searches run on up to four threads, following the available CPUs, Linux quotas and affinity. One query worker and two threads suit a 2 CPU, 2 GiB deployment.
More processes are not a free speedup: each one loads its own City. Python's City.iter_run(queries, workers=2) and the compiler's stream --workers 2 run separate resident processes; measure before adding them. Python caps its one to four workers by CPU affinity, quota and visible memory limits, chooses one worker when memory capacity is unknown, and defaults to workers=1.
Capacity-aware defaults
At startup, the engine reads the smallest of Linux physical memory, cgroup v2 memory.max and memory.high, and cgroup v1 limits, including visible parent limits, and sizes its caches from it. Unlimited values are ignored. Other platforms, and Linux controllers mounted in unusual places, keep the fixed defaults below. Explicit settings always win.
Allocation
Default upper bound
Share of detected memory
Endpoint cache, per role
64 MiB
1/64
Shape geometry cache
64 MiB
1/64
Inactive timetables
128 MiB, growing to twice a retired view
1/32, growing to 1/16
HTTP pending request bytes
64 MiB
1/32
HTTP pending response bytes
128 MiB
1/16
Caches hold reusable work; shrinking them never changes or truncates an answer. Collections divide the caches among resident members. The loaded City and query scratch are outside these budgets, so small caches do not make a large City fit.
vigo info and GET /v1/info report resourcePolicy.memoryCapacityBytes and swapCountsAsRam. Capacity is a startup sizing input, not free memory or an RSS limit. Restart after changing container limits.
Scenario and date switching
For a collection, read the residency counters in /v1/info before blaming route search for latency. Rising cityOpens and evictions on a repeated scenario sweep mean the resident members exceed VIGO_RESIDENT_HEAP_BYTES, even when VIGO_MAX_RESIDENT_SCENARIOS allows them. Raise the budget only with measured container peaks, leaving room for query scratch, mapped pages and other services. When the heap exceeds its budget, the collection first drops optional timetable caches, then evicts members.
Changing service dates can rebuild a timetable when the inactive-timetable cache is too small. Large scheduled timetables are kept losslessly compressed within the same budget, so more dates fit on a small host. Their keys include the active services, dates and horizon; realtime and linked trips are applied after restoring. The first use of a date still reads SQLite, and eviction remains possible. Trace timings separate linkedCandidatesMs and linkedTripsMs within sourceAndRealtimeMs.
Swap is an explicit choice
The Compose service disables swap by setting memory plus swap equal to memory. To allow 4 GiB of swap beside 2 GiB of RAM, set VIGO_MEMORY=2g VIGO_MEMORY_SWAP=6g; the host must already have the swap. Swap is never counted as RAM when sizing workers or caches. It can hold cold pages under pressure but can make queries much slower.
Record RSS, cgroup current and peak memory, swap, memory events, pressure and latency separately; container memory includes page cache and is not RSS. See the Linux memory-controller documentation.
What the checks establish
npm run check:deployment runs the shipped image and Compose file at 2 GiB with a small synthetic collection, including full geometry, scenario eviction, restart and read-only City integrity. It validates the controls and recovery; it does not show that a regional City fits a given size. Before claiming a deployment budget, measure your own City and workload, including errors and out-of-memory events.
A resident stream or serve process keeps its City, timetables and street indexes ready between requests. This section explains what it keeps and how to account for memory. Resource limits explains how to size a deployment.
Timetables
Opening a City and answering the first transit query for a date prepares that date's timetable, or loads a compiled snapshot (timing.timetableSource: "prepared_snapshot"). Prepared timetables cover at least through 06:00 the next day; longer requests extend coverage in six-hour blocks.
Each City retains up to eight inactive scheduled timetables, so switching back to a date or transfer policy reuses its arrays. The default budget is 128 MiB, or 1/32 of a smaller detected memory; without VIGO_TIMETABLE_CACHE_BYTES, a single City's budget grows to twice the size of a view it retires, up to 1/16 of memory, so a large City keeps its other service day. Setting the variable fixes the budget; 0 disables retention. Least recently used entries are evicted, and oversized entries are not kept. The two latest realtime views are also kept. Calendar rules load once per City, and equal timetable columns are shared across retained dates. In a collection, a member can borrow unused collection budget without evicting another member's dates.
Collections
Members share immutable street arrays and hierarchies by path, and equal timetable columns are shared across members. Stop and trip identities, search indexes, endpoint caches and realtime state stay per member. When maximumResidentScenarios is reached, the least recently used member is evicted before another opens; the street graph stays. VIGO_RESIDENT_HEAP_BYTES also evicts members after a query when the measured retained heap exceeds it; the selected member is always kept, and residentHeapOverBudget reports when it alone exceeds the budget. residency.lastQueryTiming separates selection, opening, execution and retention.
Caches and scratch
Endpoint and shape caches have byte budgets shared by all resident members. Street search scratch is allocated only where a query writes; path scratch above 32 MiB and hierarchy workspaces above 64 MiB are dropped after each query. On Linux with glibc, freed pages are returned after timetable preparation, Matrix and Reach, and after VIGO_IDLE_RELEASE_MS of idleness. Caches hold prepared data and paths, never answers: every query is computed.
The HTTP supervisor forwards the worker's JSON bytes without rebuilding them. Server-Timing's serialize entry measures the supervisor; forwarded results report zero, and serialization in the worker counts in the end-to-end time.
Memory ledger
GET /v1/info (or vigo info) reports a memory ledger: network allocations, query workspaces, caches, SQLite and mapped file lengths, with shared owners counted once in trackedHeapBytes. It also reports timetablePreparations, timetableCoverageEndSeconds, memory.timetableCache (entries, retainedBytes, budgetBytes, hits, evictions) and resourcePolicy (memoryCapacityBytes, swapCountsAsRam). Vector capacities are counted; hash-table and JSON overheads are estimates; mapped file lengths are not resident memory. Record process RSS or PSS and cgroup memory alongside the ledger. sourceArrayBytes counts logical column contents, including shared values; never sum it as exclusive memory.
The public gateway serves Studio's route planner to the public for a fixed set of prepared Cities: a City selector, typed address search, journey planning and a light or dark appearance, on phones and desktops. It exposes routing only. Management and import APIs, live-feed settings and realtime snapshots are unavailable, so every public journey uses the published timetable. app.vigo.city runs this gateway.
Run the gateway
Build the frontend, run Studio's local API on a loopback address, then start the gateway with a private configuration file:
Shell
npm run build:studio-assets
node src/server/public-routing-gateway.mjs /path/to/private-config.json
To run the gateway outside this checkout, deploy public-routing-gateway.mjs with its siblings address-search.mjs, address-index.mjs and address-index-worker.mjs. The static root holds the built index.html, assets/ and brand images; it must not expose the CLI or server bundles.
Optional HTTPS Photon-compatible geocoder for searches the index cannot answer
coverage
A label disclosing partial networks or modeled data
warmupRequests
Up to four route requests run at startup; configure one per offered mode
Up to eight Cities can be listed. Startup loads their catalogs, keeps them resident, and runs the warm-up requests before accepting visitors. A blocked warm-up result still prepares its mode, but does not prove that journeys exist: check representative journeys separately. Restart the gateway after updating prepared data. On the upstream API, set VIGO_NATIVE_CITY_MAX to fit the list and VIGO_NATIVE_CITY_PROCESSES for the host's memory and concurrency. Links can select a City with ?city=boston.
Limits and security
Limits apply across all Cities, per IP address and minute: 30 route and readiness requests, 60 searches and 600 other reads. Keep the gateway on loopback behind a proxy that sets CF-Connecting-IP. Built assets are served as immutable; the page revalidates by ETag and carries a content security policy. Every Result reports scheduled routing provenance.
For app.vigo.city, src/server/public-routing-edge.mjs runs at the edge in front of the gateway. When the routing host cannot be reached, it serves a self-contained offline page with HTTP 503 and no-store, which offers Go to vigo.city and Stay here; /offline shows that page without contacting the host. API failures stay JSON with X-Vigo-Offline: 1. Rate limits and geocoder errors do not trigger the offline page.
Address search
Search suggests places after three characters and a 150 ms pause, through POST /api/projects/:id/address-search, within the selected City's bounds. It supports exact names and house numbers, street abbreviations, place initials and single-letter typos; nearby duplicates collapse, and stations stay distinct from landmarks with the same name. Arrow keys and Enter select a suggestion, and map picking still works if search fails.
Build a City's local index with osmium installed:
Shell
node scripts/build-address-index.mjs --osm city.osm.pbf \
--output addresses.sqlite --name Boston --bounds'[-72.5,41,-70,43.5]'
Use a complete OSM extract for named landmarks; --places places.json can add an Overpass JSON export made with out center. The builder records source hashes, writes a new file and never changes routing Cities. Keep the index outside the public static directory, and restart the gateway after replacing it. Each City's lookups run on their own worker thread, so a broad search cannot delay routes; a lookup over two seconds counts as no match.
A City with an index answers from it alone, so what people type stays on your host. Set geocoderEndpoint to also ask a Photon-compatible service when the index has no match. A City without an index uses Photon's public demo, which permits reasonable use without an availability guarantee; production volume needs your own geocoder. Remote lookups have an eight-second timeout, two concurrent requests and a one-hour bounded cache, and are canceled when the text changes. Clients cannot choose the geocoder.
Check a deployment
Run npm run typecheck, npm run check:css and npm run check:security. Then, on the deployed site, check City switching, both appearances, address selection, and the route controls and itinerary at phone and desktop widths. The gateway checks cover startup readiness, redaction, allowlists, bounds, shared limits and geocoder failures.
Keep a running application and its City together until the replacement passes your saved requests. A new release does not by itself make an older City compatible or incompatible; the prepared-data contract decides.
Before changing versions
Save the runtime version, package checksum, capabilities output and City inspection (vigo info --city ./city).
Keep the original GTFS and OSM inputs, their checksums, build options and scenario definitions. A prepared City is not a substitute for its sources.
Keep representative Route, Matrix and Reach requests and their Results, including your transfer, walking and arrive-by settings.
Prepared City policy
VIGO keeps a permanent prepared-data baseline: later readers open published Cities without rebuilding, and standard writers produce Cities the published reference runtime can read. The prepared-data contract defines this promise and its release gate.
Cities older than the supported format are not converted. Rebuild them from the original sources into a different directory:
The runtime checks timetable, transfer, street, access and index formats separately, so the outer vigo.city.v1 manifest is not enough, and editing a format marker cannot migrate contents. Some fixes, such as improved station or wheelchair preparation, apply only to Cities built after them; the release notes say when to rebuild.
Validate, switch and recover
Run the saved requests against the candidate through the interface your application uses. Check schemas, no-journey outcomes, walking geometry, times, boardings and resource use, and test a cold start as well as repeated requests. Start a second service on city-next, check readiness and replay the requests before switching. Roll back by restoring the previous binary and City together; never overwrite a City a service has open.
Checks you can run yourself
From a source checkout with the documented toolchain:
Shell
npm ci
npm run build:cli-runtime
npm run build:standalone
npm run check:correctness
npm run check:public-results
npm run check:portability
npm run package:standalone
python3 test/check-standalone-package.py
These use public synthetic inputs and cover independent verification of the algorithms, difficult routing cases, public schemas, moving a City between machines, and running from the extracted package. They need no private data. A local pass does not show that other platforms pass; release CI runs all four.
VIGO 1.0.0 · the vigo executable · request schema vigo.standalone.query.v1 · City format vigo.city.v1
The engine is one native executable. It builds a City from GTFS and OpenStreetMap, opens it read-only and answers Route, Matrix and Reach from the command line, a resident NDJSON stream, or an HTTP service. The City compiler, the routing kernels, the City loader, the HTTP server and SQLite are compiled in; nothing else is needed to build or to query: no Node, Python, browser or network connection.
This page is the complete reference: every command, flag, request field, endpoint and environment variable. It is also the README of the engine archive. For tutorials and explanations, start with the VIGO guide, which the engine serves at http://127.0.0.1:8080/ while vigo serve runs. The public results reference explains every answer, the API schema lists every typed field, and the OpenAPI document describes the HTTP API.
The guides call the engine vigo. Every command accepts --name value and --name=value. Unknown options, options that do not apply to the command, repeated options and extra positional arguments are rejected. A boolean flag is true when bare (--pretty) and accepts --pretty=true or --pretty=false; --pretty false is not boolean syntax.
Commands
Data commands need a City: --city DIR or the VIGO_CITY environment variable. This includes compare. build and build-scenarios write to --output; help, version, capabilities and health need no City.
Command
Purpose
Main input
help, --help, -h
Print the command overview
None
version, --version, -V
Print the version and runtime
None
build
Compile GTFS and OSM into a City; see Build a City
GTFS ZIPs, an OSM PBF and an output directory
build-scenarios
Compile a collection of Cities that share one street network; see Scenario collections
A source manifest and an output directory
capabilities
Supported commands, modes and optional features, as JSON
None
info
Identity, sources, counts, limitations and memory of the City
City
route
A journey between ordered places
JSON request or endpoint flags
matrix
Travel times between every origin and destination
JSON request
reach, isochrone
Reachable streets, raster, polygons and contours
JSON request or origin flags
compare
Changes between two saved Reach Results
JSON with before and after
native
One low-level kernel operation
JSON with operation and input
stream
Resident NDJSON: one request per input line
City; requests on stdin
serve
Resident HTTP service
City and server flags
health
Ask a running service whether it is ready, without loading a City
--host, --port
traffic-import
Convert NDW DATEX II v3 travel times into a traffic snapshot
City and XML files
Commands that start with _ are internal: the HTTP supervisor and Studio's data preparation run them.
A unique, stable scope for each --gtfs; defaults to the file name
--osm PATH
OSM .pbf covering the City
--output PATH
The City directory to write
--street-modes VALUE
walk,drive (default), walk, walk,bike or walk,drive,bike
--prepare-date YYYY-MM-DD
Compile a service date's timetable now; repeat for other dates
--private-access VALUE
public (default) or endpoints
--wheelchair
Build a strict wheelchair City (walking only, public access)
--wheelchair-streets MODE
inferred (default) or verified street evidence for a wheelchair City
--streets-from PATH
Reuse identical prepared streets from another City
--replace
Replace an existing City
--gtfs, --gtfs-scope and --prepare-date may repeat; other options may appear once. Progress goes to standard error as [gtfs], [osm], [transfers] and [city] lines, and the City manifest (network.json) is printed to standard output. Exit 0 means the City was published; exit 2 reports invalid options or a failed build on standard error. The build is staged beside the output and renamed into place when complete: a failure, Ctrl-C or a termination signal leaves an existing City untouched and removes the unfinished one, and the next build cleans up after a crash. GTFS and OSM compile at the same time when installed memory, free memory and load allow it. Build a City explains inputs, combined feeds and large regions. Feeds with frequency-based trips are always compiled from source at query time, so --prepare-date notes and skips them.
Query flags
Flags override the matching fields of the JSON request. stream applies them to every line, so omit --service-date when lines use different dates.
Flag
Commands
Meaning
--city DIR
Data commands
Prepared City or scenario collection; overrides VIGO_CITY
--routing-store FILE
Data commands except serve and traffic-import
When --city names a Studio project's .vigo folder, the timetable store in its routing/ folder to open, such as current.sqlite
--scenario ID
info, route, matrix, reach, native, stream
Member of a scenario collection; omission selects defaultScenario. Sets scenarioId
--request FILE
route, matrix, reach, compare, native
JSON request; - reads standard input
--output FILE
One-shot commands
Save the JSON instead of printing it; - prints
--pretty
One-shot commands
Indent JSON
--format text|json
One-shot commands
text prints a short summary; the default is text in a terminal and JSON otherwise
--diagnostics LEVEL
Query commands
none (default), summary, profile or trace; see public results
--include-geometry
Query commands
Route geometry is on by default; --include-geometry=false omits it. Matrix geometry is opt-in
--include-limitations
Query commands
Add the City's dataset limitations to the Result
--stream-output public|detailed
stream
public Results (default) or the internal vigo.stream.detail.v1 envelope
--service-date YYYY-MM-DD
route, matrix, reach, native, stream
Service date
--time HH:MM[:SS]
route, matrix, reach, stream
Clock; replaces timeMinutes
--mode transit|walk|drive|bike
route, matrix, reach, stream
Travel mode
--from lon,lat or --from stop:ID
route, reach
Origin
--to lon,lat or --to stop:ID
route, reach
Destination; arrive-by Reach takes a destination
--arrive-by
route, matrix, reach
Arrive by --time; --arrive-by=false restores depart-at
--max-walk KM
route, matrix, reach, stream
maxWalkKm
--max-transfers N
route, matrix, reach, stream
maxTransfers
--max-street KM
route, matrix
maxStreetKm
--horizon MINUTES
route, matrix
horizonMinutes
--alternatives N
route
Additional transit journeys, 0–9
--alternative-ranking pareto|ranked
route
How alternatives are chosen
--cutoffs 15,30,45
reach
cutoffsMinutes
--raster-size N
reach
rasterSize
--radius KM
reach
extentRadiusKm
--street-edges
reach
includeStreetEdges
--wheelchair
route, matrix, reach, stream
Require the City's strict wheelchair profile; --wheelchair=false rejects a wheelchair City
Other controls, such as transfer buffers, realtime snapshots, scenarios, via points and bicycle preferences, are JSON fields.
Server flags
serve takes --city and these flags:
Flag
Default
Range and meaning
--host ADDRESS
127.0.0.1
Literal IPv4 or IPv6 address to bind, not a hostname. A non-loopback address requires VIGO_API_TOKEN
--port N
PORT, otherwise 8080
0–65535; 0 selects a free port
--max-body-bytes N
8388608
1024–8388608
--request-timeout-ms N
10000
50–60000; deadline for reading a request and writing its response
--query-timeout-ms N
30000
1–600000; queueing plus computation
--max-connections N
32
2–256 data requests in progress; four further connections stay open to health, readiness, status and cancellation
health accepts --host and --port with the same defaults. It prints ready and exits 0 when GET /readyz succeeds within two seconds, and exits nonzero otherwise.
NDW measurement-site configuration, XML or gzip; required
--measurements FILE
NDW travel-time measurements, XML or gzip; required
--ttl-seconds N
Validity of the snapshot; default 300
Input, output and exit codes
A request file or standard input holds one JSON object, optionally preceded by a UTF-8 byte-order mark, up to 8 MiB. --request - reads until standard input closes.
Results go to standard output; progress and errors go to standard error. With --output, the JSON is written to a temporary file in the same directory and renamed into place, so a reader never sees a partial file; an existing file keeps its permissions. The directory must exist.
Exit code
Meaning
0
A Result was produced, including status: "not_found"
2
Invalid input or a failure; a vigo.error.v1 object is written to standard error
A failed run leaves an existing --output file unchanged: check the exit code before reading it. There is no CSV batch interface in the engine; use Matrix or stream.
The command line, the stream and the HTTP API take the same JSON request. The API schema lists every field with its type, range and default, generated from the engine's request types.
Points
A point is a coordinate, a stop, or both:
JSON
{"coordinate": [-77.05, 38.9]}
JSON
{"stopId": "A"}
Coordinates are [longitude, latitude] in WGS84 degrees: longitude −180 to 180, latitude −90 to 90. A bare [longitude, latitude] array is also a point. A stop can be written {"stop": {"feed": "mbta", "id": "70067"}}, the form Results use, or {"stopId": "70067"}. Stop IDs are exact and case-sensitive; VIGO does not look up names or geocode.
Point objects also accept id, name, label and source, which do not change routing, and the scenario fields editStatus, baselineStopId and baselineStopIndex. A valid stop takes precedence over a coordinate, except with source: "map", which uses the coordinate. Selecting a station includes its prepared platforms; that does not certify a path between every platform.
In a City built from several feeds, an ID can carry its feed scope. Use timetable.identifiers (a native operation) to list the active IDs; a local ID need not be unique in a combined City.
Clocks and service dates
Transit queries need serviceDate (YYYY-MM-DD) and a clock. time is HH:MM or HH:MM:SS with hours 0–71, so 25:10 is 01:10 the next morning on the same service day. timeMinutes (0–4319) is the same clock in minutes; never send both. Street-only queries need a clock but can omit the date.
Clocks are local times in the City's timetable timezone. GTFS service days start at "noon minus twelve hours", so a daylight-saving change keeps every clock on its service day. A Result's journey.clockDate anchors every clock it prints; each transit leg's serviceDate names the day its trip runs. Calendar exceptions apply exactly, and trips from adjacent service days are included where their times overlap the search.
The depart-at timetable search ends at departure plus horizonMinutes; arrive-by searches back to the later of midnight and the deadline minus the horizon. A final walk may finish after the horizon. Drive routing has no travel-time horizon; maxStreetKm bounds it.
route, matrix, reach, compare, native, info or capabilities; required on stream lines
Access padding and overhead from the City's walking policy apply to boarding access, not to a direct walk. The transfer buffer applies once per change, after the transfer walk and any published minimum; it never delays the first boarding, the final walk or staying aboard. Neither control establishes station accessibility or fare eligibility.
arrivalBufferMinutes reserves time before the deadline while keeping the original earliest departure. The deadline must be at least the reserve, and horizonMinutes must exceed it by at least one minute. Via points, depart-at, Walk, Drive, Reach and native operations reject a positive reserve. diagnostics.timeReserves in the trace records both deadlines and calibratedProbability: false. See Time reserves.
Route finds a journey between an origin and a destination. A valid request with no journey returns status: "not_found" and exits 0.
Reference fixture
The examples on this page use VIGO's small public test network A → X → B, with service on 2026-07-15. They are executed against the engine on every documentation check. The IDs do not exist in other Cities; the quickstart has a complete Boston walkthrough.
The journey leaves at 07:55 and arrives at 08:30: 25 minutes riding and 10 minutes waiting. transfers: 1 means two boardings. The public results reference explains every field.
Arrive by
Set timePreference: "arrive_by"; time becomes the deadline. VIGO finds the latest departure that still arrives by then:
Change mode to drive to drive. A drive attaches each free point to the nearest point of a drivable road and enters or leaves that road mid-segment, in the road's direction. The straight gap is a walk at walkSpeedKph, returned as its own walk leg with geometrySource: "coordinate-snap". When that walk would exceed maxWalkKm, the Result is not_found with reason no_drivable_road_within_walk; VIGO never drives across open ground.
Bike needs a City built with bicycle streets. The bike object sets preferences:
Field
Default
Meaning
bike.profile
balanced
balanced, quiet or fast. Preferences choose the route; they never inflate the reported duration
bike.speedKph
18
5–40; cycling speed on flat, smooth road. Surface and mapped incline adjust it
bike.maxLts
No limit
1–4; maximum estimated traffic stress. Above it, the rider pushes at 4 km/h where walking is permitted
For transit requests between coordinates, a direct walk competes with transit and wins when it arrives sooner. Set requireTransitRide: true to require a boarding, or mode: "walk" to ask for walking. A blocked request that names a stop gains no direct-walk fallback. A direct walk is limited by maxStreetKm, or by maxWalkKm when allowLongWalk is false.
Geometry and fares
Route returns leg geometry by default; includeGeometry: false omits it. A transit leg's line runs from the boarding stop along the aligned GTFS shape to the alighting stop, and its distanceMeters is that line's length. Without a usable shape, the line joins the stop coordinates and says so. Transit legs carry the published GTFS fare for a new boarding when the City has fare data; see Published fares.
Alternative journeys
alternatives (0–9, default 0) asks a depart-at transit Route for more journeys at the requested time. The primary journey stays in journey; the others are in alternatives, earliest arrival first.
alternativeRanking chooses them:
pareto (default) keeps trade-offs. Each alternative must beat every other returned journey on arrival, boardings or walking, using no more boardings than the primary journey. When more trade-offs exist than requested, the fewest boardings and the least walking go first. Remaining places go to journeys within the arrival slack that ride a set of routes no listed journey rides, earliest first.
ranked keeps the earliest distinct arrivals, even when another journey is better in every respect, then prefers less walking and fewer boardings. A candidate with the same arrival and less walking replaces the primary journey. It allows one more boarding than the primary journey, within maxTransfers.
Journeys on one vehicle chain are one choice in both rankings. alternativeSlackMinutes (0–120, default 15) bounds how much later than the primary journey an alternative may arrive. alternativeSearch in the Result records the coverage, ranking, limits and status. If a search exceeds its label budget, status is unavailable with a reason, and the primary journey is returned alone. Alternatives cannot be combined with arrive-by, via points or a journey window, except a window with windowChoices: "supported".
Faster journeys with changes can fill every alternative slot before a slower direct service appears. To offer both, send alternatives: 9 with alternativeRanking: "ranked", and a second request with the same endpoints, date, time and walking limits plus maxTransfers: 0. Merge the successful journeys, sort by arrival, remove equivalent departures, and keep the fastest as the recommendation. This is still bounded by the requested count and slack; it is not a list of every service.
Shared-leg services
sharedLegs (default false) on a transit Route lists other services that could replace one leg of the recommended journey. The Result's journey.sharedLegAlternatives.options holds, for each option, a zero-based legIndex and a complete journey. The recommended journey is unchanged.
Services match by route ID, the exact ordered stops with their boarding and alighting permissions, and an equivalent directed path from GTFS shapes or planned geometry (coordinates rounded to six decimals). Route names do not establish identity. A short-turn branch appears only on the part it serves. Missing or mismatched shapes are left out.
Coverage is single_leg_substitutions: each option changes one leg, keeps the other rides, and preserves transfer times and the deadline. Departures are considered from the original leg's departure to 30 minutes later, arriving at most 30 minutes after it. VIGO returns the earliest feasible trip per alternate route, keeps at most 256 candidates per leg and 32 options per journey, and sets truncated: true when a bound is reached. If a substitution VIGO found cannot be rebuilt from the journey's endpoint evidence, it is left out and counted in omitted: {count, reason} (reason access_evidence_unavailable); the next departure of that route is still considered. omitted is absent when nothing was left out, and the recommended journey is unaffected either way. Do not combine options into a journey VIGO has not verified.
The same object reports frequency: "active_departures" and a frequencies entry per verified leg. Each entry counts active trips on the same stops, permissions and path within a half-open window from the leg's departure to 30 minutes later (or the timetable horizon, if earlier). departureCount counts vehicles; uniqueDepartureCount and the sorted departureSeconds count distinct times; departuresPerHour scales the count to an hour; meanHeadwaySeconds, minHeadwaySeconds and maxHeadwaySeconds describe the gaps between distinct times and are null with fewer than two. The scan examines at most 512 departures per leg; when capped, status is incomplete, counts are lower bounds and rates are null. Frequencies describe the segment, not onward connections.
Shared legs work with scheduled and realtime timetables, arrive-by and journey windows. Via points and street modes are rejected.
via (alias waypoints; never both) lists up to 16 intermediate points in order. Each segment is routed in turn, carrying the clock forward for depart-at or backward for arrive-by. No dwell is added at a via point. A blocked segment returns reason via_leg_blocked with its legIndex.
Transit via requests require a boarding on every segment. They reject maxTransfers and a nonzero transfer buffer, because composing segments cannot certify the change at the via point.
Journey windows
windowMinutes (0–240, default 0) repeats the search every windowStepMinutes (1–60, default 1) from the requested time: depart-at moves to later departures, arrive-by to earlier deadlines. Up to five distinct, nondominated journeys are kept, ordered by arrival (depart-at) or departure (arrive-by), then boardings and walking. The first is in journey; the rest are in alternatives. alternativeSearch records minutes, stepMinutes, searches and direction.
A window samples whole minutes; it is not a continuous profile of every departure. Via points take precedence and remove window sampling from their segments.
windowChoices: "supported" asks a depart-at window for the choices a person compares instead of the sampled frontier. VIGO searches each minute of the window and keeps the journeys that are best for some balance of elapsed time, ride time, boardings and walking: the earliest arrival, the fewest transfers, the least walking and a balanced choice, each labeled with its role. With alternatives, alternatives at the requested time join the choices.
Field
Meaning
expandedWalkKm
0.2–5, above maxWalkKm: also search with this walking budget and add choices that walk farther but arrive at least one minute earlier than every ordinary choice. They carry expandedWalkingLimitKm
includeEarliestTransit
Add earliestTransit: the first boarding and arrival of the earliest transit choice, even when walking wins
With via points, each segment starts at the exact clock the previous one reaches its point. Arrive-by accepts windowChoices only without a window.
The compiler, vigo-build, offers a different window: departureWindowMinutes (or --departure-window), a centered depart-at profile of ±0–30 minutes. It rejects the engine's window fields.
Journey policy
journeyPolicy set to "alternatives-v1" on a transit Route returns the journey and its alternatives as one versioned policy for thin clients. Check that capabilities.route.journeyPolicies lists it. The policy keeps a direct transit journey and a permitted direct walk, orders by arrival (departure for arrive-by), then walking and boardings, and bundles journeys that share boarding and alighting stations, modes and walking policy. Arrive-by keeps a 15-minute window of earlier arrivals, sampled every five minutes. Do not combine it with alternatives, windows or via points.
expandedWalkKm is explicit permission to search with more walking; omit it when the user's walking limit is binding. A wider choice must beat every ordinary choice by at least one minute. In supported windows, a final ride (with its wait) is replaced by walking on when the walk fits the wider budget and arrives at least a minute sooner. requireTransitRide excludes walking-only choices. A failed wider search keeps the ordinary results.
Wheelchair and Flex
A City built with --wheelchair answers with the strict wheelchair-strict-v1 profile; wheelchair: true requires such a City and false rejects it. Wheelchair Cities reject Drive, realtime transit and query-time scenario overlays. See Wheelchair routing.
flex: {} on Route or Matrix includes conditional GTFS Flex service. Optional durationFactor (1–10) and durationOffsetSeconds (0–7200) apply when the feed omits its own safe-duration values; bookingConfirmed: true records the caller's claim. See GTFS Flex.
durationsSeconds[row][column] is the time from the shared departure to arrival (depart-at), or from the latest departure to the shared deadline (arrive-by). An arrive-by duration can exceed its journey's duration when the journey arrives early. null means unreachable; zero is a real zero-length trip. Walk, Drive and Bike matrices also return distancesMeters in the same order.
Journeys and journey format
Field
Default
Meaning
includeJourneys
false
Transit only. Adds journeys[row][column], with null for unreachable pairs
includeGeometry
false
Requires journeys. Adds leg geometry
journeyFormat
full
compact returns the same trips, stops, boarding sequences, clocks and totals without display metadata or walking evidence. Requires journeys; excludes geometry
When a direct walk wins a transit cell, its journey has one timed walking leg. Large journey matrices with geometry can reach the response limit; split them. Output detail never changes the search.
Repeated endpoints
Repeated origins or destinations are searched once and expanded back to the requested rows and columns. Stops and coordinates keep their own semantics: two co-located stops are not merged. The trace reports matrixReuse with requestedPairs, searchPairs, uniqueOrigins and uniqueDestinations.
Reach maps where an origin can reach within time cutoffs, or, arriving by a deadline, where a destination can be reached from. isochrone is an alias. Transit Reach combines the timetable with walking on the prepared streets; mode can also be walk, drive or bike.
Arrive-by Reach takes a destination instead of an origin and reads time as the deadline. Each value is how long before the deadline a traveler must leave that place, including any wait after an early arrival; a stop's value is how long before the deadline the traveler must be at the stop.
Transit searches the timetable backward once, giving every stop its latest boarding. Walking runs backward over directed streets, so one-way paths, escalators and station paths keep their direction. A destination behind authorized private access is entered from its public exits. A deadline earlier than the longest cutoff after midnight searches the previous service day's late trips. Scenario exclusions and planned services apply; a compiled overlay and surfaceReuse are depart-at only.
Options
Field
Default
Meaning
origin
Required for depart-at
Where trips start
destination
Required for arrive-by
Where trips end
cutoffsMinutes
[15, 30, 45, 60]
1–16 values, each 1–240; sorted and deduplicated
rasterSize
96
Integer 16–1024; cells per side
extentRadiusKm
8
1–40; the grid's extent around the point, not a trip-distance limit
bounds
From the point and radius
[west, south, east, north]; fixes the grid explicitly
surfaceSampling
street
street samples reached street intervals; cell-center routes to every cell center
reachFormat
full
full, map (areas only) or surface (no polygons or contours)
includeStreetEdges
false
Add directed street evidence (full only)
includeNodes
false
Add reached-node evidence, up to 30,000 nodes (full only)
scenario
—
Exclusions, planned services or a compiled overlay
surfaceReuse
—
Street sampling: baseline keeps this surface in the running process; a following scenario request grows from it when every seed is unchanged or earlier
allDay
—
Aggregate depart-at samples over a window; see All-day Reach
arrayEncoding
json
base64 encodes rasters and street evidence as little-endian arrays; detailed stream output only
Reach rejects horizonMinutes, maxStreetKm, requireTransitRide and allowLongWalk: the largest cutoff bounds the search. Walk-only Reach needs no service date and cannot take a transit scenario.
Drive and Bike Reach route from the point to every cell center, with a 750 km road-distance cap, and return no pedestrian street evidence. The point and each cell center walk straight to their nearest road, and that walk counts toward the cutoff. Dated Bike Reach evaluates timed roads and turns; its cutoffs filter the preferred route's elapsed time.
Surface sampling
street (default) records the earliest reached part of each street in each cell; cells away from reached streets stay empty, and a filled cell does not establish a route to its center. It supports planned service and any walking speed.
cell-center routes to the center of every cell with the Matrix walking rules and the requested bounds. It supports walking and scheduled transit without planned service, and transit uses the City's 4.8 km/h walking policy; other speeds are rejected. Use it to compare with tools that evaluate grid points.
Read the surface
surface.valuesSeconds is a flat, row-major array of seconds starting at the northwest cell: cell (x, y) is index y * width + x. null means no value was reached; zero is a value. With bounds [west, south, east, north], the center of a cell is:
longitude = west + (x + 0.5) / width * (east - west)
latitude = north - (y + 0.5) / height * (north - south)
fullSurface uses the same dimensions over bounds recomputed from the reached streets, which can be smaller or larger than the requested view; never read its values with the requested bounds. areas and fullAreas are GeoJSON FeatureCollections of MultiPolygons, and contours and fullContours of MultiLineStrings; each feature carries its cutoff. Areas keep holes and separate islands; contours interpolate the raster and never draw a hull across unreachable space.
Map output
reachFormat: "map" returns only the full reached-area polygons as areas, their bounds, and the usual metadata: no raster, stops or contours. The polygons equal fullAreas from the default full format. Map output cannot be compared; use full for analysis.
Street evidence
includeStreetEdges: true (or --street-edges) adds surface.edges with schemaVersion: "vigo.standalone.street-edges.v2" and encoding: "indexed-json": the directed street intervals reached, with times and walking distances. Decode directed street evidence shows how to read them.
All-day Reach
allDay samples scheduled depart-at transit every five minutes over a service-day window, default [0, 1440) minutes (288 samples). Omit time and timeMinutes.
Run it with vigo reach or on a stream line. It supports street sampling, scheduled transit, depart-at and reachFormat: "surface" only; scenarios, realtime, arrive-by, cell-center sampling, polygons, caching switches, node and edge evidence and per-sample output are rejected. Studio and the compiler do not offer it.
The Result keeps schema: "vigo.reach.v1". allDay.sampleCount is the denominator. The surface holds reachableSamples, meanReachableDurationSeconds (null when never reached) and reachableSamplesByCutoff, one row per entry of cutoffsSeconds. Divide a count by the sample count for the share of departures that reach the cell. The mean covers only the reachable samples, so a low mean does not mean reliable access. Memory does not grow with the number of samples.
A scenario changes the transit service seen by one Reach or transit Route request. It changes nothing in the City or in later requests. See Scenarios for how to design one.
Route on a scenario
A Route scenario routes on the scheduled timetable with excluded trips removed and planned services added. Planned stops given as stopId are those stops; others are new stops, joined to the network by walks within the City's stop-transfer radius and reachable within maxWalkKm. Planned stops, routes and trips belong to the feed scenario-<hash>; a planned route's ID is its service id and its name is the service name. Route scenarios accept services and exclusions, not overlay, and use scheduled data. Repeating a scenario reuses its timetable view.
At least two points in service order; at most 256 distinct planned points per request
scheduleMode
frequency (add, augment); preserve-trips (replace)
How departures are made
sourceRouteId
—
Route replaced by a frequency replace without explicit trips
bidirectional
true for frequency
Also run the reverse direction. Preserved trips reject true
startMinutes, endMinutes
300, 1500
0–4319; end after start. The window includes its end unless exactTimes is true
headwayMinutes
12
0.1–1440
exactTimes
—
true fixes departures at the start and every headway, excluding the end; otherwise Monte Carlo samples a phase
timeModel
estimate-distance
estimate-distance, preserve-scheduled or infer-road
averageSpeedKph
22
1–300; with distance estimates
dwellMinutes
0.35
0–60; dwell after arriving at each intermediate stop
segmentRuntimeMinutes
—
One value per consecutive stop pair
segmentDistancesKm
—
One value per consecutive stop pair
addedStopDwellMinutes
0
0–10; dwell at inserted stops with supplied runtimes
scheduledTrips
—
Explicit trips for preserve-trips
timetables
—
Up to 32 timetable rows replacing the top-level window; see Monte Carlo
phaseFrom
—
Coordinate a non-exact service with another; Monte Carlo only
timing
—
Speed and dwell edits for preserve-trips; see Monte Carlo
A request accepts at most one million planned stop events. estimate-distance uses the projected distance between stops, the speed and the dwell; supplying runtimes does not select them. preserve-scheduled uses supplied runtimes, falling back to distance estimates. infer-road consumes supplied distances or runtimes; the engine does not trace roads itself.
Frequency windows use whole seconds. Every run arrives, dwells, then departs, so riders alight before the dwell; runs do not dwell at their first or last stop. A frequency service runs on every service day: the previous day's runs still running after midnight and the next day's first runs join the timetable wherever the query's clock reaches them, and no departure runs twice.
augment keeps existing service. A frequency replace with sourceRouteId removes the route's active trips; with scheduledTrips, their trip IDs define what is removed. Added service can run on a date with no baseline service.
Offsets are seconds after the run's departureSeconds, one per stop, in chronological order. canBoard and canAlight are 0 or 1 per stop and default to all allowed. Unknown trip fields are rejected. The replaced tripId must be active on its service day. serviceDayOffset (−3 to 3, default 0) names the service day a trip runs on: a trip with −1 belongs to the previous day, its departureSeconds are on that day's clock, and only its calls after the query date's midnight remain. A replacement removes every instance of its original trip, so include the previous day's trips that run past midnight; Studio and the compiler do. Preserved trips never create reverse runs.
Compiled overlays
Advanced clients can send scenario.overlay with the arrays of TimetableOverlayManyQueryInput: stops, overlayStopCount, direction offsets, stops and times, service windows and headways, and supplemental transfers. The stop count must match the coordinate-bearing stop list and be at most 256. Direction stops use overlay-local indices; supplemental transfers use the combined resident-plus-overlay domain. The native field reference gives the exact types.
compare reports where travel times improve, worsen, appear or disappear between two saved Reach Results on the same grid.
Prepare the comparison
Send the two complete Result objects under before and after; not filenames:
Shell
python3 - <<'PY'
import json
with open('baseline.json') as f:
before = json.load(f)
with open('scenario.json') as f:
after = json.load(f)
with open('comparison.json', 'w') as f:
json.dump({'before': before, 'after': after}, f)
PY
vigo compare --city ./city --request comparison.json --output change.json
Python is only a convenient way to build the file. The engine requires a City path for compare even though it does not route. Both Results must share the City revision, bounds, dimensions and compatible rasters. Engine Compare accepts Reach only; the compiler's vigo-build compare --before … --after … also compares Route and Matrix Results.
Interpret changes
The Result, vigo.compare.v1, reports after minus before. counts splits the cells reachable in both (comparable) into faster, slower and unchanged, and counts newlyReachable and noLongerReachable separately. meanChangeSeconds averages comparable cells, is negative when travel got faster, and is null when none are comparable. The trace has the per-cell deltaMinutes grid; see Comparison output.
Compare checks the grid, not the experiment: keep the origin, date, clock, walking policy and cutoffs identical yourself.
Source paths are relative to the manifest; optional sha256 values pin each input. Streets are prepared once and referenced from every member, so move the collection as one directory. build-scenarios takes --spec, --output, --wheelchair and --wheelchair-streets, prints the same progress as build for each member, and prints the collection manifest with its storageBytes on standard output. The output directory holds scenarios.json, checksums.json (a SHA-256 for every file), cities/<id> and streets/<OSM SHA-256>. It must not exist yet; the collection is staged beside it and renamed into place when complete, and an interrupted build is removed as for build. prepareDates precompiles up to 32 service dates; other dates still work from the source timetable.
Each request selects a member with scenarioId (or --scenario); omission selects defaultScenario. At most maximumResidentScenarios members stay loaded; see Runtime memory and caching.
"privateAccess": "endpoints" gives every member the authorized endpoint access overlay. These members keep separate street directories, because the overlay depends on each member's stops.
"wheelchair": true (or build-scenarios --wheelchair) prepares every member with wheelchair-strict-v1. Wheelchair collections require streetModes: "walk" and public access. Conflicting command-line and manifest values are rejected.
A query can carry GTFS-Realtime predictions or traffic observations, and vigo serve can poll feeds itself. Without polling, each query uses only what it carries; the next request without it is scheduled again.
routingDataMode: "scheduled" rejects observation input; "realtime" requires a snapshot, traffic or a polling server. Without an explicit mode, supplied input selects its path.
Transit snapshot
Transit Route, Matrix and Reach accept realtimeSnapshot and all search the same realtime timetable; a Reach scenario applies on top of it. Send a FULL_DATASET snapshot with tripUpdates and, optionally, alerts. Timestamps are POSIX seconds. Every record needs a sourceFeedTimestamp or the snapshot's feedTimestamp, at most 180 seconds old and at most 60 seconds ahead; a record's own timestamp, when present, must also be fresh.
To try it on the fixture, add a current synthetic delay to the first route request:
Shell
python3 - <<'PY'
import json, time
with open('route.json') as f:
query = json.load(f)
query['routingDataMode'] = 'realtime'
query['realtimeSnapshot'] = {
'incrementality': 'FULL_DATASET',
'feedTimestamp': int(time.time()),
'tripUpdates': [{'tripId': 'T2', 'delaySeconds': 600}]
}
with open('realtime-route.json', 'w') as f:
json.dump(query, f)
PY
vigo route --city ./city --request realtime-route.json
In real use, keep the provider's timestamps. Rewriting them to look current changes the input; it does not replay the observation.
Trip update field
Meaning
tripId
Exact, or unambiguous scoped or local, static trip ID; nested trip.tripId is also accepted
sourceScope
The feed scope the record belongs to in a multi-feed City; omit it in a single-feed City
startDate
Optional service date check (YYYYMMDD or YYYY-MM-DD)
routeId, directionId
Optional identity checks
delaySeconds
Trip delay, propagated forward
scheduleRelationship
SCHEDULED, CANCELED, DELETED or REPLACEMENT
stopTimeUpdates
Predictions for individual calls
A stop time update names its call by stopSequence or an unambiguous stopId; when both are present they must agree, and loops need the sequence. arrival and departure are separate objects with an integer delay or an absolute time in seconds. Absolute times need realtimeSnapshot.timezone when the City has more than one timezone. SKIPPED removes a call; NO_DATA resets the propagated delay. A REPLACEMENT must give every call with an existing stop, an increasing sequence and absolute times.
Invalid, duplicate, stale, ambiguous and unmatched records keep scheduled service and are counted. A malformed snapshot fails the request. meta.realtime reports coverage and the counts of applied, canceled, stale, invalid, duplicate and unmatched records; Realtime transit explains how to read them. A transit leg on an updated trip reports quality.schedule: "realtime".
Service Alerts
realtimeSnapshot.alerts holds Service Alerts, in the form the server's poller produces:
An informed entity matches when all of its fields match (routeId, routeType, directionId, trip.tripId, stopId); an alert applies when any entity matches. A station stopId also selects its platforms. Active periods are POSIX seconds with open bounds; no period means always active. effect is a name or its GTFS-Realtime code.
Effect
Routing
NO_SERVICE on a route, trip or route type
Its trips cannot be boarded or left during the period
NO_SERVICE on a stop
No boarding or alighting there; vehicles pass through
NO_SERVICE on a route and a stop
That route does not serve that stop
Any other effect
None; the alert is reported on the legs it describes
Every fresh alert active during a ride that selects its trip, route or stops appears in the leg's alerts (id, effect, cause, severity, header, description, url). meta.realtime.alerts counts received, fresh, stale and NO_SERVICE alerts, the closed boardings and alightings, and entities VIGO cannot resolve, such as an agency alone or a direction without a route. A City with several timezones reports status: "timezone_required" unless the snapshot has a timezone. Wheelchair Cities use scheduled service, so ACCESSIBILITY_ISSUE is reported, not applied.
HTTPS, or loopback HTTP for local mirrors. Redirects are rejected
sources[].kind
feed (default: Trip Updates and Alerts), tripUpdates or alerts. Vehicle Positions are never polled
sources[].sourceScope
The static feed the source describes, in a multi-feed City
sources[].headers
Up to eight request headers, such as an API key. Status output never shows URLs, queries or headers
intervalSeconds
5–3600
timeoutSeconds
1–60 per request
Up to 16 sources. Downloads are limited to 32 MiB, or 128 MiB after gzip, and each feed must be a FULL_DATASET FeedMessage within the snapshot limits.
Set routingDataMode: "realtime" and omit realtimeSnapshot to route on the server's latest snapshot; an inline snapshot takes precedence for its own query. meta.realtime.snapshot names the snapshot used (source: "server", its id, generation, and each source's timestamp and failure). Identical content never publishes a new generation.
One background producer downloads, decodes and merges the sources; routing never waits for a download. While idle, the worker installs each publication and derives the realtime view of the last live query, so the next one normally finds it ready. A failed source keeps its last good records without extending their validity: they still expire after 180 seconds, and coverage.complete becomes false. Failures back off exponentially, up to one hour. GET /v1/realtime reports status (fresh, stale_fallback or unavailable_fallback), generation, snapshot ID, counts, attempts, failures, the next attempt and each source's state.
Polling serves a single City, not a scenario collection. DIFFERENTIAL feeds, deleted entities, added trips and trip modifications are not applied.
Drive traffic
Drive Route and Matrix accept a traffic object. With routingDataMode: "realtime", it replaces the road costs for that request: one fixed set of costs, not a forecast that changes during the trip.
Field
Meaning
observedAt
Observation time, RFC 3339 or Unix seconds or milliseconds; aliases fetchedAt, timestamp. Required
ttlSeconds
Validity, 1–1800; default 300
expiresAt
Optional explicit expiry
source
Provider label
observations
The observed roads; aliases segments, edgeUpdates
At now >= expiresAt the request uses baseline costs and reports stale_fallback. Observation times more than 60 seconds in the future and malformed validity are rejected. The admission clock is fixed once per request.
Each observation identifies a directed road by coordinates (2–512 points), by fromCoordinate and toCoordinate, or by edgeIndices bound to the City's streetSourceFingerprint, and sets exactly one effect:
Effect
Range
closed: true
Makes the matched directed edges unavailable
travelTimeSeconds
0.01–86400 for the whole matched path, spread in proportion to baseline edge times
speedKph
1–200
delayFactor
1–100; aliases factor and multiplier
At most 100,000 observations and 200,000 affected edges. Geometry is matched to a connected directed path: the matcher checks endpoint proximity, forward progress, shape coverage within a corridor at most 30 m wide, and length, and rejects competing paths within its ambiguity margin. Opposite directions are separate. Unmatched, ambiguous and over-budget observations are reported, never guessed. Overlapping observations keep the largest cost, and no edge becomes faster than baseline.
Raw callers can send snapshotKey, edgeIndices and edgeTimeUnits (hundredths of a second; 2147483647 closes an edge) with the streetSourceFingerprint. The actual weights, not the key, decide cache identity. meta.traffic reports status, timestamps, the effective key, matching counts and rejections.
Every field is optional; {} selects these defaults. URLs require HTTPS, except loopback HTTP; redirects are rejected. Ranges: intervalSeconds 1–3600, configurationRefreshSeconds 60–86400, ttlSeconds 1–1800, timeoutSeconds 1–60. Poll at the source's update cadence, normally 60 seconds. Downloads are limited to 16 MiB and decompressed XML to 256 MiB.
Set routingDataMode: "realtime" and omit traffic to drive on the latest snapshot; an inline traffic takes precedence. Before the first successful poll, realtime Drive reports meta.traffic.status: "unavailable_fallback"; after expiry, stale_fallback. Both use baseline costs.
One background producer downloads, joins and matches the feed to the City's driving graph. Only sites whose endpoints lie within 120 m of the City bounds are kept. Failures keep the last snapshot without extending its validity and back off up to one hour. GET /v1/traffic reports freshness, generation, attempts, failures, the next retry, matching counts and timings. Polling serves a single City, not a collection, and never rewrites City files. A new metric still needs one customization of the driving hierarchy on its first query.
Import NDW DATEX II v3 traffic
traffic-import converts local NDW files into a traffic object:
Download both publications from the NDW open-data portal. Put the output in a request's traffic field with routingDataMode: "realtime". The City must include driving. Import again for each feed update; a failed import leaves the previous output file unchanged. ingestion in the output reports rejected records, matching results and timings.
The importer targets the Verkeersdata NL DATEX II 3.6 AVG profile. It joins table identity, site identity and version, and measurement index; reads ordered GML geometry; and uses the measurement time, not the publication or download time. Invalid values, forecasts, erroneous measurements and stale records are excluded. The snapshot expires with its earliest retained measurement.
Supported observations are whole-path travel times and speeds with an explicit linear itinerary and unrestricted vehicle scope. Point detectors, lane- or vehicle-class values, OpenLR or ALERT-C locations, incident and closure publications, and time overrides are rejected with reasons. No closure is inferred from a missing or zero measurement. Matching is conservative geometric conflation, not proof that the provider and OpenStreetMap describe the same road; inspect the matched coverage before relying on it.
Every line needs kind: route, matrix, reach (or isochrone), compare, native, info or capabilities. Output is one compact JSON object per line, in input order, echoing id and adding a sequence number. Blank lines are ignored. Each line may use its own service date; a new date replaces the active timetable, and recently used timetables are retained. An invalid line returns a vigo.error.v1 object on standard output and the stream continues; a line over 8 MiB ends the stream. Close standard input to finish.
When the stream opens, it prepares modes in the background as VIGO_PREPARE selects; a first request waits only for the part it needs. The stream has no query deadline or restart; use serve or your own supervisor for those. --stream-output=detailed returns vigo.stream.detail.v1 envelopes holding the internal trace; check that capabilities.output.streamFormats lists detailed first.
Measure a fresh process's first answer separately from later answers in a resident process.
vigo serve answers the same JSON requests over HTTP. The OpenAPI document is served at /openapi.json; the guide, with an API console at the end of this page, is served at /.
Endpoints
Method and path
Response
Authentication
GET /, /docs, /docs/
This guide, offline, with an API console
Public
GET /openapi.json, /docs/openapi.json, /standalone-openapi.json, /docs/standalone-openapi.json
OpenAPI 3.1 document
Public
GET /healthz
200 while the process runs; status is ready or recovering
Public; no City data
GET /readyz
200 when a worker is ready, 503 while it recovers
Public; no City data
GET /v1/capabilities
Features of this executable
Protected
GET /v1/info
The loaded City or collection
Protected
GET /v1/realtime
GTFS-RT polling status
Protected
GET /v1/traffic
NDW polling status
Protected
POST /v1/route
Route
Protected
POST /v1/matrix
Matrix
Protected
POST /v1/reach, /v1/isochrone
Reach
Protected
POST /v1/compare
Compare two saved Reach Results
Protected
POST /v1/native
A native operation
Protected
DELETE /v1/requests/{id}
Cancel a named request
Protected
"Protected" means a bearer token when VIGO_API_TOKEN is set, and otherwise a loopback Host and same-origin browser requests; see Authentication.
The path selects the query; a body kind is overwritten. Send Content-Type: application/json with a Content-Length or a bounded chunked HTTP/1.1 body. Conflicting length headers are rejected. Each connection closes after its response: there is no keep-alive, HTTP/2, WebSocket, gzip, streamed response or CORS. Every response carries a restrictive Content-Security-Policy that lets the embedded API console call only this service. Query parameters diagnostics (or vigo_diagnostics), includeGeometry and includeLimitations set the matching body fields; conflicting values are rejected.
Server limits
The service runs an HTTP front end and one supervised worker process that keeps the City loaded and answers one query at a time; a query can use several threads. Request bodies are read outside the worker. A worker that times out or fails is stopped and replaced. The service keeps no client sessions.
Server flags set the main limits; see Server flags. Beyond them:
Uploads and queued requests share a 64 MiB admission budget, and pending responses a 128 MiB budget. A worker result counts against the response budget while it is read, not after it is buffered, so a large result never exceeds it. Exhaustion returns 503, before 100 Continue for uploads.
Headers are limited to 16 KiB and 64 entries. A worker result is limited to 64 MiB; split large matrices or rasters.
Writing a response has a 10-second deadline. A worker may take up to 60 seconds to open the City.
Waiting routes and matrices of up to 1,024 cells get up to 32 turns or 250 ms of worker time before the oldest waiting analytical request, so a batch of Reach jobs cannot starve point queries. The running query always finishes first.
GET /healthz, /readyz, /v1/capabilities, /v1/realtime, /v1/traffic and DELETE /v1/requests/{id} may use four connections beyond --max-connections, so a service saturated by data requests still reports its health and accepts cancellations.
A client that closes its connection while its query waits or runs cancels the query, as DELETE /v1/requests/{id} does. A client that half-closes its sending side counts as gone.
One worker answers one query at a time: --max-connections and --max-queue bound waiting work, they do not add parallel computation, and a long Reach or Matrix delays the queries behind it. To serve more queries at once, run several services, each with its own worker and City, behind a load balancer that bounds its own queue, and keep expensive analysis on separate instances when interactive latency matters. Each instance holds its own City in memory. Request IDs are per instance, so send DELETE /v1/requests/{id} to the instance that received the request. Measure throughput with an open-loop load such as scripts/stress-http.py (see Reproduce a service workload).
These limits bound transport buffers, not process memory. See Resource limits.
Cancel a request
Give a request an id of up to 128 letters, digits, hyphens, underscores or periods. DELETE /v1/requests/{id} returns 202, and the original request returns 499. Running work is stopped and its worker replaced; queued work is skipped. Reusing an active ID returns 409. Closing the client connection cancels a query the same way, with or without an id.
Status codes
Status
Meaning
200
A Result, including not_found Routes; or metadata and documentation
202
Cancellation accepted
400
Invalid query, JSON or HTTP framing
401
Missing or wrong bearer token
403
Without a token: a non-loopback Host, or a browser Origin other than the service's own
404
Unknown path or method
408
Request read deadline
409
The request id is already active
413
Body over the limit
417
Unsupported Expect header
431
Headers too large
499
Canceled through DELETE /v1/requests/{id}, or by the client closing its connection
503
Connection, queue or buffer capacity exhausted, or worker unavailable; readiness uses it too
504
Query deadline, worker failure or response failure
Errors use schema: "vigo.error.v1" with error.code and error.message; handle the code and status, not the message. Retry 503 with backoff. For 504, reduce the work or read the worker log before raising deadlines. A transport error never means a trip is unreachable.
The service logs its address to standard error. If a replacement worker cannot start, the first failure of each streak is logged, /readyz and queries return 503, and restarts back off from 250 ms to 10 seconds.
Authentication
Set VIGO_API_TOKEN to protect every /v1 endpoint, including on loopback, and send Authorization: Bearer <token>. A non-loopback --host requires a token of at least 16 characters. Set it through your secret store: it is never a command-line argument, and the service does not store tokens or request bodies.
Without a token, a loopback service accepts data requests only when Host is 127.0.0.1, localhost or [::1] (with an optional port) and any Origin is that same http:// origin; other requests get 403. This blocks DNS rebinding and cross-site requests. A local reverse proxy that sends another Host needs a token. The guide, the OpenAPI document and the health endpoints are always public and contain no City data.
Shell
export VIGO_CITY=/srv/vigo/city
# Set VIGO_API_TOKEN through your shell or platform secret store.
vigo serve --host 0.0.0.0 --port 8080 \
--query-timeout-ms 30000 --max-queue 8 --max-connections 32
curl --fail-with-body http://127.0.0.1:8080/v1/route \
-H"Authorization: Bearer $VIGO_API_TOKEN" \
-H'Content-Type: application/json'--data-binary @route.json
Terminate HTTPS at a reverse proxy, and give its upstream timeout room for the query deadline plus transfer. Deploy the routing engine covers containers and process managers.
Client integration
Any HTTP client works; no VIGO package is needed. A Python standard-library client:
Python
import json
import os
import urllib.error
import urllib.request
query = {
"origin": {"stopId": "A"},
"destination": {"stopId": "B"},
"serviceDate": "2026-07-15",
"time": "07:55",
"maxWalkKm": 0.2,
}
headers = {"Content-Type": "application/json"}
if os.environ.get("VIGO_API_TOKEN"):
headers["Authorization"] = "Bearer " + os.environ["VIGO_API_TOKEN"]
request = urllib.request.Request(
"http://127.0.0.1:8080/v1/route",
data=json.dumps(query).encode(), headers=headers,
)
try:
with urllib.request.urlopen(request, timeout=45) as response:
result = json.load(response)
except urllib.error.HTTPError as error:
raise RuntimeError(error.read().decode()) from error
if result["status"] == "not_found":
print("No journey:", result["reason"]["code"])
else:
print(result["journey"]["arrivalTime"], len(result["journey"]["legs"]), "legs")
Read the HTTP status before the body: a 200 body can be a valid not_found. Keep bearer tokens on servers; never embed a shared token in public web code. For reproducible work, keep the executable version, capabilities, City revision, complete request, observation timestamps and Result together.
Every variable the engine reads. Command-line flags override the matching variables.
Variable
Default
Meaning
VIGO_CITY
—
Default City or collection path; --city overrides it
PORT
8080
Default port for serve and health; --port overrides it
VIGO_API_TOKEN
—
Bearer token for /v1 endpoints; required, at least 16 characters, for a non-loopback bind
VIGO_PREPARE
all
Modes a single-City stream or serve worker prepares in the background when it opens: all, none, or a comma-separated list of transit, walk, drive and bike. Transit activates today's timetable in the City's timezone; walk loads the pedestrian hierarchy while no request is waiting; drive and bike open their networks. A request waits only for the part it needs. Collections prepare on first use
RAYON_NUM_THREADS
Available CPUs
Threads used inside one query
VIGO_MAX_RESIDENT_SCENARIOS
Collection's maximumResidentScenarios
1–16 collection members kept loaded
VIGO_RESIDENT_HEAP_BYTES
min(1 GiB, memory ÷ 3)
Retained-heap budget for a collection's resident members; not a process memory limit
Budget for inactive scheduled timetables; 0 disables retention
VIGO_ENDPOINT_CACHE_MAX_BYTES
64 MiB per endpoint role, or ÷ 64 of memory
Endpoint-access cache budget
VIGO_SHAPE_GEOMETRY_CACHE_MAX_BYTES
64 MiB, or ÷ 64 of memory
Transit shape cache budget
VIGO_SHAPE_GEOMETRY_CACHE_MAX_ENTRIES
1024
Transit shape cache entries
VIGO_IDLE_RELEASE_MS
30000
After this idle time, a single-City stream frees street search scratch; 0 keeps it
VIGO_BIKE_INDEX_DIR
User cache
Directory for the disposable bicycle hierarchy index
VIGO_MEMORY_ACCOUNTING
Off
1 adds result-tree memory accounting to memory diagnostics; slows queries
VIGO_BIKE_TRACE
Off
Any value prints bicycle preparation and search timings to standard error
The bicycle index lives in the user cache directory (~/Library/Caches/VIGO on macOS, $XDG_CACHE_HOME/vigo or ~/.cache/vigo on Linux, %LOCALAPPDATA%\VIGO\Cache on Windows). It is derived from the City, holds graph data only, and can be deleted at any time.
vigo build also reads these variables. The routing variables change the prepared City and its policy identity; leave them unset for comparable Cities.
Variable
Default
Meaning
VIGO_ROUTING_WALK_SPEED_KPH
4.8
Walking speed, 1.5–8 km/h
VIGO_ROUTING_WALK_PADDING_FACTOR
1
Walking distance multiplier, 0.75–3
VIGO_ROUTING_WALK_OVERHEAD_SECONDS
0
Seconds added to each walk, 0–900
VIGO_ROUTING_TRANSFER_RADIUS_M
500
Longest walking transfer between stops, 50–1,200 m
VIGO_ROUTING_TRANSFER_MAX_NEIGHBORS
0 (unlimited)
Nearest stops considered for walking transfers, up to 4,096
VIGO_BUILD_SQLITE_CACHE_KIB
32,768
SQLite page cache of each store build writes, 4,096–262,144 KiB
VIGO_READONLY_SQLITE_CACHE_KIB
16,384
Page cache while reading a store for its topology, 4,096–262,144 KiB
VIGO_READONLY_SQLITE_MMAP_BYTES
0
Memory-mapped bytes while reading a store for its topology, up to 2 GiB
VIGO_STREET_ACCELERATOR_MAX_EDGES
40,000,000
Largest pedestrian graph given a snapshot
VIGO_STREET_ACCELERATOR_MAX_STORE_BYTES
12,000,000,000
Largest street store given a pedestrian snapshot
VIGO_DRIVE_ACCELERATOR_MAX_NODES
40,000,000
Largest driving graph given a snapshot, in nodes
VIGO_DRIVE_ACCELERATOR_MAX_EDGES
20,000,000
Largest driving graph given a snapshot, in edges
VIGO_NATIVE_ENDPOINT_WORKSPACE_M
1,600
Walking radius of the endpoint workspaces reserved while preparing access, 100–5,000 m
VIGO_ACTIVE_KERNEL_MAX_BYTES
Memory ÷ 8, 64 MiB–2 GiB
Largest timetable --prepare-date compiles, 1 MiB–16 GiB; a larger date fails the build
VIGO_ACTIVE_KERNEL_SNAPSHOT_CACHE_BUDGET_BYTES
min(512 MiB, the limit above ÷ 4)
Prepared timetables kept beside a routing store, 8 MiB–2 GiB; older ones are removed
Studio and the compiler's runtime read further variables; see Runtime limits.
The engine, the compiler, the resident stream and the HTTP API return one public Result format. This page explains how to read it. The API schema lists every field with its type, generated from the engine's result types.
Version policy
Each Result names its schema: vigo.route.v1, vigo.matrix.v1, vigo.reach.v1, vigo.compare.v1, vigo.distribution.v1 or vigo.error.v1. Within a v1 schema, required fields keep their names, types, units and meanings; new optional fields may appear. Removing or renaming a field, changing a unit, or changing a status meaning requires a new schema version. Clients should ignore fields they do not know.
trace, native operations and Studio's internal messages are outside this policy. Result schema versions are independent of the City format and of the executable version, which meta.engineVersion reports.
Read a Result
Read status first:
status
Meaning
Exit code / HTTP
ok
The query completed with an answer
0 / 200
not_found
A valid outcome: nothing satisfies the request (Route)
0 / 200
error
The request was invalid or failed; see error
2 / 4xx or 5xx
Every Route, Matrix and Reach Result also carries:
Field
Meaning
schema
The schema name and version
mode
transit, walk, drive or bike; for transit, the mode actually returned can be walk
query
The normalized request: places in public form, serviceDate, requestedTime, timePreference, dataMode
Qualifications of the answer, each with a code and a message; absent when none
id, sequence
The caller's id, and the line number on a stream
scenarioId
The collection member used, when the City is a collection
accessibility
The wheelchair profile, its street evidence and limitations, in a wheelchair City
datasetLimitations
The City's limitations, with includeLimitations: true
In a terminal, Route prints a short itinerary. Pipes, --output and --format json produce JSON; --format text asks for the terminal view.
Route
vigo.route.v1 holds one journey, or null when status is not_found.
Journey
Field
Meaning
departureTime, arrivalTime
Service-day clocks, HH:MM:SS; hours can exceed 23
clockDate
The date those clocks count from; null for a walk or drive without a service date
durationSeconds
Arrival minus departure
walkingSeconds, ridingSeconds, waitingSeconds
Time walking, on vehicles, and in the gaps before and between legs
drivingSeconds, cyclingSeconds
Time driving or cycling, in those modes
boardings, transfers
Vehicles boarded; transfers is boardings − 1
legs
The chronological legs
expandedWalkingLimitKm
Present on a choice found with a wider walking limit
Durations are whole seconds, rounded at the public boundary; the search keeps full precision. Waiting is the gaps between legs, not a reliability margin. An arrive-by journey can arrive before the deadline.
alternatives holds further distinct journeys, without the primary or duplicates, and is omitted when there are none. alternativeSearch records how they were found: requested alternatives (coverage: "requested_time") or a journey window (with its sampling direction). See alternative journeys and journey windows.
Legs
Every leg has type, from, to, departureTime, arrivalTime, durationSeconds, an optional distanceMeters, optional GeoJSON geometry, and a quality.
type
Leg
walk
A continuous walk; street and station pieces are listed in components
transit
One ride on one trip
drive, bike
Driving or cycling
from and to are places: a coordinate, plus stop and name at a stop. Stops, routes, trips and services are identifiers of the form {"feed": "mbta", "id": "70067"}; feed is null in a single-feed City. Requests accept the same form, {"stop": {"feed": "mbta", "id": "70067"}}, or the plain {"stopId": "70067"}.
A transit leg adds route (with id, shortName, longName, type and color), trip, service, serviceDate, headsign, tripShortName, directionId and intermediateStops with their times. It can also carry:
fare: the published fare for a new boarding (status: "published", with the fare standard, options and source), or why there is none (status: "unavailable", with a code such as missing_catalog or no_rule, and a reason). See Published fares.
alerts: Service Alerts active during the ride, from a realtime snapshot.
continuation: {"type": "stay_aboard", "durationSeconds": 300} when an explicit GTFS link keeps the rider aboard from the previous leg. That time is riding, not waiting.
quality.flex: the assumptions and booking rules of a GTFS Flex ride.
Geometry is included by default for Route (includeGeometry: false omits it) and is opt-in for Matrix journeys. A transit line runs from the boarding stop along the aligned GTFS shape to the alighting stop, and its distanceMeters is that line's length. Geometry is the modeled path, not a vehicle trace or a surveyed station interior. If any piece of a walk lacks geometry, the leg omits its line rather than drawing across the gap.
journey.sharedLegAlternatives appears with sharedLegs: true; its options and frequencies are described in shared-leg services. Their legIndex values refer to this leg list.
No journey
A not_found Route has journey: null, a reason with code and message, and an access report for each end that explains how far walking reached. When no journey is found lists the codes. A not_found Result is a complete answer: keep it, and never replace it with zero.
Keep uncertainty with the answer
Each leg's quality says what its evidence is:
Field
Values
Transit quality.geometry
gtfs_shape (aligned to the feed's shape), stop_sequence (straight lines between stops) or unknown
Transit quality.schedule
timetable (scheduled times), source_time_limitations (the feed repeats times or bridges untimed stops), realtime (an applied prediction) or flex_estimate
Walk quality.geometrySource
osm, osm_and_station_path, gtfs_pathway, station_selection, unverified_transfer or unknown
Walk quality.streetGeometry
verified when the street part is a path in the prepared graph, otherwise unverified
Walk quality.stationPath
source_path (declared pathways) or inferred (an assumed station link)
Walk quality.stationTime
estimated when untimed stairs or gates use VIGO's estimates
A verified street path does not certify a complete entrance-to-platform path, and timetable means scheduled, not observed, times. A walk that starts or ends off the street network reports the straight hop as endpointConnector, with streetPathVerified: false. components separates street and station costs and names their sources. Walking evidence explains station costs.
No warnings does not certify complete source coverage. City-level limitations are in vigo info and GET /v1/info, or in a Result with includeLimitations: true; unsupported GTFS features are in Known limits.
Matrix
vigo.matrix.v1 returns durationsSeconds[origin][destination] in request order, with the endpoints echoed in query. Unreachable cells are null, never zero, and a completed matrix can contain both.
Depart-at: seconds from the shared departure to arrival.
Arrive-by: seconds from the latest departure to the shared deadline, including any wait after an early arrival. The nested journey shows the actual arrival.
journeys[origin][destination]: with includeJourneys: true, a journey or null per cell.
distancesMeters: for Walk, Drive and Bike, distances in the same order.
access: access reports keyed by endpoint index, when an endpoint could not reach the network.
Reach
vigo.reach.v1 returns:
Field
Meaning
cutoffsSeconds
The cutoffs, sorted
surface
width, height, bounds and valuesSeconds, row-major from the northwest cell; null where unreached
fullSurface
The same grid over the full reached extent, when it differs
areas, contours
GeoJSON FeatureCollections for the requested grid; each feature names its cutoff
fullAreas, fullContours
The same for the full extent
stops
Reached stops and when; scenarioStops lists stops a scenario added
surface.edges, surface.nodes
Street evidence with includeStreetEdges and includeNodes
Cell order is row-major from the northwest; Read the surface gives the cell-center formula. Areas are cumulative: the 30-minute area includes the 15-minute area.
With reachFormat: "map", the Result contains only areas and bounds for the full reached extent; its polygons equal fullAreas of the default format. With reachFormat: "surface", polygons and contours are not built. Use the full format for comparisons.
Compare saved results
vigo.compare.v1 reports changes between two saved Results without routing again. Changes are after minus before, in seconds.
Family
Fields
Route
durationChangeSeconds and transferChange; null when either Result has no journey
Matrix, Reach
counts (comparable, faster, slower, unchanged, newlyReachable, noLongerReachable) and meanChangeSeconds
beforeStatus, afterStatus and cityRevisions identify the inputs. meanChangeSeconds averages only entries reachable in both, and is null when there are none; new and lost reachability are counted separately. Matrix comparison requires identical ordered endpoints, and Reach comparison the same grid. Compare does not check that dates, times, modes or walking limits match: align them yourself. The engine compares Reach only; the compiler also compares Route and Matrix.
Distributions
vigo.distribution.v1 is returned by a Route, Matrix or Reach request with monteCarlo. durationsSeconds[p] holds the p-th requested percentile for every destination or cell, with null meaning unreachable in that share of samples. reachableSamples counts finite outcomes. sampling and assumptions record the method. See Monte Carlo.
Errors
vigo.error.v1 has status: "error" and error with a code and a message. Handle the code and the HTTP status, never the message text. Codes include invalid_request, stop_not_found, scenario_not_found, unsupported_mode, file_not_found, permission_denied and city_unavailable, and transport codes such as unauthorized, request_timeout, query_timeout, query_canceled, request_id_conflict and service_unavailable. On a stream, an error is one output line and later lines still run.
Diagnostics
Level
Adds
none (default)
Nothing
summary
diagnostics: search counters and candidate counts
profile
Also profile.timingsUs: measured timings in microseconds
trace
Also trace: the full internal result
Set the level with --diagnostics, a diagnostics field, or the ?diagnostics= (also ?vigo_diagnostics=) query parameter; conflicting values are rejected. Counters without instrumentation are omitted, never invented. scannedDepartures, expandedTripRuns and relaxedStops count algorithm work, not network size or distinct stops. Profile scopes can overlap; never add them. summary and profile describe each runtime's own instrumentation and are not comparable across runtimes.
trace is an unstable debugging interface: internal indices, sentinels and duplicate units stay there. The trace reference documents it. stream --stream-output=detailed returns the same trace in a vigo.stream.detail.v1 envelope without building the public Result; its status: "ok" means execution completed, so read the trace's own routing status. Clients must check that capabilities.output.streamFormats lists detailed; VIGO Python does this automatically.
Metadata and reproducibility
meta records how a Result was computed:
Field
Meaning
engineVersion
The executable's version
cityRevision
The City build used
requestId
The caller's id, or a generated identifier
queryFingerprint
Hash of the complete request (stop references canonicalized, output switches excluded), the City revision and the engine version
assumptionsFingerprint
Hash of the routing assumptions, without scenario and observation content
scenarioFingerprint, realtimeSnapshotFingerprint
Hashes of supplied scenario and realtime content
computeUs, computeScope
Microseconds for service-date activation, search and Result construction (query_dispatch_including_materialization); excludes formatting, serialization, queueing and the network
realtime, traffic
Admission and coverage of supplied observations
The query fingerprint includes scenario content, via points, alternative settings and the identity of an admitted live snapshot, and excludes id, diagnostics, includeGeometry, includeLimitations and reachFormat. Equivalent requests written differently, such as time and timeMinutes, can hash differently. Compare Results only when their assumptionsFingerprint values match, or when you have checked the differing assumptions yourself. Server-Timing headers report serialization, compute and, on the engine, queue time; measure client wall time separately.
Keep a reproducible run
Keep together: the City (or its revision and sources), the original request, the executable version and capabilities, any supplied scenario, realtime snapshot or traffic, and the complete Result. The query echo and the fingerprints identify these inputs but do not archive them. For a source-data audit, also keep a diagnostics: "trace" Result.
Python Results use ready and blocked, minutes, and their own properties; see the Python Results guide.
Generated for VIGO 1.0.0 from crates/vigo-model, the types that read every public request and write every public Result. Regenerate with npm run docs:standalone; the documentation check fails when this page is stale.
Use it to look up a field. The engine reference explains how requests behave, and public results explains how to read answers. The same definitions are in the OpenAPI document. The engine also validates what a schema cannot express, such as combinations of fields, and accepts a few fields the typed model does not list yet; the engine reference documents every accepted field.
Request bodies for POST /v1/route, /v1/matrix, /v1/reach (and /v1/isochrone) and /v1/compare, the same objects the command line and the resident stream accept, and the types they use.
1–10000. Rounded up to equal samples per minute; exact-only service uses one.
endMinutes
integer
Yes
1–1440
percentiles
array of integer
1–21 items. Nearest-rank percentiles, including unreachable samples as infinity.
seed
integer
0
≥ 0
startMinutes
integer
Yes
0–1439
RealtimeSnapshot
Trip Updates and Service Alerts applied to one transit Route, Matrix or Reach request. Freshness is checked against the current time. With realtime mode and no snapshot, vigo serve --realtime-poll uses its own.
0–10000 items. NO_SERVICE removes the selected service or closes the selected stops during the active periods. Every fresh alert is reported on the legs it describes.
1–32 items. Optional independent timetable rows. Replaces the top-level frequency window; weekdays refer to serviceDate, including times after midnight.
SCHEDULED, SKIPPED or NO_DATA, or their codes 0 to 2.
stopId
string
stopSequence
integer
0–4294967295
TripDescriptor
Field
Type
Required
Default
Notes
startDate
string
tripId
string
ServiceOperation
Type: "add", "augment", "replace".
FrequencyPhasing
Field
Type
Required
Default
Notes
atStopIndex
integer
Yes
≥ 0
fromStopIndex
integer
Yes
≥ 0
offsetMinutes
number
serviceId
string
Yes
ScheduleMode
Type: "frequency", "preserve-trips".
ScheduledTrip
Field
Type
Required
Default
Notes
arrivalOffsetsSeconds
array of number
Yes
canAlight
array of integer
canBoard
array of integer
One 0/1 flag per stop.
departureOffsetsSeconds
array of number
Yes
departureSeconds
number
Yes
0–1048575
serviceDayOffset
integer
-3–3. Days from the query's service date to the service date this trip runs on; -1 keeps the previous day's trips that run past midnight. departureSeconds is on that day's clock. Omitted means 0.
Where the line came from: osm, osm_and_station_path, gtfs_pathway, station_selection, unverified_transfer or unknown. Treat other values as unverified.
Documents the engine writes for a query, keyed by their schema field, and the types they use. A required field is always present, although its value can be null.
Response
Any document the engine writes for a query, keyed by its schema.
diagnostics: "trace" adds the engine's internal result under trace, and stream --stream-output=detailed returns it in a vigo.stream.detail.v1 envelope. This page documents that internal object for debugging and research tools. It is not part of the stable public schema: fields, units and sentinels can change between releases. Applications should read the public results.
Read the outcome first, then the journey or analysis values. Keep units, array order and provenance with the values.
Timing and metadata
Field
Meaning
schemaVersion
vigo.standalone.result.v1; Compare uses vigo.standalone.comparison.v1. Identifies the JSON interface, not the executable
runtime
rust
cityRevision
Revision of the loaded City; IDs and indices depend on it
timing.totalMs
Milliseconds inside dispatch, including on-demand preparation and result construction. Excludes City loading, process startup, serialization, HTTP queueing and client parsing
timing.timetableSource
prepared_snapshot when a compiled service timetable was reused, source when it was prepared from SQLite
id
Echoed by the stream and HTTP when supplied
warnings
Source limitations affecting the answer; may be absent, null or an array
The object is the result itself, without a data wrapper. Native results put their object under result, next to operation. Member order has no meaning; accept unknown fields.
Trace outcome
Meaning
Handling
Route status: "ready"
A journey was computed
Read legs or segments; display the returned mode
Route status: "blocked"
No admissible journey
Read reason; journey fields may be absent
Matrix cell null
No finite duration
Keep it null; exclude it from averages
Reach cell null
No value reached
Never convert to zero
The public Route uses ok and not_found for these outcomes.
Journey start in minutes after service-day midnight. Depart-at starts at the requested clock; arrive-by at the latest departure
arrivalMinutes
Journey end on the same clock; arrive-by can finish before the deadline
durationMinutes
arrivalMinutes − departureMinutes
boardings
Transit boardings
transfers
max(boardings − 1, 0); zero for a direct walk or drive
walkMinutes
Time on non-ride legs, including modeled access and transfer allowances
rideMinutes
Sum of ride legs
waitMinutes
The rest: gaps before the first boarding and between rides
departure, arrival
Native service-day clocks in seconds
walkingSeconds, rideSeconds, waitingSeconds
Native counterparts of the totals
Here 475 is 07:55, 510 is 08:30, and 35 = 0 + 25 + 10. Values can be fractional. Clocks can exceed 1440 minutes: 1500 is 25:00 on the selected service day. Keep the date offset; never take the clock modulo 24 hours.
Read the leg sequence
legs runs from origin to destination. Waiting is a gap between legs, not a leg. The fixture route has two zero-length station-selection walks around two rides:
Step
Clock
Meaning
Access
07:55 → 07:55
Selected stop A; no physical walk requested
Gap
07:55 → 08:00
Five minutes before the first boarding
Ride T1
08:00 → 08:10
A → X
Gap
08:10 → 08:15
Five minutes before the next ride
Ride T2
08:15 → 08:30
X → B
Egress
08:30 → 08:30
Selected destination B
The first ride, legs[1], with other properties omitted:
ride or walk in transit; walk for a direct walk; drive between optional walk legs for a drive
from, to
Endpoint objects with coordinate, plus stopId and name at a stop. Direct street legs omit them
fromStopId, toStopId
Stop IDs at stop endpoints
fromStop, toStop, trip
Indices into the active native timetable, not GTFS IDs
tripId, routeId, route
Ride identity and route display data (shortName, longName, type, color)
boardSequence, alightSequence
Native connection sequence values; not offsets into stopIds or GTFS stop_sequence
stopIds
The ride's stops, including boarding and alighting
stopCount
stopIds.length − 1
coordinates
[longitude, latitude] pairs; plain arrays, not GeoJSON
distanceMeters
Length of the returned line, not necessarily the operator's distance
Walk legs keep their access cost. When it includes a station connection, accessCost.street and accessCost.station separate distances and seconds, and the station part lists directed stop IDs and sources. A published transfer minimum is timing, not a path. stationAccessStatus: "unverified" and streetPathVerified: false keep that uncertainty; streetSegmentVerified describes only the street part; a source-backed pathway reports stationAccessStatus: "source_path". unverifiedStationAccessLegs counts unresolved station connections.
Geometry and evidence
geometrySource
What the line is
gtfs_shape
The GTFS shape, aligned and cut between the stops
stop_sequence
A line through stop coordinates; need not follow the street or track
osm
A walking path in the prepared street graph
osm_and_station_path
A street path joined to a station path
gtfs_pathway
A GTFS pathway transfer between located stops
stop_coordinate_fallback
A transfer priced by a GTFS transfer rule, drawn between the stops
station_selection
A selected-stop connector; no street path was checked
unverified_transfer
A transfer without a materialized path, such as between platforms of one station
coordinate-snap
The straight walk between a free point and its road (drives)
streetPathVerified: true marks a walking leg verified on the graph; the fallback labels set it to false. Missing does not mean false; ride legs do not use it. Graph verification does not establish wheelchair access, station-interior access or fare eligibility. Matrix journeys include geometry only with includeGeometry.
Direct, via, window and blocked variants
Direct Walk Results have one street leg; Drive Results have a drive leg with walk legs where a point lies off its road. Both report distanceMeters, clocks and transfers: 0, and omit transit totals. A transit request with requireTransitRide: false can return mode: "walk": display the returned mode.
Via routes have ordered segments and a total duration, without a flattened legs array or aggregate totals. Window routes have the selected journey at the top level and up to five choices in choices; window.searches counts sampled times, not choices.
Reversing the fixture route to B → A gives exactly:
durationsMinutes[1][0] is X → B: 20 minutes waiting and 15 riding from 07:55. A → A is null because the request requires a ride and no service returns. Never fill the diagonal with zero, and test duration !== null, not truthiness.
Clocks are in seconds. For A → B with an 08:40 deadline, the cell is 40 minutes: from the 08:00 latest departure to the deadline. The journey itself arrives at 08:30 and takes 30 minutes. Both are intended; the ten minutes are slack before the deadline, not part of the journey.
Journey detail
Request
Returned
Transit, includeJourneys: false
journeys: null; durations only
Transit, includeJourneys: true
journeys[row][column]; null where unreachable
includeGeometry: false
Clocks, legs, IDs and stops without lines
includeGeometry: true
Lines and provenance on transit legs
journeyFormat: "compact"
Timed trip and stop witnesses without display metadata
A direct walk wins
A mode: "walk" journey with one timed leg
Walk, Drive or Bike matrix
distancesMeters and durations; no journeys
Journey cells have the Route journey fields but no status, mode or dispatch metadata. diagnostics.times is the native flat array of clocks in seconds, at offset row * destinationCount + column; it is not the duration matrix, especially where a direct walk replaced transit. Use the timetable.matrix native operation for raw native journeys.
A trace Reach returns reached stops, rasters, GeoJSON and optional street evidence.
Main fields
Field
Meaning
kind, mode, origin, serviceDate
reach, the mode, the origin and the date (null for walking without one). Arrive-by has destination and timePreference: "arrive_by"
cutoffsMinutes
Sorted, deduplicated cutoffs
stops
Stops reached within the largest cutoff, with stopId, name, coordinate and durationMinutes; empty for walk-only Reach
surface
Grid dimensions, requested and full rasters, and optional evidence
areas, fullAreas
MultiPolygon features for the requested and full rasters
contours, fullContours
MultiLineString features
diagnostics
Transit search and street surface evidence
Stop durations are minutes after the query clock (before the deadline for arrive-by). Stops follow timetable order, not duration; sort them yourself.
Decode the raster
surface.width * surface.height equals surface.values.length; index zero is the northwest cell, x grows east and y grows south. With street sampling a value is the least time on the reached streets in the cell; with cell-center sampling it is the Matrix time to the center. This function reads a cell without confusing zero with null:
JavaScript
function readCell(surface, x, y) {
const { width, height, bounds, values } = surface;
if (!Number.isInteger(x) || !Number.isInteger(y) ||
x < 0 || x >= width || y < 0 || y >= height) {
thrownew RangeError('Cell is outside the raster');
}
const [west, south, east, north] = bounds;
return {
index: y * width + x,
coordinate: [
west + (x + 0.5) / width * (east - west),
north - (y + 0.5) / height * (north - south)
],
durationMinutes: values[y * width + x]
};
}
A cell belongs to a cutoff when its value is not null and at most that cutoff. For the full raster, pass {...surface, bounds: surface.fullBounds, values: surface.fullValues}; when no separate surface exists, the full pair repeats the requested one. Changing bounds at fixed dimensions changes cell size, so equal indices need not mean the same place.
Areas and contours
Geometry
Coordinates
MultiPolygon
coordinates[polygon][ring][vertex]; ring zero is the exterior, later rings are holes
MultiLineString
coordinates[line][vertex]
Cutoff areas are cumulative: the 30-minute area includes the 15-minute area, so never add them. A cutoff with no geometry has no feature; match features by cutoffMinutes. Areas trace occupied cells; contours interpolate crossings. Both depend on resolution. Measure area with a projected or geodesic method, not in degrees.
Decode directed street evidence
With includeStreetEdges: true, surface.edges has schemaVersion: "vigo.standalone.street-edges.v2" and encoding: "indexed-json"; otherwise it is null.
Field
Meaning
count
Number of directed intervals
nodeCount, nodes
Local coordinate table: nodes.length = 2 * nodeCount, longitude then latitude
endpoints
Two local node indices per interval, from then to
edgeIds
Prepared directed edge IDs; not portable between Cities
durationMinutes, fromDurationMinutes
Minutes at the interval's end and start
startFractions, endFractions
Interval limits along the edge, 0–1
walkDistanceM
Walking distance from the seed through this interval, including snapping
transitArrivalMinutes
Arrival at the transit seed; -1 marks the direct-origin seed
Repeated edge IDs are ordered, non-overlapping intervals; opposite directions are separate. For a smaller cutoff, clip an interval at the cutoff instead of dropping it. In arrive-by Reach, times are minutes before the deadline and still grow from from to to, while the traveler walks the other way; -1 marks the destination seed. This decoder reads both directions:
JavaScript
function readEdge(bundle, i, cutoffMinutes = Infinity) {
if (!Number.isInteger(i) || i < 0 || i >= bundle.count) {
thrownew RangeError('Edge is outside the bundle');
}
const point = node => bundle.nodes.slice(2 * node, 2 * node + 2);
constfrom = point(bundle.endpoints[2 * i]);
const to = point(bundle.endpoints[2 * i + 1]);
const start = bundle.startFractions?.[i] ?? 0;
const end = bundle.endFractions?.[i] ?? 1;
const startTime = bundle.fromDurationMinutes?.[i] ?? bundle.durationMinutes[i];
const endTime = bundle.durationMinutes[i];
if (cutoffMinutes < startTime) returnnull;
const clippedEnd = endTime <= cutoffMinutes ? end
: start + (end - start) * (cutoffMinutes - startTime) / (endTime - startTime);
if (clippedEnd <= start) returnnull;
const coordinate = fraction => from.map((v, axis) => v + fraction * (to[axis] - v));
const seed = bundle.transitArrivalMinutes[i];
return {
edgeId: bundle.edgeIds[i],
coordinates: [coordinate(start), coordinate(clippedEnd)],
durationMinutes: Math.min(endTime, cutoffMinutes),
walkDistanceM: bundle.walkDistanceM[i],
transitArrivalMinutes: seed === -1 ? null : seed
};
}
The decoder turns the -1 sentinel into null for display; the array keeps -1. Check diagnostics.surface.edgeEvidenceTruncated before treating the records as complete. surface.nodes is a separate list of reached nodes (longitude, latitude, durationMinutes, walkDistanceM), empty unless includeNodes: true, capped at 30,000 with diagnostics.surface.nodeEvidenceTruncated.
meanChangeMinutes averages common cells only, and is null when there are none. Never replace null deltas with zero. Cells unreachable in both number width * height − commonCells − newlyReachableCells − noLongerReachableCells.
Grid and provenance
The result carries width, height and bounds; deltaMinutes uses the Reach cell order. Fix bounds explicitly when running a baseline and a scenario so cells line up. The outer cityRevision is the loaded City's; the comparator checks only that the two inputs agree with each other.
diagnostics.originAccess, destinationAccess, search, native and realtime
Walk or Drive Route
The native street or drive result
Transit Matrix
The native timetable matrix result
Walk or Drive Matrix
The native street or drive matrix result
Reach
diagnostics.transit (null for walk-only) and diagnostics.surface
Via Route
Per-segment diagnostics under segments
Transit search diagnostics report startSeconds, endSeconds, the transfer policy and horizonScope: "timetable_scan". When a direct walk wins a transit request, the native diagnostics still describe the transit search; never overwrite the returned value with a diagnostic clock.
queryNs / 1_000_000 converts a native query time to milliseconds; it is a kernel scope, not latency. Do not sum nested timings. scannedDepartures, expandedTripRuns and relaxedStops count algorithm work, not distinct trips or stops. reachedPixels counts finite cells; reachedEdgeCount and reachedEdgeLengthM count directed edges, so a two-way street counts twice.
Native responses contain operation and a typed result. Native fields are always present; unavailable optional values are null. Timetable operations index into the arrays of timetable.identifiers for the same service date and policy; never reuse saved indices across preparations. Native timetable.matrix returns a flat origin-major times array of service-day clock seconds: for the fixture's A → B, [30600], an 08:30 arrival.
The compiler, vigo.mjs, builds Cities and scenario collections from GTFS and OpenStreetMap, and runs Route, Matrix, Reach, Stream and Compare against them. Its build and build-scenarios run the engine's vigo build and vigo build-scenarios with the same arguments, so they write the same Cities; the engine, the compiler and Python open them.
The compiler archive (VIGO-CLI-…) contains vigo.mjs, its native routing kernel vigo-routing-kernel.node, the vigo executable it uses to build Cities and answer queries, license notices and a checksum manifest. It needs Node.js 24.18 or newer on the matching operating system and CPU, and bundles neither Node nor City data.
Install
Extract the archive from VIGO releases, keep its files together, and run:
Shell
node vigo.mjs --version
node vigo.mjs capabilities
node vigo.mjs help route
No npm installation, Rust compiler or Studio is needed. The guides call the compiler vigo-build. In a POSIX shell:
Shell
alias vigo-build='node "/absolute/path/to/vigo.mjs"'
On Windows, use node .\vigo.mjs, or define your own function. From a source checkout, npm run build:cli-runtime builds public/vigo.mjs and its kernel.
vigo-build help COMMAND or vigo-build COMMAND -h prints every option with its default. Options accept --name value and --name=value. Unknown options, extra arguments and repeated single-value options are rejected; --gtfs, --gtfs-scope and --prepare-date may repeat.
walk,drive (default), walk, walk,bike or walk,drive,bike
--prepare-date YYYY-MM-DD
Compile a service date's timetable now; repeat for other dates
--private-access VALUE
public (default) or endpoints
--wheelchair
Build a strict wheelchair City
--wheelchair-streets MODE
inferred (default) or verified street evidence for a wheelchair City
--streets-from PATH
Reuse identical prepared streets from another City
--replace
Replace an existing City
Build a City explains each option, combining feeds, large regions and low-memory builds. The quickstart has a complete Boston example. Progress goes to standard error. vigo.mjs runs the vigo executable beside it, which stages and publishes the City; set VIGO_STANDALONE_PATH to use another one. A signal sent to vigo.mjs reaches the build, and the build stops if vigo.mjs is killed.
Run a query
Requests carry serviceDate and time in JSON; flags override request fields.
Request files and standard input share a 16 MiB limit, and --request - reads until the producer closes standard input. Results go to standard output; progress and errors to standard error. Saved output is written to a temporary file and renamed, so a failed run can leave an older file in place: check the exit code. Exit 0 means a Result, including not_found; exit 2 means invalid input or a failure.
The request format is the engine's, documented in the engine reference, with these differences:
Feature
Compiler
Engine
Matrix size
100,000 pairs in 16 MiB
65,536 pairs in 8 MiB
Departure windows
departureWindowMinutes, centered ±0–30
windowMinutes, later departures or earlier deadlines
Realtime
Route only
Route, Matrix and Reach
Planned scenarios
Reach
Reach and transit Route
Reach raster sizes
48, 64, 96, 128, 192, 256, 384, 512 or 1024
Any integer 16–1024
Compare
Route, Matrix and Reach
Reach
CSV route batches
--input
Not available
Matrix points may also use the older {"id": "a", "point": "A"} form, which the engine rejects. CSV batches take columns id, origin_lon, origin_lat, destination_lon, destination_lat, or origin_stop_id and destination_stop_id, with optional origin_name and destination_name.
Keep the compiler resident
stream reads one request per line, each with a kind (route, matrix or reach) and an optional id, and keeps the City prepared between lines. Each line may choose its own serviceDate; --service-date only sets the default.
Responses echo id, add sequence, and keep input order. A failed line returns status: "error" and later lines still run; read every status, even on exit 0. --workers N (1–4, default 1) runs several resident workers, capped by CPU and memory (two CPUs and 6 GiB each); each loads its own City. --stream-output detailed returns the internal trace envelope.
Both Results must be from the same query family; Reach Results must share a grid. Changes are after minus before. See Compare saved results.
Package and verify
From a source checkout, npm run package:cli builds the archive and npm run check:cli-package tests the extracted copy. Archives are specific to their platform; keep the manifest when reporting a problem.
Native operations call the routing kernels directly with packed arrays. They are diagnostic and research tools outside the public stability policy. Use vigo native --city ./city --request query.json or POST /v1/native with operation, input and, for timetable operations, serviceDate. Native indices belong to the loaded City and service date. The HTTP API never accepts a file path in a query.
timetable.identifiers returns stopIds, tripIds, routeIds (one per active trip) and accessMemberStopIds. An index is a position in these arrays. Offset arrays start at zero, end at their packed array's length and have one more entry than their groups; parallel arrays must have equal lengths.
Native departure, horizon, earliest and deadline are absolute service-day seconds: native horizon is an end clock, while horizonMinutes is a duration. maximumBoardings is a transfer cap plus one. Walking times and transfer arrays are seconds; distances are meters; drive traffic weights are hundredths of a second. queryNs is nanoseconds.
Native Matrix returns flat clock times in seconds: arrivals for depart-at, departures for arrive-by, null where unreachable. timetable.pareto exposes the arrival, boarding and walking frontier. realtime.compile compiles explicit call times; it does not fetch feeds. places.describe labels up to 256 coordinates with nearby street, area or stop names from the City, in parallel labels and kinds arrays; labels never change routing. timetable.prepare, street.prepare, bike.prepare and drive.prepare load a mode without routing.
The native field reference lists every operation's input and result type, generated from the Rust definitions.
Generated for VIGO 1.0.0 from public Rust structs. Regenerate with npm run docs:standalone.
Native operations are diagnostic tools outside the public stability policy. See native operations for units, index domains and examples. In requests, an optional field accepts omission or null. Result objects include every listed field; an unavailable optional value is null. Native arrays become JSON arrays, and non-finite result numbers become null. The runtime also checks compatible array lengths, indices, and values.
Drive-graph candidate node indices for destinations.
Vec<u32>
Yes
targetSnapMeters
Destination snap distances in meters, parallel to candidate nodes.
Vec<f64>
Yes
maximumDistanceMeters
Maximum drive path distance in meters.
f64
Yes
traffic
Optional directed drive-edge metric updates.
Option<DriveTrafficInput>
No
originSnapSeconds
Option<Vec<f64>>
No
targetSnapSeconds
Option<Vec<f64>>
No
durationsOnly
Report only each pair's least time. Distances stay unset, so neither a path is unpacked per pair nor maximum_distance_meters applied to it; a Reach grid reads only times.
Flat origin-major matrix of service-day clocks in seconds: arrivals for depart-at, departures for arrive-by. Null marks an unreachable pair. These are not travel durations.
Vec<f64>
Always
journeys
Journey records in the same order as times. Null when journeys were not requested; individual null entries mark pairs without a journey.
Option<Vec<Option<TimetableMatrixJourney>>>
Always
forwardSearches
u32
Always
reverseSearches
u32
Always
queryNs
Native query time in nanoseconds; excludes outer transport work.
A City written by one VIGO release stays readable by later releases, and every standard City stays readable by the published reference runtime. This page is that promise: the compatibility policy, the release gate that enforces it, and the optional extensions a City may carry. Maintainers must follow it for any change to a reader, a writer or prepared data.
Compatibility policy
The published reference runtime at source c8da84fff7812d570fd5985cbcbcb83885587bf6 is the permanent prepared-data baseline. Future VIGO readers must continue to open these Cities without requiring users to rebuild them. Future standard City writers must continue producing data readable by that published runtime.
Keep the existing City manifest, routing/street SQLite layouts, prepared access and timetable snapshots, CCH members, and portable relative references compatible. Do not reuse a format identifier for an incompatible layout. Algorithm and performance improvements must retain the published representation. Additional optional metadata/indexes are allowed only when existing readers can ignore them and old Cities still work without them. A new required format or an automatic rebuild of valid baseline Cities violates this policy.
This applies to regular, wheelchair and scenario-collection data. It does not promise immutable GTFS/OSM contents or identical answers after a routing bug fix. Invalid/corrupt source data must still be rejected. Internal diagnostic traces are not a persistent data format. Public vigo.*.v1 results retain existing field meanings, units and time conventions; additions must remain optional.
Release gate
npm run check:format-050 builds candidate runtimes and tests both directions:
The candidate reader opens the frozen City produced by the published CLI.
The published Rust reader opens a City produced by the candidate writer.
Both execute transit, arrive-by, walking, matrix and reach queries. The test is also part of check:standalone, used by the engine and release CI matrices. The original archive-only CI build (run 37885649818) is preserved in the v0.5.0 release under *-baseline-c8da84fff781.tar.gz asset names. Downloads require no GitHub token and do not expire with Actions artifact retention. Every platform retains its original pinned SHA-256; the later, differently packaged reference downloads are not interchangeable with these baseline assets. For offline checks, VIGO_050_REFERENCE_BINARY may point to an extracted package whose manifest, source identity and executable hash are verified.
The small synthetic GTFS/OSM and prepared archive live in test/fixtures/format-0.5.0. Never regenerate that archive, change its pinned hashes, or weaken its expectations to hide an incompatibility. It is a permanent historical reader test, not generated build output. Extend coverage with new fixtures while retaining this baseline. The initial fixture covers regular walking/transit; additional wheelchair, collection and large-network fixtures are still needed before claiming comprehensive format coverage.
The policy is permanent; the tests are evidence for the cases they execute, not a proof that all future code or every possible City is compatible.
Optional extensions
Each extension below is optional: readers that predate it ignore it, and Cities without it keep working without a rebuild. A present but malformed extension fails admission; an absent one keeps the conservative baseline behavior.
VIGO writers can add bikeProfileVersion=1 metadata and four base tables to street-index.sqlite. They do not change the walking/driving snapshots, required layouts, City version, or existing units. Historical readers ignore them; new readers require them only for Bike Route and Matrix. A missing profile produces a bike-preparation error without rebuilding an old City.
Table
Columns
bike_nodes
OSM node_id, integer lon_e7, integer lat_e7
bike_edges
from_node, to_node, positive distance_cm, OSM way_id, packed attributes
Each edge is directed. Length is rounded upward to centimetres. Attribute bits encode road class (0–2), facility (3–4), surface (5–6), dismount (7), incline percent plus 30 (8–13), motor speed in km/h (14–21), and destination access (22); upper bits are reserved. This compact profile stores no tag strings.
The low turn flag bit marks an only_* restriction. For node turns, bits 1 and 2 distinguish same-way U-turn and straight movements; bit 3 makes a conditional-only rule independent of other allowed alternatives. For via-way turns, bit 1 marks that independent conditional rule. Without a timing index, conditional prohibitions apply all day. Optional metadata counts unsupported relation shapes and conditional restrictions. The reference-reader gate also opens a new City containing these bicycle tables.
Bicycle turn windows
An optional bike_turn_windows table is identified by bikeTurnWindowVersion=1. Its columns are turn_table (0 for bike_turns, 1 for bike_way_turns), turn_row (the referenced table's SQLite rowid), start_minute, and end_minute. Row identities must be preserved with this index. Each interval is half-open in a Monday-first local week: 0 <= start_minute < end_minute <= 10080. Intervals for one restriction must not overlap and are limited to 256. A restriction without interval rows applies at all times. Malformed present indexes produce a bicycle-preparation error; absent indexes preserve the conservative baseline behavior.
Writers compile weekly weekday/time ranges and conditional overrides into these intervals. Unrecognized expressions remain conservative. Readers that ignore the index still enforce every retained restriction. The current runtime evaluates node-turn and via-way windows for dated depart-at requests with a known City timezone. Both share one interned schedule pool. No-turn via-way restrictions are checked at the final movement; only-turn restrictions constrain each movement while the mapped sequence is being followed.
Bicycle timed edges
Optional bike_timed_edges and bike_edge_windows tables are identified by bikeEdgeWindowVersion=1. Timed edges have the same five columns and units as bike_edges, plus a positive window_id. Their allowed entry intervals are in bike_edge_windows(window_id,start_minute,end_minute), with the same Monday-first, half-open minute convention and 256-interval limit. Every referenced schedule must exist, and every stored schedule must be referenced. Both tables must be present together. Equal schedules may be shared across edges and directions.
These supplemental edges never replace the conservative meaning of legacy bike_edges. Earlier bicycle readers ignore them. The current runtime admits them only with a usable depart-at date/timezone, evaluates permissions at entry to each directed segment, and permits completion of a segment entered while open. Attribute variants, such as cycling versus dismounting, use separate timed edges. bike_nodes contains their endpoints; old readers may see isolated nodes. The runtime shares one graph across all bicycle preferences and keeps the window lookup sparse. Internal timed-edge and incoming-turn flags reuse reserved bits in memory only; they are never persisted in attributes.
Bicycle traffic stress
bikeStressVersion=1 adds an optional stress INTEGER NOT NULL column to bike_edges and, when present, bike_timed_edges. Bits 0–2 contain an estimated LTS integer 1–4; bit 3 permits walking while pushing the bicycle. All other bits must be zero. Walking permission includes both incident nodes and the direction of the way. The attributes word, table identities and existing units do not change. Older readers may ignore this column. New readers require both the version and valid values before accepting a traffic-stress limit; old Cities without it retain ordinary bicycle routing. The writer removes temporary intersection data before sealing the City. Custom LTS and signal-aware intersection adjustment are compiled into the column, not inferred at runtime.
Bicycle walking access
bikeWalkAccess is a JSON metadata value with version: 1, the adjacent snapshotSuffix (.street-accelerator-v7.bin), and the pedestrian snapshot's identity, nodeCount and edgeCount. It identifies the optional table bike_walk_nodes(bike_node INTEGER PRIMARY KEY, walk_node INTEGER NOT NULL). bike_node is the original OSM node ID in bike_nodes; walk_node is the zero-based vertex index in that exact spatially ordered pedestrian snapshot. The join is built from source IDs, not coordinate equality, before source-table compaction. Walking indexes must be unique, in range, and coordinate-consistent with their bicycle node. A present malformed or mismatched index fails admission.
These links enable bounded access/egress walks on the prepared public pedestrian graph. The runtime shares its existing immutable snapshot; it retains only the node join and query-local walking scratch. Network walks count toward the walking and total-distance limits and supply mapped geometry. Ordinary coordinate snaps remain unverified and use the existing 80 m pedestrian snap ceiling. A nearer pedestrian attachment cannot be skipped to snap to an unrelated bicycle road. Older readers ignore this index; absent metadata preserves legacy bicycle coordinate attachment. Rebuilding from OSM creates the index for older Cities.
Add street names to an existing City
Older Cities may lack the optional place_streets and place_areas tables. Coordinate labels then fall back to nearby transit stops or “Dropped pin”. Use the original OSM PBF to add names without rebuilding the City:
Shell
npm run backfill:project:places -- --city=/path/to/City --osm=/path/to/original.osm.pbf
The command verifies the source against the street store's SHA-256 fingerprint, stages named ways and their nodes in temporary SQLite storage, and commits the two name tables and an optional placeNames metadata receipt together. It does not change the timetable, routing graphs, accelerators, basemap or City manifest. A completed upgrade is a read-only no-op on retry. A missing source, mismatch, cancellation or publication error leaves the previous name tables intact.
Names describe nearby streets, intersections and supported named areas from OSM; they are not verified postal addresses. No external geocoding is required. Current Rust lookups reload when the SQLite database or its WAL changes. Re-enter a coordinate search to refresh already displayed labels. Studio also needs a build containing coordinate-search naming: quit an older running Studio before opening the updated application, because its single-instance lock otherwise keeps the older process active.
Scenario street bases and endpoint overlays
Scenario collections built from the same OSM bytes and preparation profile keep one immutable base under streets/<osm-sha256>/. Public-only Cities retain the existing relative osm directory link. Endpoint-enabled Cities have their own osm/ directory: relative symbolic links point to the common street database and pedestrian snapshot, and hard links expose the same immutable CCH members inside each City for published readers that enforce adjacent-file resolution. Meanwhile, street-index.sqlite.terminal-access-v1.json remains a regular City-local file. Its boundary components depend on that City's timetable stop anchors and must never be copied from another scenario. The existing filenames and formats remain readable by published runtimes. Moving the entire collection preserves its links; copying one City alone still requires including or materializing its referenced base files.
Archives must preserve hard links to retain the storage savings (for example, use tar); a copying/export tool may materialize duplicate CCH files without changing routing results.
The resident runtime identifies the base by the resolved snapshot directory, shares only the immutable graph and hierarchy, and installs the receiving City's endpoint overlay. Overlay heap usage is charged per City, separately from the shared base. check-scenario-endpoint-access.mjs compares distinct-boundary scenarios with separately built Cities, including resident switching, eviction, relocation and optional published-reader checks.
vigo capabilities describes the executable you run.
Supported operations
Operation
Modes and coverage
Route and Matrix
Transit, walk, drive and bike; depart-at and arrive-by
Reach
Transit, walk, drive and bike; depart-at and arrive-by
Scenarios
Reach with exclusions, planned services or compiled overlays; transit Route with exclusions and planned services
Realtime transit
Route, Matrix and Reach; supplied or polled, with Service Alerts
Supplied traffic
Drive Route and Matrix
Compare
Reach surfaces
Monte Carlo
Scheduled depart-at transit Route, Matrix and Reach
The engine does not combine planned branch edits into schedules or optimize fares. Prepare those inputs with the compiler or Studio.
Platform and build records
Release archives are built and tested for Linux x64 and ARM64 (glibc 2.39 or newer, built on Ubuntu 24.04), macOS ARM64 and Windows x64. For an older Linux, build from source on that system. manifest.json records the target, source commit, uncommitted-change flag, source digest and file hashes; a dirty: true package is a development build. Keep the manifest with a deployment. The verification record lists the checks a release passes.
Run the checks
From a source checkout:
Shell
cargo test --manifest-path crates/vigo-runtime/Cargo.toml \
--no-default-features--features standalone
cargo clippy --manifest-path crates/vigo-runtime/Cargo.toml \
--no-default-features--features standalone --all-targets -- -D warnings
VIGO_STANDALONE_PATH=/absolute/path/to/vigo npm run check:standalone
python3 test/check-standalone-package.py /absolute/path/to/package.tar.gz
npm run docs:standalone
npm run check:standalone-docs
The documentation check builds the fixture City, runs every request on this page against the engine, compares the response excerpts, checks that every command-line flag, request field and environment variable is documented, and serves the guide over HTTP. Passing checks establish the tested model, not field accuracy, station accessibility or deployment capacity.
VIGO answers each question with an exact search over a declared model: the prepared timetable, the directed street graphs and the request's rules. "Exact" means the returned time is optimal for that model, not that the model matches the real world. This page explains the model and the searches, and marks where VIGO bounds, samples or estimates instead.
Every runtime uses the same Rust kernels. The engine, the compiler, Studio and Python differ in how they are called, not in how they route.
Transit
The timetable
A City's timetable is a list of connections: one vehicle moving from one stop to the next, with a departure and an arrival time, its trip, and whether boarding and alighting are allowed. For a service date, VIGO activates the trips whose calendars and exceptions run that day, plus trips from adjacent days that overlap the search. Times are seconds on the service day, so a trip at 25:10 stays on the day it was published.
GTFS frequencies become ordinary connections. exact_times=1 windows are expanded when the City is built; exact_times=0 templates are read as a departure at the start of each window and then every headway, before the window's exclusive end. Because GTFS gives no exact times for the second kind, those departures are scheduled estimates and the City records the limitation frequency_based_service.
Explicit in-seat links (transfer_type=4) and consecutive same-terminal trips on one block become through-runs: the rider stays aboard and the change counts as one boarding.
The search
Transit uses one connection scan for every City and every request size. Connections are scanned in departure order, and each stop keeps its earliest arrival; a connection can be used when the rider is at its stop in time, or already aboard its trip. Arrive-by runs the same scan backward from the deadline.
Question
Objective, in order
Depart-at
Earliest arrival, then fewer boardings, then less walking
Arrive-by
Latest departure; among those, fewer boardings, less walking, then earlier arrival
A transfer cap (maxTransfers) constrains the search itself, by tracking the best arrival for each number of boardings, so a slower route is found when the fastest needs too many changes. A Matrix shares one forward scan per distinct origin, or one reverse scan per distinct destination; every requested cell is still answered.
Transfers
Transfer permissions are prepared into the timetable before the scan. No query keeps per-trip transfer state.
Physical transfers. Preparation finds the walking connections between stops: directed OSM paths up to 500 m, declared GTFS pathways, and station membership. A rule cannot restore a connection removed by allowStreetTransfers: false or the wheelchair profile.
Stop-level GTFS rules.transfers.txt rows without route or trip selectors apply at their stops, expanded through parent stations; a platform's own rule overrides the one it inherits. transfer_type=3 forbids the transfer; transfer_type=2 sets the minimum time; recommended and timed rules set no minimum, and the guarantee of a timed transfer is not represented.
Minimum walking time. Each transfer takes at least the published minimum and at least its distance at walking speed.
Station fallback. Platforms of one parent station with no rule or declared pathway use at least 120 seconds, or their distance at walking speed, reported as parent_station_fallback.
The request.minimumTransferBufferMinutes is added after walking and the published minimum. It never delays the first boarding, the final walk or staying aboard.
Route- and trip-scoped transfer selectors are kept in the City's transfer_rules table but are not applied: the stop-level rule governs. Flex interchanges still resolve the most specific rule for their conditional legs.
Walking to and from transit
Each origin and destination searches the directed pedestrian graph for stops within maxWalkKm. The walking time includes the City's access padding and any station pathway. A direct walk is computed separately and wins when it arrives sooner, unless requireTransitRide is set.
Realtime
A realtime request compiles its Trip Updates into a separate timetable: matched trips get their predicted times, canceled trips lose their connections, and unreported trips keep their schedule. The same scan then runs on that timetable. Realtime is a different input, not a different algorithm.
Several journeys
Alternatives, journey windows and shared legs build on the exact search but are bounded:
Feature
What is exact
What is bounded
Alternatives
Each returned journey is feasible and correctly timed
The candidate set is limited by count, arrival slack and a label budget
Journey windows
Each sampled minute is answered exactly
Only whole-minute samples; not a continuous profile
Via points
Each segment is exact for its start time
Up to eight partial journeys per point; not every itinerary
Shared legs
Each option is a complete, feasible journey
One leg changed at a time, within 30 minutes and fixed counts
Flex
The returned journey is feasible
Can be up to 60 seconds later than the best conditional journey
Walking
The pedestrian graph is built from OSM ways with pedestrian permission, in both directions unless a way says otherwise. Explicit foot=no, private access, foot=use_sidepath, impassable barriers and unresolved conditions are excluded; a motor-vehicle one-way restriction alone does not restrict walking. Walking evidence describes the rules and station costs in detail.
Paths use a customizable contraction hierarchy (CCH): a prepared index that answers shortest-path queries exactly and quickly. The hierarchy is built once per City and never removes streets or changes their lengths.
A free coordinate attaches to its nearest vertex or two-way edge; the short straight connector is part of the cost and is reported as unverified. VIGO never draws a straight line where a street path is missing.
Driving
Drive uses a directed road graph from OSM with free-flow speeds by road class and maximum speed. Its hierarchy is built with the City and persisted. A supplied traffic snapshot customizes the hierarchy's weights for one request: a fixed set of costs, never faster than free flow, and not a forecast that changes during the trip. Turn penalties, signals and intersection delays are not modeled.
A free coordinate attaches to the nearest drivable road and enters it mid-segment in its own direction; the gap is a walk.
Bicycle
Bike uses a directed graph with bicycle access, contraflow, surfaces, mapped incline, dismount sections and turn restrictions, including restrictions through intermediate ways. Its hierarchy keeps the incoming road in every state, so turn restrictions are exact.
Preference and time are separate. The profile (balanced, quiet or fast) and traffic-stress limit choose the route by a preference cost. The reported duration is the physical travel time at the chosen speed, adjusted for surface and incline.
Time-dependent rules. With a date and a known timezone, access, one-way directions, dismount periods and turn restrictions are evaluated when the bicycle enters each segment, and the search can wait for a road or turn to open. A segment entered while open can be finished. An arrive-by route is anchored at the deadline and replayed forward to check every movement; it is proved optimal when no move must wait, and otherwise searched backward through the hierarchy.
Many-to-many. Matrix and Reach share rank sweeps across endpoints, and check each witness's distance and time before reporting it.
Stress. Traffic stress (LTS 1–4) is estimated from road class, speed and lanes, after Conveyal's published labeler; OSM lts tags take precedence.
The bicycle hierarchy can keep part of its structure in the user cache, bound to the City's source; opening rebuilds the rest exactly. The cache holds graph data only.
Reach
Transit Reach runs the connection scan once from the origin (or backward from the destination), then spreads walking from every reached stop and from the origin itself over the directed streets, within the walking budget and the largest cutoff. The result is the earliest time at every reached part of every street.
The raster is drawn from that result:
Street sampling (default) gives each cell the least time on the reached streets inside it. Cells with no reached street stay empty, and a filled cell does not prove a route to its center.
Cell-center sampling routes to the center of every cell with the Matrix rules.
Areas are polygons around reachable cells, with holes and islands kept; contours interpolate the raster at each cutoff. Both depend on the grid's resolution. Drive and Bike Reach route to every cell center.
Arrive-by Reach reverses the whole process: the timetable is scanned backward, and walking runs backward over directed streets so one-way paths keep their direction.
Monte Carlo
A Monte Carlo request repeats a query at every minute of a departure window. Planned frequency services without exact times receive a random phase per sample, shared by every stop and endpoint in that sample. VIGO reports nearest-rank percentiles that include unreachable samples as infinitely long. It assumes on-time operation and riders who know the timetable. See Monte Carlo routing and accessibility.
Exactness and its boundaries
Claim
Holds when
A transit time is optimal
For the prepared timetable, transfer rules, walking policy and request limits
A street path is shortest
For the prepared graph, its permissions and the attachment of each endpoint
A blocked answer means no journey
Under the request's date, horizon, walking limit and transfer cap, within the City's coverage
A Matrix cell equals the Route
For the same endpoints and settings; ties can choose a different equally good journey
Two runtimes agree
For the same City, request and version
VIGO does not establish:
that the timetable or map matches reality, or that a station path, entrance or crossing exists beyond what the data declares;
delays, crowding, missed connections or reliability, beyond supplied realtime predictions;
turn penalties or intersection delays for driving;
opportunities, demand or welfare: Reach is travel time, not accessibility.
How the algorithms are verified
Public tests compare VIGO with independent reference implementations that never supply production answers: Floyd–Warshall shortest paths for walking and driving, whole-trip enumeration from raw GTFS for transit, and every stop-to-stop pair at each boarding boundary. A permanent fixture checks that new Cities stay readable by the published reference runtime. See Checking routing accuracy to run them and to validate your own City.
This page explains how VIGO prices walks between streets, stops and platforms, which OSM permissions it follows, and what a returned walk does and does not establish. Every runtime uses the same prepared City data and rules.
Time and connectivity are separate
A GTFS transfer minimum constrains the time between services. It does not describe a physical path or permit arbitrarily fast walking. Before searching, VIGO prices each expanded stop pair at the larger of the published minimum and its distance divided by the configured walking speed, rounded up to a whole second. The distance is at least the straight-line separation of valid stop coordinates. That separation supplies a lower bound; a missing interior path remains unknown.
GTFS pathways describe directed station connections. An explicit traversal_time remains a source cost, including for lifts and moving walkways. If it is absent, VIGO derives a time from the available length and walking policy. A declared pathway supports the feed's connectivity model; it is not a current field measurement. When a station declares pathways and public entrances, coordinate access uses those entrances; snapping straight to a platform cannot bypass the station connections.
The walking floor enters preparation before boarding selection, so a depart-at query may choose a later connection and an arrive-by query may require an earlier departure. Route and both scalar and journey Matrix modes use those same costs.
Pedestrian permissions
The OSM importer reads tags on ways and their nodes, including packed dense nodes. It excludes foot=no, foot=private, and foot=use_sidepath, honors explicit pedestrian permission over generic access, and preserves directed pedestrian rules. A motor-vehicle one-way restriction alone does not prohibit walking in the reverse direction.
An explicit pedestrian permission also overrides general conditional restrictions, and a conditional rule that only permits walking where the base rule already permits it does not disconnect the way. Restrictive or unknown pedestrian conditions, opening hours and conditional directions stay excluded, because VIGO does not evaluate them at journey time.
For nodes, impassable barriers and denied access exclude incident pedestrian segments. Ambiguous gates require explicit permission. Foot/access conditional rules and opening hours other than 24/7 are excluded because this static model does not evaluate their conditions. This conservative policy can reduce coverage, including approaches to a blocked barrier. Driving retains its separate permissions. See the OSM definitions of foot access and pedestrian direction.
What a returned route establishes
Closed elevator ways describe cabin footprints, so they are not imported as horizontal walking loops. Open inclined-elevator ways retain their existing walking treatment. Station vertical travel still requires declared pathways; removing a cabin outline does not invent a street-to-platform connection.
streetPathVerified concerns the prepared street graph; it is not independent proof of an entire door-to-platform walk. Free-coordinate snapping is returned separately as endpointConnector, with streetPathVerified: false. The walk's line still starts or ends at the requested coordinate, so a journey is drawn without gaps; its first or last segment is that connector. An assumed station interior has stationAccessStatus: "unverified"; a published transfer minimum does not change that status. Selected station costs and stop chains are exposed in accessCost when available.
An independent physical audit needs a continuous, directed source path, legal node/way access, and evidence for the links between the requested location, street, stop, entrance, and platform. A line near an OSM street is insufficient. Source gaps require better mapped entrances, agency pathways, or validated access links. Even complete source evidence does not establish current closures or observed travel times.
An interior GTFS node may omit coordinates. VIGO retains its declared pathway connections and stop ID but omits that node from displayed geometry, setting stationGeometryStatus: "incomplete". A line between the remaining known coordinates is schematic. If a source-timed pathway also lacks length and located endpoints, its distance contributes only a zero lower bound and the leg reports stationDistanceStatus: "lower_bound"; it is not measured zero-distance walking. When traversal_time is absent, stairs with a nonzero stair_count use one second per step and fare/exit gates use five seconds. These fixed routing assumptions are recorded as gtfs_pathway_estimated, retain stationAccessStatus: "unverified", and are floored by available distance at the configured walking pace. They are not measured or agency-published traversal times. Explicit traversal times take precedence. Other pathways without time, length, or distinct located endpoints remain excluded and reported as unpriced_pathways. The declared station topology remains in force, so exclusion cannot create a fallback shortcut. A feed-supplied connection alone does not certify its physical duration.
Rebuild to apply these rules
These rules are prepared into a City when it is built. To apply them to older data, build a new City from the original GTFS and OSM into a new directory, and keep the old City with its original runtime for reproducibility. The engine rejects prepared data whose street, timetable or transfer policy is older than it supports.
Prepared layer
Current version
What it adds
Street store
Schema v6
Node restrictions from the PBF; platform outlines excluded from walking
Routing store
Schema v3
Missing coordinates and pathway costs distinguished from real zeros
Transfer semantics
v4
Pathway modes and stair counts kept from the GTFS
Prepared access policy
v9
Street transfers through public entrances and directed station pathways
Each transfer between boardings uses at most one external transfer edge, and the itinerary keeps every original pathway segment. Declared pathways suppress invented parent-station shortcuts.
The public regression checks use generated inputs:
Shell
npm run check:osm-pbf
npm run check:national-focused
npm run check:standalone
These checks exercise node barriers, access overrides, malformed node tags, pedestrian direction, physically feasible transfer selection in both time directions, scalar/journey matrices, and rejection of old prepared data. They test the implementation and declared input model, not the completeness of any agency's pedestrian map.
This matrix is the public boundary of what VIGO's routing uses from GTFS. "Imported" alone is not support: the routing column says whether a feature changes which journeys are feasible. Every import records a feature inventory.
Pickup and drop-off permissions are compiled per connection: a forbidden boarding is absent from the departure index, a forbidden alighting cannot end a ride, and a passenger already aboard stays on through either kind of restricted stop. Transfers are prepared into one stop-level transfer graph before the scan; see How VIGO computes answers. When a feed uses features VIGO does not support, the rest is routed as a supported_scheduled_core, with the exclusions attached to every Result. Only multiple agency timezones block a whole feed.
GTFS feature or case
Import
Routing behavior
Classification
calendar.txt only
Yes
Weekly service within start/end dates.
Supported.
calendar_dates.txt only
Yes
Type 1 adds and type 2 removes service on the exact date.
Supported.
Calendar plus exceptions
Yes
Exceptions override the weekly calendar for the date.
Supported.
Missing both calendar tables
Rejected
No service date can be established.
Rejected malformed input.
Times greater than 24 hours
Yes
Preserved as seconds on the originating service day.
Supported within the query horizon.
Trips crossing midnight
Yes
Connections retain their originating service date. Native clock-date requests load active adjacent service days, including overnight headway windows.
Supported within the service-day range and query horizon.
Trips extending across more than one midnight
Parsed
Same coordinate model; default horizon may exclude them and the public CLI clock is bounded.
Bounded; caller must set a sufficient horizon and service-day coordinate.
Invalid minute or second fields
Rejected
Values such as 08:60:00 or 08:00:60 do not normalize silently.
Rejected malformed input.
Agency timezone, one timezone
Inventoried
Native service epochs use local noon minus twelve elapsed hours; realtime instants use the same timezone.
Calendar, overnight and DST regression checks cover the native APIs.
Multiple agency timezones in one store
Inventoried
Exact routing is blocked.
Unsupported and visible.
frequencies.txt, exact_times=1
Yes, bounded
The template trip is expanded into deterministic fixed departures for each declared frequency window. Generated instances retain route, service, permissions, and shape identity.
Supported for bounded deterministic windows.
frequencies.txt, exact_times=0
Yes
The template departs at each window's start and then every headway, before the exclusive end_time, as ordinary trips.
Supported as scheduled estimates; limitation frequency_based_service.
Overlapping or mixed frequency windows
Rejected
Import requires nonoverlapping windows and a single exact_times value per trip.
Invalid feed rejected before publication.
Shapes present
Yes
Ordered trip stops are matched to a monotone shape slice.
Supported for rendering; feasibility never depends on shape.
Shapes missing or unusable
Yes
Timetable route remains valid. Ordinary network lenses show no inferred route alignment; selected-itinerary and Shape/Risk QA views may show a dashed, explicitly inferred stop sequence.
Timetable supported; published ride geometry unavailable.
Duplicate stop names
Yes
Identity is stop_id, not name.
Supported.
Parent stations and platforms
Yes
Explicit parent transfer rules expand to child service platforms; selected stations expand to service members. Without an explicit rule, service members share a modeled 120-second connection, reported as parent_station_fallback with schematic geometry.
Supported for location_type 0/1; fallback time is not a measured station pathway.
Deeper location_type hierarchy
Prepared
Station membership includes descendants. Boarding areas connect to their parent platform for boarding/alighting; a platform cannot create an unproved shortcut between its areas.
Pathway-based access supported; unlocated boarding areas cannot be selected directly.
pathways.txt direction and traversal time
Yes
Creates directed transfer edges; explicit traversal times take precedence. Stairs with a stair count and fare/exit gates receive labeled estimated costs when time is omitted. Bidirectional rows create the reverse edge. Parallel pathways use the lowest available traversal cost; unpriced paths without enough data remain excluded.
Supported within the prepared pathway graph.
Pathway wheelchair/slope/width attributes
Profile dependent
Applied during build --wheelchair; ordinary Cities inventory them without filtering.
Directed recommended transfer using declared/default duration.
Supported within transfer model.
Transfer type 1 timed transfer
Yes
A stop-level rule with no minimum time. The guarantee, holding a vehicle for a late connection, is not represented.
Supported without the guarantee; limitation timed_transfer_guarantee.
Transfer type 2 minimum time
Yes
Declared minimum traversal time is enforced.
Supported.
Transfer type 3 forbidden
Yes
Directed pair, including expanded parent/platform pairs, is forbidden and cannot be regenerated by proximity. A same-stop prohibition blocks reboarding after a ride while preserving an origin's initial boarding.
Supported with permanent SQLite, compact-kernel, and matrix regressions.
Transfer type 4/5 in-seat semantics
Retained in optional trip_links
Rust compiles explicit type 4 links, including different terminal stops, into through runs; type 5 never grants a continuation. Source trip identities and dwell remain visible.
Route, Matrix and Reach count one boarding; onboard movement and dwell are riding time.
Route- or trip-scoped transfer selectors
Not applied
Retained in transfer_rules; the stop-level rule governs the transfer. Stop-level rules use parent-station expansion and GTFS specificity: a platform's own rule overrides its station's.
Stop-level semantics only; Flex interchanges still resolve scoped selectors.
Nearby stops without explicit transfer
Prepared
One native multi-target street search creates every directed OSM-reachable alight-to-board edge within 500 m. Each edge stores its routed distance; unproved radial pairs remain visible counts.
Supported within the City street model.
pickup_type=1 / drop_off_type=1
Yes
The complete scheduled trip is retained. Boarding is prohibited only at a stop with pickup_type=1; alighting is prohibited only at a stop with drop_off_type=1; through-riding remains legal.
Supported for fixed-stop routing.
pickup_type / drop_off_type value 2
Conditional
flex: {} includes journeys through timed fixed stops with booking requirements; ordinary routing excludes those events and keeps through-riding.
No booking or availability confirmation; see GTFS Flex.
pickup_type / drop_off_type value 3
Yes
Fixed flag stops permit boarding/alighting, assuming the rider signals or notifies the driver. This does not enable continuous stopping or advance-booking service.
Visible driver_coordinated_stops condition. Rebuild Cities imported before this fix: compiled permission bits cannot distinguish flag stops from prohibited events.
Continuous pickup/drop-off
Conditional
With flex: {}, boarding and alighting follow directed GTFS shapes and stop-time permission overrides. Intermediate times are interpolated and labeled as estimates.
Booking and driver-coordination requirements remain visible; ordinary fixed-stop routing is unchanged.
GTFS Flex zones, location groups and booking rules
Yes
With flex: {}, conditional rides join fixed service in one search.
Sequence, not stop identity, orders a trip; reconstruction can retain repeated locations.
Supported, with adversarial regression coverage required.
Repeated stop in one trip
Yes
Distinct stop_sequence events remain distinct.
Supported.
block_id interlining
Partial
Consecutive same-terminal trips with a shared block, service ID and service day use Rust through-runs; explicit links take precedence.
Other block models require explicit links.
Duplicate stop, route, trip, or calendar IDs
Rejected
A primary-key conflict aborts the temporary build; no partial store is published.
Rejected malformed input with adversarial atomicity coverage.
Missing shape ID referenced by a trip
Yes
Timetable routing remains available, but published alignment is unavailable; any selected/QA stop-sequence line is dashed and marked inferred.
Timetable supported; published ride geometry unavailable.
Untimed interior stop-time gaps
Yes
Timed endpoints remain connected and the itinerary reports interpolated-stop-time-gap; no exact timestamp is claimed for omitted interior events.
Supported with degraded timing precision.
Malformed required table
Rejected
Build does not commit the temporary store.
Supported rejection.
Broken core references
Rejected
Unknown trip routes/services, parent stations, transfer endpoints, frequency trips, and stop-time trip/stop references abort the temporary build. Missing shapes remain a supported timetable-only case as declared above.
Rejected malformed input with adversarial atomicity coverage.
Explicit linked trips
The optional trip_links SQLite table preserves from_trip_id, to_trip_id, and transfer_type (4 or 5), including feed namespaces. Existing Cities without it remain readable. A City whose importer discarded these rows must be rebuilt from the original GTFS; no runtime can recover the missing evidence.
The Rust runtime compiles active, chronological type 4 chains once per timetable view, after realtime updates. Splitting and coupling produce bounded through paths. Original trips remain available for partial journeys and for reconstructing source trip IDs, shapes, headsigns and service dates. No new search algorithm or JavaScript routing path is introduced. Ordinary Cities have no extra connection arrays; linked paths add only their own connections. Limits (512 trips per path, 200,000 paths, and four times the original segment count with a 100,000-segment floor) fail explicitly rather than truncate results. Path retention is also capped at one million trip references. Before copying columns, an estimate including spare vector capacity, physical-part copies and name tables must fit one eighth of detected memory capacity, capped at 128 MiB. This bounds estimated additional allocations; it is not a process RSS guarantee.
A public transit leg following an in-seat continuation has continuation: { "type": "stay_aboard", "durationSeconds": 300 }, for example. The duration is the actual onboard gap before that leg, including zero; it is part of journey riding time, not waiting for another vehicle. Transfer limits apply to boardings, not the number of displayed source-trip legs. Boarding or alighting restrictions at the boundary do not force passengers off the vehicle. Through-journey fares remain unavailable where the fare catalog cannot describe the corresponding fare-leg joins; VIGO does not invent an additional or free fare.
Explicit links may connect different terminal stops: the interval between the first trip's arrival and the next trip's departure is onboard movement or dwell. It is included in riding time, without inventing a passenger walking leg. Overlapping clocks, canceled/truncated endpoints and inactive trips do not establish continuity.
The optional trip_operations table retains block identifiers and bicycle permissions. Rust infers consecutive same-terminal block continuations only within one service ID and service day. Adjacency comes from the original schedule, so cancellation cannot skip over a missing middle trip. Explicit links (including type 5) take precedence. Different-terminal blocks and blocks spanning different service IDs still need explicit links. Old Cities without these optional tables retain their existing behavior.
node test/check-linked-trips.mjs checks raw-GTFS import, forward/reverse Route, Matrix, Reach, source identities, dwell, boarding restrictions, realtime, branching and scenario exclusions. The native unit tests cover service-day boundaries and invalid continuity.
Realtime replacement trips
GTFS Realtime REPLACEMENT (experimental, enum value 5) replaces a known trip's complete stop sequence in Rust. Every call must identify an unambiguous existing City stop and an increasing stop sequence, with absolute arrival/departure clocks at every call. Changed intermediate stops and realtime pickup/drop-off restrictions are supported. Incomplete, backwards or unknown-stop replacements are rejected and reported in realtime diagnostics. NEW and DUPLICATED still need new trip identity construction and are not supported by this replacement path.
Semantic coverage written to store metadata
blockingRoutingFeatures has one code for otherwise importable GTFS: multiple_agency_timezones. A City with it cannot route.
Nonblocking routingLimitations keep the City routable in supported_scheduled_core mode. Each records a count and a detail, and an exactness of approximate or unsupported:
Code
Meaning
frequency_based_service
exact_times=0 templates, routed as departures every headway from each window's start
repaired_trip_times
Backward times repaired by delaying events at most 600 seconds
Trip and stop accessibility attributes outside the active profile
feature_inventory_incomplete
The import could not inventory every feature
"Nonblocking" does not mean full-feed support: it means VIGO makes a narrower, explicit claim over the compiled scheduled core instead of disabling unrelated service. A journey in this mode is optimal over that core, and no_path means no path exists in the core; an excluded trip or rule could still change full-feed reachability. Holding a vehicle after its scheduled departure is not predicted.
Public comparisons require matching assumptionsFingerprint values. Scenario and observation content are interventions excluded from that fingerprint; route constraints, City revision and engine version are included. Equivalent requests with omitted and explicit defaults are treated as different until normalized.
Required fixture policy
Each row classified supported must have a miniature feed that would fail if the field were merely parsed. Each visible unsupported row must have a fixture that imports successfully and records the feature code. Permission fixtures must prove that the trip remains connected, illegal boarding and alighting events are rejected, and through-riding remains legal in the resident kernel, shared matrix path, and merged stores. Quarantined transfer fixtures must prove that the unsupported row is absent from the generic graph. Multiple-timezone fixtures must still prove a feed-wide blocked result. Rebuild an older SQLite store before using it for a published result.
VIGO uses one exact Transit Matrix search for every City and OD set. City names, endpoint distance, and matrix dimensions do not select different algorithms. Independent reference implementations live in tests and never supply production answers.
Accuracy has two parts: the search must solve the declared model, and the model must faithfully represent the input data and the intended trip. A fast result or agreement between two VIGO interfaces establishes neither part by itself.
Reproducible independent checks
Shell
npm run build:rust-routing-kernel
npm run check:accuracy
# Extend the same checks to 100 deterministic generated networks:
VIGO_ACCURACY_SEEDS=100 npm run check:accuracy
test/check-routing-accuracy.mjs generates its own public synthetic inputs. A failing run retains the input directory and reports its seed and query. It uses:
Floyd–Warshall, implemented independently from VIGO's routing and contraction code, to check every directed walking distance and driving travel time on weighted graphs. Alternating graphs allow only forward edges, so unreachable OD pairs are checked as well. Drive witnesses are checked edge by edge against the input weights.
Whole-trip enumeration from generated raw GTFS, independently of VIGO's compiled connection scan, to check earliest arrival and latest departure. The fixtures exercise pickup/drop-off restrictions, staying aboard restricted stops, dwell, midnight, inactive dates, missed connections, published same-stop minimums and forbidden transfers. Zero-duration trips are deliberately placed in reverse dependency order; all scans resolve same-time connections to a fixed point.
Every stop-to-stop OD at each boarding-time boundary on the generated transit networks. This covers each distinct exact-stop departure interval in those fixtures. Separate queries check Matrix permutations, duplicate endpoints, scalar Route parity and materialized ride times and permissions.
Separate raw GTFS fixtures verify 0-, 30-, 90- and 300-second platform transfer rules, parent-station expansion, and forbidden transfers through Route, Matrix and arrive-by queries.
The normal suite runs eight seeds on every supported CI operating system. Larger runs use the same algorithms and assertions. They do not select easier queries based on a City's identity or on previous outcomes.
Declare the model before comparing answers
The engine adds no implicit boarding buffer. Same-stop vehicle changes honor published GTFS minimum transfer times and forbidden transfers; staying aboard does not incur a transfer minimum. The minimum affects boarding readiness, not the alighting time or final egress. Explicit transfer edges retain their durations without an added boarding margin or a 60-second floor. Native diagnostics report transferBoardSlackSeconds: 0. A published platform-to-platform transfer rule takes precedence over the station walking fallback.
GTFS service dates, after-midnight times, pickup/drop-off permissions and transfer rules must come from the same input snapshot. Their definitions are in the GTFS Schedule Reference.
Record the exact date, time zone, departure/arrival objective, walking speed, per-endpoint walking limit, direct-walk limit, transfer policy, search horizon and live-state snapshot. Distinguish exact selected stops from arbitrary coordinates. Coordinate snapping and street access are part of the query model and require their own verification.
Checks required for a real City
Validate compilation. Check raw GTFS references, calendars, exceptions, permissions and transferred identities against the compiled City. Inspect omitted or unsupported features. Check directed OSM access and connectivity, including isolated components, bridges and one-way streets.
Verify journey witnesses. Each ride must reference an active raw trip, follow its stop order, use legal boarding/alighting events and preserve published times. Every street segment must follow allowed directed edges. Check endpoint connectors separately so a correct graph path cannot conceal an invalid snap.
Compare independently. Run the same inputs and query policies through an independent router such as OpenTripPlanner. Its route-request documentation describes configurable routing policies. Retain both itineraries and investigate each disagreement; matching durations alone is insufficient, and another engine's answer is not ground truth.
Test changes that should preserve or constrain the answer. Rename IDs, reorder input rows and Matrix endpoints, move the complete City directory, and repeat after unrelated queries. Answers should remain stable. Under identical horizons and policies, removing service must not improve earliest arrival, and adding service must not make it worse.
Retain failures. Keep false reachable results, false blocked results, invalid witnesses, timing discrepancies, setup failures and query errors as separate outcomes. Save the smallest reproducing input and add a regression before accepting a fix. Do not change the oracle to match an unexplained engine answer.
For exact graph and timetable comparisons, require zero feasibility disagreements. Use only the documented public timestamp rounding tolerance when comparing numeric results. Equivalent optimal itineraries may differ in geometry or route choice; validate feasibility and the objective before comparing presentation details.
What passing means
The independent suite validates the generated graph and timetable models under their declared policy. It does not establish correct coordinate snapping on arbitrary OSM extracts, complete GTFS transfer-rule support, live-provider correctness, or real delivered travel times. Those require retained City-specific input and witness checks. A universal algorithmic guarantee comes from the algorithm's invariants and input assumptions; finite testing supports it but cannot prove every possible City or OD.
VIGO models the City revision and query it is given. It does not certify real-world service, demand, safety or operations. How VIGO computes answers separates what is exact from what is bounded or estimated.
GTFS
VIGO uses the GTFS features listed in GTFS support. Unsupported or malformed features are reported during the build.
Frequency templates with exact_times=0 are read as a departure at the start of each window and then every headway. GTFS gives no exact times for them, so these are scheduled estimates.
Route- and trip-scoped transfer rules are kept but not applied; the stop-level rule governs those transfers. Timed-transfer guarantees are not represented.
Missing shapes do not prevent routing but limit map geometry.
Explicit GTFS in-seat links keep passengers aboard across trip changes and count one boarding. Block-based continuation is inferred only for consecutive same-terminal trips on one block, service and day; other continuations need explicit links.
Staying aboard must move the rider onward. A journey boards a looping vehicle at its last pass, and alternatives that stay aboard through a turnaround only to return to a stop the rider could already reach are dropped.
Transit Route and Matrix
Arrive-by Matrix durations include any wait between arrival and the deadline; use journeys for the actual arrival.
Time reserves change route choice, but VIGO computes no arrival probabilities.
A finite maxTransfers cap cannot be combined with transit via points.
Returning to a station already visited can be valid in the timetable; it is flagged, not excluded.
Without an explicit rule or declared pathways, platforms of one parent station use a transfer time of at least 120 seconds, or their distance at walking speed. These legs report transferSource: "parent_station_fallback" and a schematic line.
A street route to a platform coordinate does not establish an entrance-to-platform connection. Walks touching subway platforms report stationAccessStatus: "unverified" unless a declared pathway covers them. Untimed stairs and gates use explicit estimates (one second per step, five seconds per gate). Scalar Matrix results do not carry this per-leg evidence.
Departure windows sample whole minutes; they are not continuous profiles.
Streets
Walk, Drive and Bike depend on OSM coverage and directions.
Pedestrian attachment searches vertices within 160 m and edges within 80 m. A missing attachment is not proof that no path exists.
Platform polygons describe an area, not a path; routing across their interiors is not modeled.
A free coordinate keeps its nearest attachment even when that street connects poorly, such as a ramp or bridge above the point. Attaching to several streets would let a connector cross barriers. Place points on the street or path the traveler will use.
Authorized endpoint access is an opt-in assumption; it does not establish permissions, gate hours or missing links.
Drive does not model every turn restriction, signal or intersection delay, and traffic must be supplied.
Realtime
Realtime transit needs explicit realtime selection and a snapshot, supplied or polled. It applies to Route in every runtime and to transit Matrix and Reach only in the engine. Vehicle Positions never change routing. In the engine, a fresh NO_SERVICEService Alert closes what it selects; other alerts are reported on legs.
Only FULL_DATASET feeds are decoded. Added, duplicated and unscheduled trips are unsupported for routing.
Feed and record timestamps must be at most 180 seconds old and 60 seconds ahead. Missing timestamps do not establish freshness.
City reuse and platforms
Copy the entire City directory. Executables are specific to an operating system and CPU; City data is portable across the supported 64-bit platforms.
Older Cities without a persisted driving hierarchy rebuild it when a process opens them; rebuilding the City from source persists it.
A new active-service pattern, a changed walking policy or an evicted timetable needs preparation. Missing or corrupt required street files are errors.
Studio's settings, drafts and live connections are local and do not travel inside a City. Studio cannot open compiler City directories in this release.
Scenarios and Reach
Planned service changes apply to transit Reach, and in the engine and Studio to transit Route. Traffic applies to Drive Route and Matrix. Drive Reach uses free-flow speeds without traffic or scenarios.
maxTransfers limits changes in baseline and scenario Reach; walking never counts as a boarding.
Reach rasterizes reached streets while Matrix evaluates coordinates, so their cells can differ under matching settings.
Reach measures modeled travel time, not people, jobs, demand, welfare, behavior or operational feasibility.
VIGO Python 1.0.0 gives scripts and notebooks a small set of objects for transport analysis. Build or open a City, run Route, Matrix, or Reach, and retain the Result. Reuse one open City for repeated work.
import vigo
with vigo.open("./boston") as city:
result = city.route(
[-71.11902, 42.37334],
[-71.05524, 42.35227],
depart_at="08:00",
service_date="2026-10-05",
)
if result.status == "ready":
print(result.duration_minutes)
This example requires a City covering central Boston and a feed active on the chosen date. Coordinates are [longitude, latitude]. Transit may choose a direct walk; set require_transit_ride=True when a boarding is required.
Python uses ready and blocked Result statuses. Ordinary queries use minute-valued travel times; opt-in Monte Carlo distributions retain seconds. A completed Matrix can contain blocked rows. Invalid inputs and execution failures raise exceptions. Results and exports explains each field and the comparison rules.
The public Engine CLI and HTTP schemas use seconds and different status names. Use Python's documented Result properties in Python applications.
Keep repeated work efficient
Use a context manager, retain the open City, and request Matrix journeys or geometry only when needed. Install the optional speed extra for accelerated response decoding. Use result.iter_rows() to copy only consumed rows. Runtime and performance explains process reuse, timing, and resource lifetime.
Install VIGO Python 1.0.0, select Engine 1.0, and open a prepared City. The example below asks for a journey from Harvard Square to South Station.
1. Install
For a packaged installation, download the VIGO-Python-… ZIP matching your OS and CPU from the VIGO releases page and unzip it. It contains the wheel, INSTALL.txt, and the runtime manifest. Replace the filename below with the unzipped wheel:
Platform wheels include Node, the headless CLI bundle, the Rust kernel, and the vigo engine executable. The optional speed extra adds accelerated JSON decoding. Omit the extra for the dependency-free Python package; the packaged Engine is still included. Python 3.10 or newer is required.
From a source checkout, install the wrapper and select a separately built Engine:
VIGO_RUNTIME can name a complete headless directory or a built vigo.mjs file. A source .mjs needs system Node and its matching native kernel. See runtime selection for complete layouts and Windows usage.
2. Prepare the City
A City is a prepared directory built once from a static GTFS ZIP and an OpenStreetMap .osm.pbf. The Engine Boston tutorial lists where to download both. Save this as build.py and run it once:
Python
import vigo
with vigo.build(
"./boston",
gtfs="./data/MBTA_GTFS.zip",
osm="./data/massachusetts-latest.osm.pbf",
) as city:
print(city.name, city.revision_id)
print("timetable covers", city.service_period())
Build runs the engine's Rust compiler, the same one behind vigo build and Studio, so a City built here is identical to one built elsewhere. In a terminal or notebook it prints each stage and the elapsed time; a Boston build takes about a minute. Missing input files are reported before anything starts. Build refuses to overwrite an existing City unless you pass replace=True. Add prepare_dates=["2026-10-05"] to compile the dates you will query into the City.
Build once; reopen the saved City with vigo.open() in later sessions. Do not call Build inside a query loop. Keep the entire directory, including its timetable and street files. If a prepared City predates the supported format, rebuild it from its original inputs into a new directory.
3. Run a journey query
Save this as route.py. The example requires Boston street coverage and a timetable active on October 5, 2026, as in the Engine tutorial. With another feed download, pick a date inside city.service_period().
Python
import vigo
with vigo.open("./boston") as city:
result = city.route(
[-71.11902, 42.37334],
[-71.05524, 42.35227],
depart_at="08:00",
service_date="2026-10-05",
max_walk_km=1.2,
require_transit_ride=True,
)
if result.status == "ready":
print(f"Journey: {result.duration_minutes:.1f} minutes")
for leg in result.legs:
print(leg["type"])
else:
print("No journey under the supplied constraints.")
result.export("route-result.json")
Run it with the same interpreter used for installation:
Shell
python route.py
The first query starts the resident process and opens the required data. Further queries in the same with block reuse that process. Exiting the block releases it; returned Results remain usable.
4. Read and reuse the answer
duration_minutes is the selected journey duration. legs contains its timed steps and available geometry. Inspect warnings before using a path in a passenger-facing application. A blocked Result is a valid no-journey outcome; VigoError reports a failed operation.
VIGO has four first-class concepts and three Query families. Build or open a City, optionally apply a Scenario, then retain the Result of a Query.
City -> Route | Matrix | Reach -> Result
^
optional Scenario
City
A City is a compiled mobility model built from GTFS and OSM. Its directory is one atomic unit containing the timetable, street model, and the data needed to open them quickly.
A named City may be rebuilt over time. Each build is an immutable revision. A Result records the revision it used.
city.revision_id identifies the build. city.built_at records when it was created. city.sources records its GTFS and OSM inputs. Moving the complete City directory does not change that identity.
Scenario
A Scenario is an immutable set of changes applied to exactly one City revision.
The shared VIGO model can describe:
proposed transit service changes;
one live transit state;
one supplied traffic state.
Query choices such as a walking limit, departure time, or time cutoff are not Scenario changes. A complete alternative GTFS source is another City revision, not a Scenario. Map geometry used to draw an edit is presentation data, not a transport change by itself.
VIGO checks a selected combination before running it. It never drops an unsupported change and quietly returns the unchanged City.
Python supports planned service changes in Reach and in Monte Carlo Route, Matrix and Reach, plus supplied traffic in Drive Route/Matrix. Python live-transit Scenarios, realtime transit Matrix, and realtime Reach are unsupported. Supplied traffic uses the shared native driving kernel and requires an engine that advertises that capability.
city.supports(query) and scenario.supports(query) return a Support value with a reason and available alternative when the selected context cannot execute a combination. This is not a complete data-validation pass; execution still checks points, dates, and runtime inputs. See the Python support table.
Query
VIGO has exactly three Query families.
Route
Find and explain travel between ordered points. Transport mode, depart-at, arrive-by, departure windows, waypoints, and batch requests are Route options.
Depart-at minimizes arrival time, then boardings, then walking. Arrive-by maximizes departure time, then minimizes boardings and walking among journeys arriving by the deadline, then actual arrival.
Matrix
Compute scalar travel time between one or more origins and destinations.
Both depart-at and arrive-by accept up to 100,000 pairs. Fixed departures share one forward scan per unique origin; fixed arrival deadlines share one reverse scan per unique destination. Arrive-by duration runs from the latest departure to the deadline, including destination waiting.
Reach
Compute where the represented network can travel within stated time limits. A Reach Result may be viewed as contours or reached streets.
Depart-at Reach spreads from an origin. Arrive-by Reach gathers toward a destination: it maps where a traveler can leave from and still arrive by a deadline, such as the homes that can reach a school by 08:30.
Reach is not Accessibility. Accessibility requires opportunities such as jobs, population, schools, or healthcare in addition to travel impedance.
Result
A Result is the immutable answer to one Query. Every Result exposes:
status;
Query inputs;
warnings;
timing;
City revision and Scenario name;
export methods.
Compare is an action on two compatible Results. It is not a fourth Query family.
Result status is only ready or blocked. A completed Matrix is ready even when individual rows are blocked. Python-side query validation raises InvalidQuery; unsupported combinations raise UnsupportedQuery; runtime validation and execution failures raise VigoError. Background work separately reports queued, running, ready, cancelled, or error through Job.status.
Compare uses retained values and checks family-specific structure; the caller must align dates, points, modes, and other study assumptions. A valid numerical difference does not establish that two Results answer the same question. See Results for comparison and evidence boundaries.
Time
VIGO keeps these durations separate:
Build: GTFS and OSM become a City.
Open: a City revision becomes ready for queries.
Compute: the selected Query runs.
End to end: caller submission through complete Result.
Repeated Route calls may reuse one open process. The answer is still computed for every call.
The wrapper's timing["endToEndMs"] ends before Result construction and export. Use an outer timer for the complete Python operation; see runtime measurement.
The VIGO command line uses the same nouns: vigo build, vigo inspect, vigo route, vigo matrix, vigo reach, and vigo compare.
vigo capabilities reports the public API version and supported combinations. VIGO Python V1 supports the VIGO V1 engine with API 1.0, capability schema v3, and trace output. Runtime selection rejects other API versions and capability schemas.
Route and Matrix accept max_transfers=0 for at most one boarding, max_transfers=1 for at most two, and so on through 31. Omit the option (or use None) for no additional cap. It applies to both depart_at and arrive_by and all Matrix shapes. A finite cap with ordered transit waypoints is currently unsupported.
These examples use the public vigo package and a complete City at ./boston. Replace the paths, points, and service date with values covered by your data. They describe scheduled model outputs, not observed journeys. See the reference for all arguments and the walkthrough notebook for an interactive, end-to-end version.
Bicycle routing and departure-window distributions
Build bicycle streets with vigo.build(..., street_modes="walk,drive,bike"), then select Bike on Route, Matrix or Reach. The default build remains "walk,drive"; old Cities need bicycle data before this mode can run.
The following examples require a prepared City with bicycle streets, stop IDs A and B, and service on the stated date. Substitute your own covered inputs:
Python
import vigo
with vigo.open("./city") as city:
bike = city.route(
"A", "B", mode="bike", bike={"profile": "quiet", "maxLts": 2},
depart_at="08:00", service_date="2026-07-15",
)
window = city.matrix(
{"home": "A"}, {"work": "B"}, service_date="2026-07-15",
monte_carlo={"startMinutes": 480, "endMinutes": 540,
"draws": 200, "seed": 42, "percentiles": [50, 95]},
)
print(window.sampling)
for row in window.iter_rows():
print(row["percentile"], row["durationSeconds"])
window.export("./window.json")
window.export("./window.csv")
Monte Carlo uses scheduled transit and a departure window; omit point times. Unreachable quantiles are None, not zero. GTFS frequencies are fixed departures every headway; planned Scenario frequency services are randomly phased, and each phase is shared across all endpoints within a sample. Results describe unknown schedules and passenger departure times, not observed reliability. Planned Scenarios also support Monte Carlo Route, Matrix and Reach. See the option and result reference for accessibility inputs, memory limits, export units and comparison semantics.
Find a journey
Use Route when you need departure and arrival times, transfers, and legs. An arrive-by request searches for the latest feasible departure. Waypoints are visited in their supplied order.
Python
import vigo
with vigo.open("./boston") as city:
journey = city.route(
[-71.062, 42.356],
[-71.071, 42.361],
waypoints=[[-71.058, 42.349]],
arrive_by="09:00",
service_date="2026-09-04",
max_walk_km=1.2,
)
if journey.status == "ready":
print(journey.duration_minutes)
for leg in journey.legs:
print(leg)
else:
print("No journey satisfies this request.")
journey.export("outputs/journey.json")
journey.export("outputs/journey.geojson")
Transit compares a feasible direct walk by default. Set require_transit_ride=True to require a boarding. Use mode="walk" or mode="drive" for street routing. A finite max_transfers is currently unsupported with ordered transit waypoints. Changing a constraint changes the question; retain it in the study record.
Calculate travel times to a common destination
Use Matrix for an assignment table, travel-time screen, or repeated origin–destination analysis. Give points stable caller IDs so rows remain joinable when their input order changes.
Python
import vigo
homes = {
"home-west": [-71.080, 42.356],
"home-south": [-71.062, 42.340],
}
schools = {"school": [-71.058, 42.349]}
with vigo.open("./boston") as city:
morning = city.matrix(
homes,
schools,
arrive_by="08:30",
service_date="2026-09-04",
max_walk_km=1.2,
max_transfers=1,
require_transit_ride=True,
)
rows = morning.rows
ready = [row for row in rows if row["status"] == "ready"]
blocked = [row for row in rows if row["status"] == "blocked"]
print("ready", len(ready), "blocked", len(blocked))
morning.export("outputs/morning.json")
morning.export("outputs/morning.csv")
afternoon = city.matrix(
schools,
homes,
depart_at="15:00",
service_date="2026-09-04",
max_walk_km=1.2,
max_transfers=1,
require_transit_ride=True,
)
afternoon.export("outputs/afternoon.json")
A shared destination and deadline share one reverse timetable scan. A shared origin and departure share one forward scan. Keep the City open while changing endpoint groups. A request accepts up to 100,000 pairs; the product of origin and destination counts is the relevant size.
For arrive-by Matrix, durationMinutes runs from the latest departure to the requested deadline, including waiting after early arrival. Use include_journeys=True when actual arrival and timed legs matter; include_geometry=True additionally materializes their paths. These options increase output and assembly work. The results guide explains row status, missing durations, and nested journeys.
Compare a service proposal
Use the same Reach Query for the baseline and proposed service. Here the proposal adds a modeled service between two coordinates: both directions, a 05:00–25:00 service span, ten-minute headways, estimated travel at 22 km/h, and 0.35 minutes of dwell. These are authored assumptions, not observed operations. Use the Engine's Scenario reference for adding, augmenting, replacing, or excluding service.
Reach's radius bounds the computed area; increasing it changes the analysis, not just the map zoom. Keep the grid, date, time, direction, walking assumptions, and origin or destination aligned. Compare checks grid compatibility but does not establish that all study assumptions match. Report newly reachable and no-longer-reachable cells beside duration changes among comparable cells. Reach alone does not measure jobs, people, or other opportunities.
Run independent queries concurrently
For independent school matrices or other batches, use bounded concurrency while keeping complete Results in input order:
Python
from contextlib import closing
# queries is an iterable of vigo.Route, vigo.Matrix, or vigo.Reach objects.with closing(city.iter_run(queries, workers=2)) as results:
for index, result in enumerate(results):
result.export(f"outputs/query-{index}.json")
The iterator limits pending queries and retained responses. It avoids accumulating the entire batch; city.run(queries, workers=2) can instead return a list when queries is a sequence and all Results fit in memory. The same methods work on a Scenario. No itinerary fields are removed or approximated.
Start with two workers and measure your own workload. Each worker owns a resident Engine process and prepared City. Effective concurrency is capped by CPU/memory capacity (at most four); startup and additional memory can outweigh gains for small batches. Errors surface in input order and stop iteration; already submitted queries may complete. Closing waits for active queries. The default workers=1 preserves serial execution. See the execution reference for the full contract.
Retain every batch outcome
city.run([query, ...]) executes sequentially and stops at the first exception. Use an explicit loop when a study must preserve each success, blocked outcome, and query failure. Opening the City happens outside this loop: a setup failure is a failure of the batch setup, not one blocked journey per request.
Python
import json
from collections import Counter
from pathlib import Path
import vigo
requests = {
"morning": vigo.Route(
[-71.062, 42.356], [-71.058, 42.349],
depart_at="08:00", service_date="2026-09-04",
),
"evening": vigo.Route(
[-71.058, 42.349], [-71.062, 42.356],
depart_at="17:00", service_date="2026-09-04",
),
}
output = Path("outputs/batch")
output.mkdir(parents=True, exist_ok=True)
outcomes = []
with vigo.open("./boston") as city:
for request_id, query in requests.items():
try:
result = city.run(query)
except vigo.VigoError as error:
outcomes.append({
"id": request_id,
"outcome": "query_error",
"errorType": type(error).__name__,
"message": str(error),
})
continue
result.export(output / f"{request_id}.json")
outcomes.append({"id": request_id, "outcome": result.status})
(output / "outcomes.json").write_text(
json.dumps(outcomes, indent=2) + "\n", encoding="utf-8"
)
print(Counter(row["outcome"] for row in outcomes))
Keep the authored requests with this output, including failed requests that have no Result. An export failure remains an exception rather than becoming a routing outcome. Do not replace blocked durations with zero or drop failed requests from the denominator.
For background work, use city.submit(query). A background job can finish successfully with a blocked Result; Job.status describes execution, while Result.status describes the modeled answer.
A Result is the retained answer to one Query. Read its outcome before interpreting its numbers, and keep the query and City revision with any exported table or map.
Outcomes
Outcome
Meaning
How to retain it
Route or Reach ready
A journey or surface was produced under the request
Keep values, assumptions, warnings, and timing
Route or Reach blocked
The computation completed without a usable journey or surface
Keep the outcome; do not turn missing values into zero
Matrix row ready
This pair has a modeled travel time
Analyze the row's duration
Matrix row blocked
This pair has no usable answer under the request
Keep the pair in outcome counts
Exception
Setup, validation, support, timeout, or execution failed
Keep the exception separately from blocked outcomes
A completed Matrix's top-level status is ready even when some or all pairs are blocked. Inspect matrix.rows. A ready Result may still carry warnings; it does not establish that the source data represent every real route, restriction, or operational condition.
Background Job.status is separate. ready means the job returned without an exception; the returned Result can be blocked. See errors and jobs.
Shared fields
Python property
Meaning
kind
route, matrix, reach, or comparison
status
ready or blocked
query
Normalized runtime request, using Engine field names such as serviceDate
warnings
Warnings returned by the runtime
timing
Runtime and wrapper timing fields, where reported
city_revision_id
City build used by the Query
scenario_name
Selected Scenario name, or None
record
Compact record with City revision, Scenario name, query, outcome, warnings, and timing
value
Journey, Matrix rows, Reach surface, or comparison change
Properties such as query, rows, legs, and timing return copies. Editing them does not change the retained Result. to_dict() returns the complete Engine payload; record is a compact Python record, not an alias for that payload. Comparison Results have a different envelope and do not include the two full source Results.
Route
Use duration_minutes for the selected journey and legs for its detail. A blocked Route normally has no duration and no legs. Export JSON for the complete journey; GeoJSON contains only legs with line geometry and a small set of properties.
Depart-at minimizes arrival time, then boardings and walking. Arrive-by maximizes departure time and then resolves secondary objectives within the arrival deadline. A departure-window query is a different question from an exact departure; retain the window with the answer. See the Route reference for constraints.
Matrix
Rows contain caller IDs (originId, destinationId), endpoint indexes, status, and durationMinutes, with other fields depending on the mode and requested detail. Output uses origin-major order. Prefer IDs to row position when joining analysis tables. Use unique IDs and keep their associated coordinates or stop IDs stable across runs.
For arrive-by transit Matrix, departMinutes is the latest feasible departure and arriveMinutes is the requested deadline. durationMinutes includes destination waiting after an early arrival. With include_journeys=True, each ready row's journey supplies actual arrival, transfers, walking, waiting, ride time, and timed legs. With include_geometry=True, that journey also includes selected path geometry. Blocked rows have no journey.
Equal-objective Matrix journeys can differ from Route in which tied path they choose, and therefore in ride/wait splits. The parent Matrix timing covers the shared computation. A nested journey's timing does not represent an independent timetable search or an allocated share of batch time.
Reach
value contains the travel-time surface; to_geojson() returns contours. The grid size and bounds belong to the computation. extent_radius_km limits the area computed around the origin, or the destination for arrive-by Reach, and raster_size controls its resolution. An arrive-by value is the time between the latest departure from that place and the deadline, so it includes any wait after an early arrival. query records destination and timePreference: "arrive_by" in place of origin. A contour is a representation of this model, not a guarantee that every location inside a polygon has identical access.
Reach measures travel impedance. An accessibility measure additionally needs opportunity data and an aggregation rule, such as counting jobs below a travel-time threshold. Keep those external inputs and assumptions separate from the Reach Result.
Compare completed Results
vigo.compare(before, after) and before.compare(after) compute differences without running either Query again. The sign is after minus before: a negative duration change is faster.
Family
Comparison behavior
Route
Duration and transfer change when both Results are ready; otherwise the corresponding change is None
Matrix
Match rows by origin/destination IDs, falling back to indexes; count faster, slower, unchanged, newly reachable, and no-longer-reachable pairs
Reach
Require equal grid dimensions, bounds, and value counts; count the same changes across cells
For Matrix and Reach, meanChangeMinutes uses only matched pairs or cells with finite values on both sides. It is None when none are comparable. Newly reachable and no-longer-reachable outcomes are reported separately; they do not enter this mean.
The caller must align the study. Compare does not require equal City revisions, dates, times, modes, walking limits, or other Query settings. Route can compare unrelated endpoints unless the caller prevents it. Matrix silently skips unmatched pairs; repeated IDs can collapse the before-side lookup. Keep unique, stable IDs, check the complete pair sets, and report coverage as well as speed changes. The Reach grid check alone does not establish matching inputs.
Export
Extension
Supported Results
Contents
.json
All
Complete Engine payload
.geojson
Route, Reach
Route leg lines or Reach contours
.csv
Matrix
Row fields
result.export(path) creates parent directories, writes the selected representation, and returns its absolute Path. It overwrites an existing destination. Python exports write directly; use distinct run directories when preserving earlier evidence. to_json(indent=None) returns compact JSON.
Keep JSON as the complete record. GeoJSON omits most query and runtime detail. CSV does not preserve the Result envelope; nested journey objects become text in cells, so JSON is preferable when journeys are requested. Matrix does not expose to_geojson(), even when its nested journeys include geometry.
Retain a reproducible record
Alongside the full Result JSON, retain the authored request or script, complete City revision, Scenario inputs, selected runtime version, and wrapper version. The normalized query is useful but is not a promise to echo every input: for example, a supplied traffic snapshot is not fully reproduced in every query envelope. A Scenario name alone does not reproduce the change.
Python
import json
from pathlib import Path
import vigo
with vigo.open("./boston") as city:
result = city.route(
[-71.062, 42.356], [-71.058, 42.349],
depart_at="08:00", service_date="2026-09-04",
)
result.export("outputs/route.json")
record = {
**result.record,
"wrapperVersion": vigo.__version__,
"engineVersion": city.runtime.product_version,
"apiVersion": city.runtime.api_version,
"sources": city.sources,
}
Path("outputs/record.json").write_text(
json.dumps(record, indent=2) + "\n", encoding="utf-8"
)
Timing describes execution, not accuracy. Synthetic integration tests check contracts and controlled routing behavior; they do not establish field prediction accuracy. Interpret results within the Engine's data and routing limits.
Route and Matrix Results can be separated into journey summaries and individual legs. For Matrix, request include_journeys=True when computing the Result. The helpers use only the Python standard library; pandas is optional for analysis:
This retains blocked journeys and missing itinerary detail in the summary table. Missing component durations stay missing; journey duration remains the Engine value because elapsed waiting and leg durations need not sum to the same total. Leg types and time units retain their Engine meanings. Request include_geometry=True on iter_legs() to copy available geometry.
The input is a saved result.export("result.json") file. The script writes journeys.csv, legs.csv, and record.json with query, warnings and timing. Nested fields are JSON encoded in CSV. Supply --scenario and --city-revision if that provenance is absent from the exported payload. An empty leg table contains no itinerary records. result.export_tables("tables") discovers columns in one pass and writes records in a second, keeping only one record at a time. The Engine response itself is already resident. Serialization completes before existing files are replaced; use a separate output directory per Result when readers need a consistent set of tables.
vigo.open(path) reads the City manifest, checks its required files, and resolves a runtime. It does not load the complete routing network. The first Query starts its runtime process and opens the required native data.
Installation choices
Install
Engine requirement
Use it for
Platform wheel with bundled runtime
Included Node, headless bundle, native kernel, and engine executable
A self-contained Python environment
Source checkout or universal development wheel
Select a compatible external Engine
Wrapper development or an independently managed Engine
Python with a complete Studio installation
Select the app or extracted distribution
Reusing the Engine shipped with Studio
Python requires version 3.10 or newer. Install a local platform wheel with python -m pip install /path/to/vigo-1.0.0-py3-none-PLATFORM.whl, substituting its real filename. The package has no mandatory Python dependencies. tqdm optionally draws Build progress as a live status line.
For a source install, run python -m pip install -e . from the wrapper checkout, then select a compatible runtime explicitly. An adjacent Engine checkout is not automatically selected. Maintainers can stage and build a headless platform wheel.
The wheel runs the VIGO compiler, vigo.mjs, as a resident process with its own private Node; routing runs in the engine's Rust executable and kernels. vigo.build() runs the engine executable shipped beside vigo.mjs directly, so building starts no Node. It is not a direct Python/Rust extension, and Python needs no system Node or Rust.
From GTFS and OSM to the first answer
Measure vigo.build() from just before the call until it returns a City. Use local raw files and a new output directory: this includes import, required street indexes, transfers, station-access preparation, and publication of the saved City. It does not include a Query for a particular service date.
Measure the first city.route() separately, and report their combined time when answering "how long until a new city can answer?" The first Query can prepare its active-service timetable and selected ride geometry.
Python
from time import perf_counter
import vigo
runtime = vigo.resolve_runtime() # Runtime discovery is outside these timers.
started = perf_counter()
with vigo.build(
"./boston", gtfs="./mbta.zip", osm="./massachusetts.osm.pbf", runtime=runtime
) as city:
built = perf_counter()
result = city.route(
[-71.062, 42.356], [-71.058, 42.349],
depart_at="08:00", service_date="2026-09-04",
)
answered = perf_counter()
print("raw_build_seconds", built - started)
print("first_query_seconds", answered - built)
print("raw_to_first_answer_seconds", answered - started)
print("status", result.status)
Choose a date covered by the feed. These timers exclude downloads, installation, runtime discovery, printing, export, and closing the City. Record those costs separately when they belong to the intended workflow. The compiler's city.details["timing"]["totalMs"] ends before final publication and is not the complete elapsed time of vigo.build(). Its component stages can overlap.
Scenario collections
A scenario collection is several Cities that share one street network, built by the engine with vigo build-scenarios --spec spec.json --output ./collection (collection format). Python opens one member at a time:
Python
with vigo.open("./collection/cities/proposal") as city:
result = city.route([-71.11902, 42.37334], [-71.05524, 42.35227],
depart_at="08:00", service_date="2026-10-05")
Opening the collection directory itself raises VigoError naming its member Cities. For query-time service changes without a rebuild, use city.scenario().
Build progress
Build shows progress automatically in notebooks and terminals, and stays quiet in scripts whose output is redirected. Pass progress=True or progress=False to choose explicitly:
Python
with vigo.build("./boston", gtfs="./mbta.zip", osm="./massachusetts.osm.pbf", progress=True) as city:
print(city.name)
Without extra packages, progress prints one line per Engine stage with the elapsed time, plus a reminder each minute during long stages. With tqdm installed (python -m pip install ".[progress]"), it is a single live status line from tqdm.auto showing the latest stage and elapsed Build time. The timer continues during long stages, including street-index preparation. It does not invent a percentage or remaining time when Engine has not reported a total. Build errors retain Engine's explanation; timeout or interruption stops the build processes and closes the display. Progress does not add work to Route or Matrix calls.
Reopen a built City
Call vigo.build() once for the GTFS and OSM inputs, then use vigo.open() on the saved directory in later sessions. Raw inputs are not needed for querying. Keep the whole City directory when moving or packaging it: it contains the street indexes, prepared station-access state, and retained timetable snapshots.
The current VIGO runtime restores these prepared files instead of repeating their compilation. Node and the packaged runtime share the same portable timetable format. A new set of active services may need one timetable preparation; dates with identical active services share it. The timetable disk cache is bounded, so an evicted pattern needs preparation again. Missing or outdated timetable/access caches are rebuilt from the compiled City. Missing or corrupt required street files need a complete City restored or rebuilt; changing the raw network data requires a new build.
Reopening still reads files and allocates working memory. Reusing one open City also avoids those costs. Result.timing["openMs"] measures runtime preparation the first time each mode is prepared in a resident process, and is zero when that mode is reused.
Select a runtime
Python
import vigo
runtime = vigo.resolve_runtime()
print(runtime.product_version, runtime.api_version, runtime.source)
with vigo.open("./boston", runtime=runtime) as city:
print(city.sources)
Selection follows this order:
The explicit runtime= argument.
VIGO_RUNTIME, then VIGO_APP.
The bundled headless runtime.
Installed VIGO Studio.app locations on macOS.
vigo on PATH.
An invalid explicit setting fails rather than selecting another engine. Once a complete bundled layout is selected, a failed capability check also ends discovery. Sibling source checkouts are not discovered implicitly. VIGO Python V1 supports the VIGO V1 engine, API 1.0, capability schema v3, City format 1, Result schema 1, the public commands, and advertised trace output. Other API versions and capability schemas are rejected at runtime selection.
Use a path for a complete runtime directory or executable. Use an argument sequence for a custom command; a shell command string is not split into executable and arguments:
Python
runtime = vigo.resolve_runtime("./headless")
with vigo.open("./boston", runtime=runtime) as city:
print(city.runtime.source, city.runtime.product_version)
Selecting a source vigo.mjs file uses system Node. Build its compatible native kernel and CLI together; the maintainer build steps show the required Engine commands.
Platform wheels include a private Node 24.18.0 executable, vigo.mjs, the native kernel, the vigo engine executable, license notices, and a checksum manifest. Supported build targets are macOS 14+ ARM64/x64, Linux ARM64/x64 with glibc 2.39+ (Ubuntu 24.04 builders), and Windows x64. A wheel must match the target OS and CPU. Source installs and universal development wheels need an external runtime. No import-time or query-time downloads occur.
A headless runtime directory can also be passed to runtime=. Keep its files together. To use Studio as the runtime, select a complete macOS .app, extracted Studio distribution, or packaged executable with its resources directory. Bundled/headless child processes inherit only OS paths and locale settings; provider secrets, Node injection options, and foreign kernel overrides are excluded. Explicit external commands retain the caller's environment.
Successful capability checks are retained for up to eight runtime identities. Each lookup checks the command files' and explicitly selected native kernel's metadata, so replacing or rebuilding the runtime triggers a new check. Failed checks are not cached. Returned capability dictionaries are independent copies. Pass a previously resolved RuntimeInfo to reuse that selection explicitly.
Matrix requires advertised resident execution. Supplied traffic for Drive Route/Matrix requires the corresponding advertised capability; traffic is sent in explicit realtime mode. Transfer caps, arrive-by Matrix, journey output, and transit cache controls also require their advertised capabilities. Unsupported combinations raise UnsupportedQuery; Python validates these options before sending each query to the resident stream.
Keep a City open
With the bundled engine, all Route modes (including waypoints and supplied traffic), Matrix, and Reach share resident processes by service date. A City keeps one to four processes according to CPU and resident memory capacity. On Linux, affinity and cgroup CPU quotas limit concurrency, while cgroup memory limits and memory.high cap the host RAM budget. Limits are read when sizing the executor/City; recreate the City after changing resource limits. Swap is not counted as RAM. Changing dates reclaims the least recently used idle process. Active queries finish before eviction or City.close() releases their process.
VIGO Python V1 uses the VIGO V1 engine. All queries use the documented stream protocol. Detailed Python Results use the advertised detailed stream, falling back to trace only on earlier compatible runtimes. Opening several City objects does not share their routing processes.
For repeated work, reuse one City in a context manager. Route answers are recomputed for every call. disable_cache=True on transit Route or Matrix disables street-access and reconstructed walking-path caches while leaving the prepared network resident.
Requests for the same service date share and serialize access to its process. Different dates can use separate processes within the pool limit. submit() moves work to a background thread; it does not create an independent process per request. Await submitted jobs before leaving the City's context.
Reuse processes across dates
With an Engine advertising per-request service dates, one idle process can serve weekday and weekend queries. The pool grows only when requests overlap, within its existing process limit. Older compatible engines retain date-specific processes. Reuse one open City and close it after the study; no process management is required in analysis code.
Timeouts and failures
vigo.open(..., timeout=120) sets the Query timeout in seconds. Waiting for an available resident process and waiting for its response each use that limit. A timed-out resident process is stopped; a later Query can start a fresh one. City.close() waits for active resident queries before closing their processes.
vigo.build(..., timeout=1800) bounds the build command. The City it returns has the default 120-second Query timeout; reopen with a different timeout if needed. Runtime discovery uses a separate 30-second capability-check timeout per candidate. Invalid or unavailable runtimes raise VigoError; Query timeouts raise VigoTimeoutError. These are per-operation limits, not a single end-to-end deadline.
If importing the package exposes none of the documented functions, inspect vigo.__file__ and the active interpreter. A local directory named vigo can shadow the installed package. Install into the intended interpreter and restart the Python session after correcting its import path.
Reduce Python overhead
Install python -m pip install ".[speed]" from this checkout to enable optional orjson decoding directly from resident UTF-8 response bytes, avoiding an intermediate Python string. Without it, Python uses the standard JSON decoder. Request encoding and exports retain strict finite-number checks and existing formatting. Decoding acceleration does not change routing or cache policy. The detailed trace is still requested to preserve Result fields.
Result access copies JSON containers while reusing immutable scalar values. For large matrices, consume result.iter_rows() to avoid copying rows you do not need. CSV export writes stored rows without first copying the full matrix. Use include_journeys=False and include_geometry=False when only travel times are needed; these remain the Matrix defaults. Reuse an open City.
Run python scripts/benchmark-wrapper.py from the checkout to compare the old generic row-copy operation with current Result access and compare standard JSON decoding with the installed decoder. This synthetic benchmark excludes Engine computation, process communication, and City loading. It is not a routing speedup claim.
Measure the complete operation
Record vigo.open() separately from the first Query: most native loading occurs during that Query. Result.timing distinguishes runtime opening and computation where available. For Route, Matrix, and Reach, endToEndMs includes Python request preparation and the runtime response, through payload decoding; Result construction and export occur afterwards. Use an outer wall-clock measurement when including those stages.
Compare first-query and repeated-query durations on the same City, service date, query options, and output detail. Native engineQueryMs excludes parts of access, geometry, communication, and Python work; it is not full-route throughput. Count ready Results, blocked Results, setup failures, and query exceptions separately.
Keep require_transit_ride explicit when comparing results: the current default is False, which allows a direct walk to compete with transit. Set True to require a boarding. Match disable_cache, date, walking budget, coordinates, and output detail before attributing a latency difference to a version change. A sub-millisecond native timetable measurement is distinct from a complete Python Route call.
One City, end to end: build or open, Route (arrive-by and alternatives), Matrix with blocked pairs, journey and leg tables, Reach and GeoJSON, a Scenario comparison, parallel and outcome-keeping batches, and a reproducible study record
Substitute your platform wheel's filename, or use an editable install with VIGO_RUNTIME from a source checkout. If the notebook imports a different environment from your terminal, compare sys.executable and vigo.__file__.
The notebook opens ./boston if it exists. Otherwise it builds it from ./data/MBTA_GTFS.zip and ./data/massachusetts-latest.osm.pbf, downloaded as in the Engine quickstart, and prints each build stage. Edit the paths in its first cell, or set environment variables before starting Jupyter:
Variable
Default
Meaning
VIGO_CITY
./boston
A complete City directory; built here if it does not exist
The script writes journeys.csv, legs.csv, and record.json. For Matrix legs, the original query needs include_journeys=True.
Contribute an example
Clear outputs and execution counts, then run python scripts/check-notebooks.py from python/. The check validates notebook structure, compiles every cell, and confirms the walkthrough still covers its documented steps; it does not execute routing. Before changing the walkthrough, run it against a real City, such as the synthetic fixture described in contributing.
Install the package and runtime using the README. Examples use a complete City; substitute its exact stop IDs, coordinates, and covered service dates. For complete scripts, use Workflows.
A City is one complete directory built from GTFS and OSM. It moves as one unit. vigo.open(city, *, runtime=None, timeout=120.0) returns a City; paths may be strings or path-like objects. timeout controls Query execution in seconds, not total context-manager lifetime.
Python
import vigo
city = vigo.open("./boston")
Use a context manager when you want VIGO to release resident runtime resources immediately:
Python
with vigo.open("./boston") as city:
result = city.route(
"place-pktrm",
"place-dwnxg",
depart_at="08:00",
service_date="2026-09-04",
)
print(result.status, result.duration_minutes)
Coordinates always use [longitude, latitude]:
Python
with vigo.open("./boston") as city:
result = city.route(
[-71.062, 42.356],
[-71.058, 42.349],
mode="walk",
depart_at="08:00",
service_date="2026-09-04",
)
city.path, name, revision_id, built_at, and sources identify the opened model. service_period() returns the first and last dates with scheduled service as datetime.date values, or None; choose service_date inside it. details returns its manifest; capabilities returns the selected runtime's advertised capabilities. city.runtime is the resolved RuntimeInfo. close() releases resident processes; already returned Results remain usable.
Build a City
vigo.build(output, *, gtfs, osm, private_access="public", street_modes="walk,drive", replace=False, runtime=None, timeout=1800.0, progress=None, prepare_dates=()) writes one complete City and returns it opened for queries. gtfs accepts one ZIP path or a sequence of paths; osm accepts one OSM PBF path. Missing input files raise VigoError before the build starts.
Build runs the vigo engine executable that ships with the selected runtime: the same Rust compiler as the engine's vigo build, the command-line compiler and Studio. A runtime whose engine cannot build, such as Engine 0.5, builds through the runtime instead.
Python
with vigo.build(
"./boston",
gtfs=["./mbta.zip"],
osm="./massachusetts.osm.pbf",
) as city:
print(city.name, city.revision_id, city.built_at)
print(city.sources)
Use street_modes="walk" for a walking/transit-only City; the default "walk,drive" also prepares driving data. Choose "walk,bike" or "walk,drive,bike" to prepare bicycle streets. Bike data is optional and requires an engine advertising bicycle City preparation.
prepare_dates takes service dates ("YYYY-MM-DD" or datetime.date) whose timetables are compiled into the City, so their first queries need no preparation. Other dates are prepared on first use.
An existing City at output raises VigoError; pass replace=True only when you intend to replace it. progress=None shows Build stages and elapsed time in notebooks and terminals and stays quiet otherwise; True or False forces it. Stages print as plain lines, or as a tqdm status line when that optional package is installed. See Runtime and loading for separate raw-build, first-query, and reopening timings.
For travelers authorized to use internal roads at their own origin and destination, pass private_access="endpoints" to vigo.build(). The default is "public". The endpoint model includes mapped private access walks within the walking budget; the public middle of a journey and transit transfers cannot use private shortcuts. It assumes endpoint authorization and does not infer ownership or gate hours. The runtime must advertise endpoint access before Build.
timeout here bounds the build command. The returned City uses the default 120-second Query timeout; reopen it with vigo.open(..., timeout=...) when longer Query limits are needed. Runtime discovery and capability checks have their own limits. See Runtime and loading.
Points and time
Input
Example
Meaning
Stop ID
"A" or {"stopId": "A"}
Exact ID in this City; no name lookup or geocoding
Structured stop
{"stop": {"id": "A", "feed": "feed-id"}}
Public Engine stop reference; omit feed for an unambiguous stop
Coordinate pair
[-71.062, 42.356]
Longitude, then latitude
Coordinate mapping
{"coordinate": [-71.062, 42.356]}
Explicit point object
Matrix point set
{"home": [-71.062, 42.356]}
Caller ID mapped to a point
Matrix point sequence
["A", "B"]
Auto-generated IDs such as origin_1 and origin_2
Point mappings use the Engine fields stop, stopId, or coordinate. Use [longitude, latitude] or a coordinate mapping for coordinates. Python does not interpret stop_id, lat, lon, or lng as point aliases.
A numeric pair is one coordinate point, not two Matrix endpoints. A mapping with a point key such as stop, stopId, or coordinate is one point, not an ID-to-point set. Use descriptive, unique caller IDs for Matrix sets. The complete Engine point contract describes stop access semantics.
Time arguments accept HH:MM, datetime.time, or datetime.datetime. A datetime supplies its date unless an explicit service_date overrides it. Datetime timezone information is not converted; seconds are omitted. Pass a clock already expressed in the feed's local service time.
String clocks support service-day hours through 29:59. For example, depart_at="25:15", service_date="2026-09-04" means 01:15 on the following civil day within the September 4 service day. Changing the date to September 5 changes which service calendar is selected. service_date accepts an ISO date string or datetime.date and remains required for all modes unless supplied by a datetime.
Route
Opt-in alternatives use alternatives=3 (0–9), alternative_ranking="pareto" or "ranked", and alternative_slack_minutes=15 (0–120). Ranking and slack require a nonzero alternatives count; omitted values use engine defaults. Alternatives require a runtime advertising canonical detailed alternatives and depart-at transit without waypoints or a departure window. result.value stays the primary journey; result.choices returns independent copies of the engine-selected choices, and result.alternative_search retains search coverage and completion metadata. iter_journeys() and iter_legs() still describe the primary Route; use choices or full JSON to inspect alternatives.
Route and Matrix accept flex={} to include conditional GTFS Flex journeys on a runtime advertising that capability. The mapping uses the Engine option names: durationFactor, durationOffsetSeconds and bookingConfirmed. Booking requirements remain in each detailed transit leg's flexEstimate record (and in quality.flex in the Engine public JSON). VIGO does not book a vehicle, confirm capacity or evaluate booking deadlines. Flex can connect to scheduled transit in either order. Continuous boarding uses explicitly labeled shape-time estimates. Wheelchair Flex requires a strict wheelchair City and an explicitly accessible vehicle. See the Engine Flex guide.
Transit Route and Matrix compare a feasible direct walk by default. Use require_transit_ride=True to require a vehicle boarding, or mode="walk" for a walking journey. horizon_minutes sets the transit search horizon (1–2880 minutes; default 480).
Route includes point-to-point, depart-at, arrive-by, departure-window, walking, driving, and batch use.
Argument
Default
Meaning
origin, destination
Required
Exact stop IDs, coordinate pairs, or point mappings
waypoints
Empty
Intermediate points in the given order
mode
"transit"
"transit", "walk", "drive", or "bike"
depart_at / arrive_by
One required
HH:MM, datetime.time, or datetime.datetime
service_date
Required unless time is a datetime
ISO date string or datetime.date; interpreted on the feed's local service day
max_walk_km
1.2
Each transit access and egress walking budget
departure_window_minutes
0
Depart-at window of plus or minus 0–30 whole minutes
objective
"earliest_arrival"
The supported objective
max_transfers
None
Optional cap, 0–31 changes
require_transit_ride
False
Require at least one vehicle boarding
horizon_minutes
480
Timetable search horizon, 1–2880 minutes
disable_cache
False
Disable transit street-access and walking-path caches
alternatives
0
Additional Route journeys requested, 0–9; opt-in
alternative_ranking
None
Engine default pareto, or ranked
alternative_slack_minutes
None
Engine default 15; arrival slack from 0 to 120 minutes
Choose departure or arrival time, never both. A nonzero departure window applies to depart-at only.
City.run(query) and Scenario.run(query) are the execution primitives. city.route(...), city.matrix(...), and city.reach(...) are convenience constructors with exactly the same behavior. A sequence executes in input order and returns a list; it stops at the first exception. Use an explicit batch loop to retain failures individually.
City.iter_run(queries, workers=1) and Scenario.iter_run(...) accept any iterable and yield complete Results in input order. Set workers=2 to overlap independent queries in resident processes; run(sequence, workers=2) returns those Results as a list. Worker counts must be integers from 1 to 4, and are capped by the City's CPU/memory capacity. A single Query still executes once. The default remains serial.
Parallel iteration consumes at most the effective worker count of queries ahead. It preserves every result field, including journeys and geometry. Exceptions are raised at their input position; no further input is consumed after that exception, but already submitted queries may have run. Closing the iterator cancels queued work and waits for active queries under their normal timeouts. Use contextlib.closing when stopping early. Each resident worker holds its own prepared City, so higher concurrency uses more memory and is not always faster. Older engines without per-request service dates may serialize queries for the same date.
Depart-at minimizes arrival time, then boardings, then walking. Arrive-by maximizes departure time; among journeys leaving at that boundary and arriving by the deadline, it minimizes boardings, then walking, then actual arrival.
Route and Matrix accept max_transfers=0 for at most one boarding, max_transfers=1 for at most two, and so on through 31. Omit the option (or use None) for no additional cap. It applies to both depart_at and arrive_by and all Matrix shapes. A finite cap with ordered transit waypoints is currently unsupported. The runtime must advertise transfer-cap support; Python rejects this option when its capability is absent.
With the bundled engine, Route, Matrix, and Reach reuse resident processes by service date. Route answers themselves are recomputed. See process lifetime for concurrency and resource lifetime.
For transit Route and Matrix measurements, disable_cache=True disables street-access frontier and reconstructed walking-path caches. It keeps the prepared City resident. Python requires the runtime to advertise this control; a missing capability raises UnsupportedQuery. Result.to_json(indent=None) returns compact JSON, including the complete itinerary and geometry.
Use mode="walk", mode="drive", or mode="bike" for street matrices.
The Matrix Result is ready when the computation completes; some or all of its rows may still be blocked. Count row outcomes before aggregating durations. See Matrix results.
origins and destinations accept a point, a mapping of caller IDs to points, or a sequence of points. Matrix shares Route's mode, date, time constraint, walking budget, objective, transfer cap, transit requirement, horizon, and cache control. It defaults to an 08:00 departure when neither time constraint is supplied. Matrix has no waypoints or departure window.
Additional argument
Default
Meaning
walk_speed_kph
4.8
Walking Matrix speed
max_distance_km
None
Optional street distance limit
include_journeys
False
Add timed transit journeys to ready rows
include_geometry
False
Add geometry; requires include_journeys=True
Transit supports both depart_at and arrive_by with one-to-many, many-to-one, or many-to-many endpoint sets, up to 100,000 pairs per request. For a morning school trip, use city.matrix(assigned_homes, {"school": school}, arrive_by="08:30", service_date="2026-07-15"); for dismissal, reverse the endpoint sets and use depart_at="15:00". A common origin and departure share one forward scan; a common destination and arrival deadline share one reverse scan. Other shapes use one scan per unique origin or destination, respectively. Arrive-by rows report the latest departMinutes and the deadline as arriveMinutes; durationMinutes includes waiting after early arrival. Use Route to obtain actual itinerary arrival and legs. This requires a VIGO runtime whose Matrix capabilities include arrive_by. Successive Matrix and transit Route queries on the same City and service date reuse one resident process. Keep the City open while iterating over schools so the network is loaded once. Closing the City releases those processes. Matrix requires a runtime that advertises resident Matrix support; a missing capability raises UnsupportedQuery before execution.
For transit matrices, include_journeys=True adds actual arrival, walking, waiting, ride time, transfers, and timed trip/stop legs to each ready row's journey. Add include_geometry=True to materialize those selected paths with the same renderer as Route, without repeating timetable searches. The runtime must advertise journey support. Equal-objective paths can differ from Route's stable traversal order. The outer arrive-by row still reports the deadline; the nested journey reports actual arrival.
Reach
Reach answers where the modeled network can travel within stated time limits. It does not count people, jobs, schools, or other opportunities.
Reach asks one of two questions. Depart-at Reach takes an origin and depart_at: where can a traveler get to from here? Arrive-by Reach takes a destination and arrive_by: from where can a traveler get here by this deadline? Both take service_date unless the time is a datetime. With neither time, Reach departs at "08:00". It supports scheduled transit with walking and walking-only Reach. Driving Reach is unavailable.
Argument
Default
Meaning
origin
None
Where depart-at trips start: a stop ID, coordinate pair, or point mapping
depart_at
None ("08:00")
Departure time; used with origin
destination
None
Where arrive-by trips end; used with arrive_by instead of an origin
arrive_by
None
Arrival deadline; used with destination
mode
"transit"
"transit", "walk", "drive", or "bike"; street modes require advertised runtime support
surface_sampling
"street"
"street" for reachable network edges, or "cell-center" for coordinate cell centers
include_street_edges
False
Include reached street edges in the surface; adds output size
cutoffs_minutes
(15, 30, 45, 60)
Increasing cutoffs, each 1–240 minutes
max_walk_km
1.2
Transit access and terminal walking budget
walk_speed_kph
4.8
Walking speed, 1–8 kph
extent_radius_km
8
Computation radius, 1–40 km
raster_size
96
Grid side length: 48, 64, 96, 128, 192, 256, 384, 512, or 1024
Each arrive-by value is the number of minutes between the latest departure from that place and the deadline, including any wait after an early arrival. The 30-minute contour encloses the places from which leaving 30 minutes before the deadline still arrives in time. Walking follows each street's permitted direction toward the destination. Transit and walking support arrive-by; a planned-service Scenario applies to transit arrive-by Reach as it does to depart-at Reach. A deadline earlier than the longest cutoff also searches the preceding service day, as arrive-by Route does.
Choose one direction. arrive_by with an origin, a destination without arrive_by, and both depart_at and arrive_by raise InvalidQuery. Both directions send one Engine request: the endpoint with timePreferencedepart_at or arrive_by. The Engine runs Reach in its vigo executable, which the bundled runtime includes. An older runtime whose Reach capabilities lack arrive_by makes supports() report arrive_by_reach, and running raises UnsupportedQuery before execution.
Use the word Accessibility only when a separate analysis combines travel impedance with opportunities.
extent_radius_km bounds the computed area, not just the display. raster_size changes the grid resolution. Keep both fixed, together with the origin or destination, direction, and other assumptions, when comparing a baseline and a Scenario.
Bike and Monte Carlo options
All three query families accept bike=None and monte_carlo=None. These are options mappings using the Engine's camelCase field names. Existing queries do not send either field unless supplied. city.supports(query) checks the selected runtime's capabilities before opening a stream.
With mode="bike", bike accepts profile ("fast", "balanced", or "quiet"), speedKph (5–40) and maxLts (integer 1–4). Omit fields to use Engine defaults. The City must contain bicycle streets. Stress estimates come from OSM, not measured safety; terrain elevation, bike sharing and bikes aboard transit are outside this mode. Bike and Drive Reach use cell-center sampling.
With mode="transit", monte_carlo accepts:
Field
Default
Meaning
startMinutes, endMinutes
Required
Integer minutes, 0 <= start < end <= 1440; end-exclusive
draws
200
Requested draws, integer 1–10000
seed
0
Unsigned 32-bit integer
percentiles
[5, 25, 50, 75, 95]
1–21 strictly increasing integers in 0–100
accessibility
Omitted
Native opportunity layers, cutoffs, decay and optional dual thresholds
Supply service_date and omit depart_at and arrive_by. Monte Carlo cannot combine with waypoints, another departure window, alternatives, Flex, live or traffic state, per-sample journeys or geometry, street-edge output, or a street distance limit. Planned transit Scenarios work with all three Monte Carlo query families. Ordinary planned transit remains available through Reach.
Each departure minute receives equal weight. GTFS timetables, including exact_times=0 frequencies, are fixed departures and need one sample per minute. Draws for planned Scenario frequency services round upward to an equal count per minute. The Engine limits observations to 64 MiB and percentile output to one million values; this does not bound the whole resident process. See the Engine method and accessibility contract.
For a distribution Result, is_distribution is true; status == "ready" means the analysis completed, even if every outcome is unreachable. distribution and value return independent copies of vigo.distribution.v1. percentiles, sampling and accessibility expose its selected metadata. durationsSeconds[p][i] uses seconds, with None for an unreachable quantile and zero for a valid zero-duration result. Unreachable samples participate as positive infinity. Layout and reachableSamples retain all requested cells.
iter_rows() yields percentile-major records containing percentile, cellIndex, rowIndex, columnIndex, durationSeconds and reachableSamples. For Matrix, rows and columns identify origins and destinations; for Reach they identify grid cells. Caller IDs and bounds remain in the native layout. CSV export writes these records incrementally; JSON preserves the full result. The original result is already resident. rows explicitly materializes a tuple. Journey-table and GeoJSON methods reject distributions rather than inventing a representative itinerary. duration_minutes is None and legs is empty.
compare() accepts distributions with identical percentiles, sampling methods and endpoint/grid layouts. It reports changes in minutes and finite/unreachable counts per percentile. These are differences of marginal percentiles, not percentiles of paired changes or a statistical significance test. Mixing a distribution and a single-time result raises ValueError.
Scenario
city.scenario(name, *, services=(), without_routes=(), live=None, traffic=None, expires_at=None) returns an immutable Scenario tied to that City revision. It exposes the same run, route, matrix, reach, supports, and submit methods. Query options such as walking limits remain Query parameters.
Scenario state
Supported Python Queries
No changes
The City's supported Queries
services and/or without_routes
Transit Reach, plus Monte Carlo Route, Matrix and Reach; street-only queries reject planned transit changes
traffic
Drive Route and Matrix, with advertised supplied-traffic capability
live
Unavailable through Python
Combined planned, live, or traffic states
Unsupported
services accepts mappings following the Engine's service change contract. without_routes accepts exact route IDs. traffic is a supplied snapshot; constructing a Scenario does not fetch observations or establish their validity. The runtime validates the snapshot when executing a supported query. Python sends traffic in explicit realtime mode for Drive Route and Matrix; scheduled transit remains separate.
Nested Scenario inputs are copied and frozen. expires_at is an optional datetime checked before execution; expired Scenarios raise VigoError. A Scenario does not alter the City's baseline. Follow the service proposal workflow for a complete example.
Inspect support before running a context-dependent Query:
Python
with vigo.open("./boston") as city:
proposal = city.scenario("Route removed", without_routes=["route-to-remove"])
query = vigo.Reach([-71.062, 42.356], service_date="2026-09-04")
support = proposal.supports(query)
print(support.supported, support.reason, support.available)
Support contains supported, reason, and available. The check reports supported combinations and selected option constraints; it does not fully validate endpoints, service coverage, Scenario expiry, or all runtime inputs. A supported Query can still fail during execution or return a blocked Result.
Result
Every Query returns Result with the same basic shape. Result properties return independent copies; to_json(indent=None) avoids an intermediate full-result copy:
Route Results add duration_minutes and legs. Matrix Results add rows and iter_rows(). Iteration copies only the rows consumed and yields independently mutable dictionaries. The complete Engine response is already in memory; this is not streaming computation. CSV export reads stored rows directly without creating a second matrix. Both Route and Reach support to_geojson(). value exposes the family-specific answer; to_dict() returns the complete Engine payload.
iter_journeys() yields one summary per Route or Matrix row, including blocked rows, without legs or geometry. hasJourney and legCount distinguish omitted itineraries from empty ones. iter_legs(include_geometry=False) yields one record per supplied leg; Matrix queries need include_journeys=True. Both retain native field names and units, add journeyIndex, cityRevisionId, scenario, and resultStatus, and return independent records. Leg records also carry legIndex, row status, and available origin/destination IDs and indices. journeyIndex is local to one Result; add a study ID when combining Results. Reach and comparison Results raise TypeError for these methods.
See Results for fields, export formats, row outcomes, and comparison limits. vigo.compare(before, after) and before.compare(after) return a comparison Result without rerunning the Queries. Matrix comparisons require originId and destinationId on every row and match those IDs rather than row positions. The caller must align the study inputs; comparison does not validate all Query assumptions.
result.export_tables(directory, include_geometry=False) writes journeys.csv, legs.csv and record.json. It discovers optional columns in one pass and writes them in a second without materializing an extra table. Nested fields are JSON encoded; missing values are blank. Empty tables retain their respective journey and leg headers. Serialization finishes before existing export files are replaced, so serialization errors leave an earlier export intact. Use a separate directory per Result when concurrent readers need a consistent multi-file snapshot.
Result.status is only ready or blocked. A blocked Result is a valid computation with no usable journey or surface. Cancellation and execution failures belong to Job.status or exceptions, not Result status.
Job
city.submit(query) or scenario.submit(query) returns a Job. Pass one Query or a sequence; wait() returns one Result or a list respectively. Background submission keeps the calling Python thread available; it does not promise parallel queries for the same service date.
Keep the City open until its submitted work finishes:
Python
with vigo.open("./boston") as city:
query = vigo.Matrix(
{"home": [-71.062, 42.356]}, {"school": [-71.058, 42.349]},
depart_at="08:00", service_date="2026-09-04",
)
job = city.submit(query)
result = job.wait()
Job.status is queued, running, ready, cancelled, or error. A ready job may contain a blocked Result.
Job.cancel() cancels queued work only. A running Query finishes normally. Job.wait(timeout=...) bounds the wait for the background result; it does not cancel the Query. See Runtime and loading for process reuse and timing boundaries.
Errors
Exception
Meaning
InvalidQuery
Python-side query validation failed; also a ValueError
UnsupportedQuery
A combination or option is unsupported; .support contains the reason and alternatives
VigoTimeoutError
A runtime operation exceeded its timeout; also a TimeoutError
VigoError
Base class for VIGO failures, including runtime validation, incomplete Cities, execution failures, and the subclasses above
Python constructor misuse can also raise ordinary TypeError or ValueError; export can raise filesystem errors. Job.wait() re-raises the background exception. Its own wait timeout raises TimeoutError without cancelling the Query. No exception is converted into a blocked Result.
Runtime information
vigo.resolve_runtime(runtime=None, *, verify=True) returns RuntimeInfo with product_version, api_version, source, path, command, and capabilities. Use the default verification for Query execution. verify=False only resolves a candidate command and returns no verified capabilities; it is not a compatibility check.
A runtime argument can be a RuntimeInfo, a path to a supported runtime layout or executable, or a sequence of command arguments. See Runtime and loading for selection, compatibility, and platform requirements.
The Python wrapper negotiates the resident CLI’s detailed stream format when advertised. It preserves the same complete Result while avoiding a second public projection. Earlier compatible 0.5 runtimes continue to use --diagnostics=trace.
Concurrent jobs and resource limits
City.submit and Scenario.submit share a process-wide limit of 32 running or pending jobs. When capacity is full, submission raises VigoError; retry after work finishes. A canceled queued job keeps its capacity slot until the executor dequeues it, so repeated submit/cancel cannot accumulate an unbounded queue. Canceling a running job remains unsupported.
A resident stream serializes requests for its service date. Different dates can use the bounded City process pool. The query timeout covers writing to the engine pipe and waiting for its response; a stalled pipe terminates the child and releases its buffers. Waiting for a free stream has its own timeout using the City's timeout value.
The Python stream accepts requests up to 8 MiB of UTF-8 JSON and responses up to 64 MiB. Oversized requests raise VigoError before dispatch; oversized responses discard the worker. Split larger matrices or omit optional journey geometry. Response queues and stderr retention are bounded, and idle reader/writer threads release completed response/request buffers.
Start with the failing layer: importing Python, selecting a runtime, opening a City, executing a Query, or interpreting a completed Result. Keep the original error and request before changing inputs.
If the import has no documented functions, a local vigo.py or directory named vigo may shadow the installed package. Use python -m pip with the intended interpreter, then restart the Python or notebook session. A notebook kernel can use a different interpreter from the terminal.
Explicit runtime=, VIGO_RUNTIME, and VIGO_APP take precedence over a bundled engine. An invalid explicit choice fails instead of trying another engine. Check old environment settings when a platform wheel appears to select the wrong runtime. See runtime selection for the full order.
Symptom
Check and next action
No compatible VIGO runtime
Confirm that the install includes a platform runtime, or select a complete external runtime. Source installs require an external Engine.
Native library cannot load
Check OS, CPU, and platform requirements; keep the Node executable, bundle, and native kernel from the same runtime together.
External .mjs cannot run
A source bundle needs compatible system Node and its native kernel. Prefer a complete headless runtime directory or follow Engine's source-build guide.
Studio installation cannot run as a runtime
Select a complete app or extracted distribution, including its resources directory.
API compatibility succeeds but a feature is unsupported
API compatibility and optional Query capabilities are separate. Inspect city.supports(query) and the runtime's advertised capabilities.
Check the City
vigo.open() needs a complete City directory, not a raw GTFS ZIP or one SQLite file. Move or restore the whole build. Its initial checks cover the manifest and required entry files; later native loading can still detect missing or corrupt data.
If the build destination already exists, use a new directory or intentionally pass replace=True. If inputs changed, build a new revision. An incomplete required street model needs restoration or rebuilding; increasing a query timeout cannot repair it.
Distinguish unsupported from blocked
UnsupportedQuery means a requested combination cannot run. Inspect error.support.reason and error.support.available. Planned service changes support Reach; supplied traffic supports Drive Route/Matrix with the advertised capability; Python live transit is unsupported. supports() checks combinations, not every endpoint, date, or data-dependent constraint.
InvalidQuery covers Python-side request checks. Additional invalid requests can fail in Engine and surface as VigoError; catch that base class at a batch boundary when every query failure must be retained. See the batch workflow.
A blocked journey is a completed model answer. Check, in this order:
The exact service date and feed coverage, including the correct service day for an after-midnight time.
Exact stop IDs or [longitude, latitude] coordinate order and City coverage.
Departure versus arrival semantics, horizon, walking budget, and transfer cap.
Whether a vehicle boarding is required. The default is require_transit_ride=False; a feasible direct walk can win.
For Matrix, inspect each row even when the Result itself is ready. Do not retry blocked queries as if the runtime crashed. Only relax constraints when that matches the intended question.
Diagnose time and comparison surprises
Symptom
Explanation
First query is slower than repeats
vigo.open() does not prepare the complete network; the first query pays runtime and mode preparation costs.
disable_cache=True still gives fast repeats
It disables specific transit street caches, while keeping the network and resident process prepared.
A query times out
Use vigo.open(..., timeout=...) for query limits. Build timeout and Job.wait(timeout=...) control different operations.
job.wait() times out but work continues
The wait timed out; it did not cancel the running Query. cancel() only cancels queued work.
Arrive-by Matrix duration is longer than the journey
The row measures to the deadline; the nested journey can arrive earlier.
Reach comparisons reject two maps
Their computation grids must have identical bounds and dimensions. Match origin or destination, extent, and raster size.
A comparison reports fewer pairs than expected
Matrix comparison includes matched IDs only. Check unique IDs, stable endpoint meanings, and pair coverage.
Keep runtime preparation, computation, Python call duration, and export time separate. The runtime guide describes these boundaries.
Report a reproducible issue
Include the wrapper and Engine versions, OS/CPU, runtime selection method, smallest failing Python request, exact exception or Result status, and whether the failure occurs on the first or a repeated query. Include a shareable synthetic fixture when possible. Describe City inputs and build options without uploading licensed feeds, credentials, private paths, or private study results.
Report Python packaging, argument conversion, process lifetime, and Python exports in VIGO Python issues. Shared transport computation belongs in VIGO Engine issues.
Find the stage that failed: installation, City build or open, request validation, computation, or interpretation. Keep the failing command and its output before changing inputs. For a version change, follow Upgrade and rollback first.
Check the runtime and City
Shell
vigo --version
vigo capabilities --pretty
vigo info --city ./boston --pretty
vigo-build help route
capabilities describes the running binary and info the City. Neither proves that a date has service or that a route exists. Source changes take effect only after rebuilding.
Build or open fails
Symptom
Check
Next step
Node version error
node --version
Install Node.js 24.18 or newer
Executable cannot run
Operating system, CPU and file permissions
Use the archive for your platform, or build from source on it
Native build or load failure
The pinned Rust toolchain and linker
Build on the machine type that will run VIGO
Output City already exists
Is this a new revision or a replacement?
Prefer a new directory; use --replace only to replace
--city or VIGO_CITY is required
The command line
Give a City path, also for compare
Expected a prepared vigo.city.v1 City
The --city path
Point to the compiler's complete output, which contains network.json
Missing or stale access or index file
Were files copied from different builds?
Recopy the whole City or rebuild it
Unexpected SQLite WAL
Did the build finish?
Finish the build and copy a consistent City
Driving preparation fails with counts
Network size
Raise VIGO_DRIVE_ACCELERATOR_MAX_NODES or _EDGES, or omit driving
First query slower than later ones
Timetable or access preparation
Use --prepare-date, and keep a process resident
City absent from Studio's library
Which tool built it?
Studio imports its own projects
A request is rejected
Symptom
Check
Invalid or uncovered date
Use an exact local YYYY-MM-DD; inspect calendar.txt and calendar_dates.txt
A flag seems to ignore the JSON
Flags override request fields; remove one of them
Point cannot be resolved
Use an exact, case-sensitive stop ID or [longitude, latitude]; names are not geocoded
Unknown point field
Write points as {"coordinate": [...]} or {"stopId": "..."}, with optional id and name; the engine rejects the compiler's older {"id", "point"} matrix form
Unknown route option
Check the field name in the engine reference; Studio's internal fields are not accepted
walkSpeedKph applies to …
Transit Route and Matrix use the City's walking policy; send walkSpeedKph only to Walk, Drive, Bike or Reach
The engine allows 65,536 pairs in 8 MiB, the compiler 100,000 in 16 MiB
A piped request seems to wait
--request - waits for standard input to close
Invalid requests exit with status 2 and explain the failure on standard error. A failed run leaves an old --output file unchanged; do not mistake it for a fresh Result.
When a Route returns no journey
Confirm the City revision, date, time and mode. GTFS 25:10 belongs to the previous calendar day's service date.
Check whether transit is required. A direct walk competes by default; requireTransitRide: true requires a boarding.
Check each end's walking access. A stop close in a straight line may lack a street path; outside_selected_budget only suggests a wider check.
Check the horizon, transfer cap and timetable. The horizon bounds boarding and alighting, not the trip.
If a changed constraint is justified, save it as a new request and keep the blocked Result.
Never silently raise walking limits, substitute dates, or turn blocked durations into zero. See When no journey is found.
HTTP service
Symptom
Next step
401
Send exactly one Authorization: Bearer header matching VIGO_API_TOKEN
403 without a token
Use a loopback Host, or set a token for proxies and remote clients
503
Read /readyz; reduce concurrent work or add measured capacity; retry with backoff
504
Read the worker log; reduce matrix size, geometry or raster detail before raising deadlines
A browser request fails
The service does not implement CORS; serve your app from the same origin or a proxy
High memory
City size, worker count, threads, request bodies and detailed results all add up; see Resource limits
Live reports and routes disagree
Observation
Explanation
A vehicle is visible but its trip is unavailable to Route
Vehicle Positions create no timetable service
Realtime times equal the schedule
Unreported trips keep scheduled times; read the counts and status
A saved snapshot stops applying
Freshness is checked against the clock; a saved observation expires
An alert describes a disruption but the route is unchanged
Only NO_SERVICE closes service, and only in the engine
Playback shows a vehicle that is not reporting
Playback is labeled Estimated and interpolates the timetable
Results or comparisons look unexpected
A Matrix ok can contain null cells, and arrive-by durations include waiting at the destination. Matrix comparison needs identical ordered endpoints, and Reach comparison identical grids; means exclude unreachable cells. A path that appears to jump to a platform is a connector or assumed station link: read its quality. When comparing speed, keep the City, request, output detail, cache settings, worker count and threads identical, and never compare a cached repeat with a cold start.
Concurrent stream queries
The compiler's vigo-build stream --workers 2 runs up to four resident workers, capped by CPU and memory (two CPUs and 6 GiB per worker), and keeps results in input order. Each worker loads its own City. RAYON_NUM_THREADS sets threads within each process, separately from the number of concurrent requests. The engine's vigo stream answers one request at a time; run several processes for parallel work.
Report a reproducible issue
Include the VIGO version, operating system and CPU, the failing command, the request, the City inspection summary, standard error, and the full Result if one was returned. Say what you expected and whether it reproduces with the same inputs, and share a small redistributable fixture when you can. Review paths, coordinates, credentials and data licenses before attaching files to a public issue, and use the security policy for vulnerabilities. Keep a reproducible run lists what to keep.
VIGO 1.0.0 builds reusable transport Cities from GTFS and OpenStreetMap and answers Route, Matrix and Reach queries through the native engine, command line, Studio and Python. API 1.0, City format 1 and Result schema 1 retain their existing meanings. Published Cities remain readable without rebuilding.
Building Cities
The engine builds Cities itself: vigo build and vigo build-scenarios take the compiler's options, print the same progress and manifests, and need no Node or npm. The GTFS and OpenStreetMap compilers moved from JavaScript into Rust. The compiler's build and build-scenarios run the engine's commands, Python's vigo.build() runs the engine executable directly, and Studio's imports run the same Rust compiler, and the Cities it writes are the ones the JavaScript compiler wrote: every table, metadata value, snapshot and hierarchy matched on the test fixtures, Boston and Washington, DC, and the published 0.5.0 reader opens them. Only the bytesSaved compaction diagnostic in network.json can be a few MB higher. On one Apple M2 with the same local inputs, Boston built in 48 s instead of 138 s, Boston with wheelchair routing in 42 s instead of 75 s, and Washington, DC in 100 s instead of 165 s.
Routing and preparation
Studio groups services with the same ordered platforms and access paths even when their GTFS shapes differ by small coordinate rounding. Each departure retains its own line, times and geometry. Express-to-local journeys can keep the express to a later shared platform when the same onward train remains catchable, with unchanged endpoint times, boardings and walking. Pickup, drop-off, transfer rules, published minimum connection times and the requested buffer remain enforced at the later platform.
Transit Route, Matrix and Reach use one exact connection scan for every City. Frequency templates without exact times depart every headway from each window's start. Stop-level transfer rules apply with GTFS specificity, a platform's own rule overriding its station's; route- and trip-scoped selectors are not applied.
Bicycle Route, Matrix and Reach use a turn-aware customizable contraction hierarchy. Shared rank sweeps evaluate departure and arrival grids, retaining each endpoint's private-road permissions. One relaxed sweep from the fixed endpoint bounds how far each grid cell searches for walking access; cells the path certificate cannot settle repeat with every walking candidate. Supported timed roads and turns are checked at entry. A cell or route whose only access is timed is bounded by a legal earliest arrival or latest departure, or proved unreachable, so it no longer widens every cell's search. The selected preference profile ranks paths while the result reports actual cycling, walking and waiting time.
Existing Cities remain readable. Local source-checked graph indexes can reuse the hierarchy when a worker opens a City. They keep the upward hierarchy and shortcut witnesses; opening rebuilds the remaining columns and weights exactly. The indexes are derived from the original City and store no route or surface answers. Studio includes Bike in Reach for both departure and arrival isochrones.
Scheduled and realtime journeys, bicycle preferences, driving traffic, wheelchair profiles, planned services and Monte Carlo analyses use the shared native computation layer. Planned services preserve arrival, dwell and departure times across adjacent service days. Wheelchair preparation connects accessible platforms without declared entrances and retains explicitly accessible ramps whose incline gives a direction without a numeric grade. Rebuild a City to apply these preparation corrections to existing inputs.
The bicycle hierarchy enforces the distance limit together with timing and access rules. Transit Matrix scans index endpoints by stop, scenario exclusions use one timetable pass, and Reach drops walking labels whose continuations cannot improve the surface.
Studio address search filters suggestions to the selected City’s prepared street extent, with timetable coverage as a fallback. Switching Cities or replacing their data invalidates the regional lookup. Missing coverage never triggers a global search.
Runtime and reproducibility
The engine supplies Studio's complete query fingerprint, including the City, scenario, waypoints, alternative selectors and applicable realtime snapshot. Street publication refreshes Studio's provenance independently of the timetable. Native responses enforce their byte limit for complete and fragmented lines, and busy City slots return a capacity error when the resident limit is reached.
Replacement processes prepare walking, bicycle, driving or timetable state directly. Studio prepares the mode selected in Route or Reach while the City opens, including the result-rendering binding. Reach and Matrix requests stay on a worker whose corresponding network is loaded. Replacement workers retain only mode and timetable selectors, never a user journey or surface. The public gateway rotates rate-limit buckets once per minute. Interrupted City builds wait for compilers to close before removing unpublished output.
A single-City stream or serve worker prepares in the background as soon as it opens: today's timetable, the pedestrian hierarchy, the driving network and the bicycle hierarchy. A first request waits only for the part it needs that is still preparing. Prepared modes stay resident; VIGO_PREPARE limits preparation to some modes, or none defers each to its first request. Studio's workers open with only the timetable, because Studio prepares the mode a visitor selects; an explicit VIGO_PREPARE still applies.
Dependencies
The release updates the npm and Rust dependency sets together. The maintained GroveDB bincode codec replaces the unmaintained upstream crate, using the existing fixed-width encoding for prepared access profiles.
Distribution
Engine, CLI, Studio and Python bundles are built from the same source commit for Linux x64/arm64, macOS arm64 and Windows x64. Release publication requires the platform checks, isolated Python wheel integration, City portability, container checks and artifact checksums. The Python package is version 1.0.0.
This record lists the checks every VIGO release passes and what they establish. It ships in the engine archive as AUDIT.md. Test results for a particular build are in its release workflow run; the archive's manifest.json names the source commit they ran on.
What a release runs
The release workflow builds the engine, the compiler, Studio and the Python wheels from one tagged commit, on Linux x64 and ARM64, macOS ARM64 and Windows x64, and runs on each platform:
Check
What it covers
npm run check:release
Public-source and release-file rules, the documentation, the native kernels, Studio, security, the routing runtime and the transport atlas
npm run check:rust-workspace
Model and schema tests, algorithm tests, strict Clippy and the routing crate's dependency boundary
cargo test and cargo clippy -D warnings (standalone features)
Engine unit tests and lints
npm run check:corpus
A frozen corpus of routing cases with expected answers
npm run check:standalone
The engine on public synthetic Cities: Route, Matrix, Reach, scenarios, Flex, realtime, wheelchair, bicycle, HTTP lifecycle, Monte Carlo, documentation examples, and the permanent prepared-data gate
Routing parity. The engine and the compiler return the same public Results across both time directions, stop and coordinate endpoints, transfer caps, parent stations, sibling platforms, direct-walk policy, calendar exceptions, matrices, scenario surfaces, realtime fallback and source geometry.
Independent algorithms. Separate graph and timetable implementations, which never supply production answers, check walking and driving shortest paths, earliest arrival and latest departure, every stop pair at each boarding boundary, transfer rules and forbidden transfers. See Checking routing accuracy.
Inputs and outputs. Conflicting clocks, malformed fields, unknown or irrelevant options, invalid grids, unsafe index members and oversized inputs are rejected. Saved output replaces its target atomically.
HTTP lifecycle. Bounded connections, headers, bodies, queue and responses; read deadlines that small chunks cannot extend; slow bodies outside the worker; deadlines that stop and replace the worker, even when its input pipe is full; recovery after an idle crash. POSIX stop and crash injection is skipped on Windows.
Realtime. Freshness, trip identity, duplicates, cancellations, skipped calls, NO_DATA, invalid predictions, expiry, past-prefix removal and alerts, each with its diagnostics.
Traffic. Cache identity follows the actual edge weights, even when a caller reuses its snapshot key.
Documentation. Every request on the engine reference runs against the engine; response excerpts, flags, request fields and environment variables are checked against the executable and its source.
What passing does not establish
The checks use small public synthetic inputs. Passing them supports the tested model and interfaces. It does not establish:
real-world arrival accuracy, completeness of a source feed, or physical station accessibility;
fare eligibility beyond the published GTFS rules;
throughput, latency or memory on a particular City and machine;
behavior on platforms the release did not test.
Agreement between the engine and the compiler does not by itself prove their shared kernels correct; the independent checks address that, within their synthetic fixtures.
Reproduce locally
From a source checkout with the documented toolchain:
Shell
npm ci
npm run build:cli-runtime
npm run build:standalone
npm run check:standalone
npm run package:standalone
python3 test/check-standalone-package.py
Node and Python are development tools here; neither ships in the engine archive. A package built from uncommitted source is marked dirty: true in its manifest and is a development build.
Integrate VIGO through its public interfaces: the engine command line and HTTP API, the compiler, or VIGO Python. Studio's internal API and the native operations serve other purposes and are not stable integration boundaries.
A passing public synthetic fixture verifies the behavior it exercises. Use the test results of the exact build and platform when assessing an installation; an old test count is not a current release check.
Build on a small machine
npm run build:standalone and npm run build:rust-routing-kernel (and the scripts that call them) select low-memory Cargo settings when the detected physical or container memory is 4 GiB or less: one job, 16 code-generation units, no incremental compilation, no debug information and no LTO. When only available memory is low, they limit compilation to one job and keep the normal release profile. Unknown limits are ignored, and the selection is logged.
VIGO_BUILD_MEMORY=low forces low-memory settings and VIGO_BUILD_MEMORY=full keeps the release profile; the default is auto. Low-memory builds can run differently, so use full on a well-provisioned host for comparable benchmarks. A direct cargo build bypasses the selection. Changing modes rebuilds affected Cargo artifacts. node --test test/check-build-memory.mjs tests the detection. These settings reduce compiler memory; they do not guarantee a fit, and they do not change VIGO's runtime limits.
Maintain the documentation
Markdown is the source of the offline guide, docs/guide.html, which the engine serves at /, Studio opens under Settings → Documentation, and the engine archive includes.
File
Role
docs/guide.md
The user guide: overview, install, quickstart, concepts, task guides, Studio, deployment, limits, troubleshooting, glossary
docs/guides/rust-standalone.md
The engine reference; also the engine archive's README.md. Its json query=…, response=…, output=… and decoder=… blocks are executed by npm run check:standalone-docs
docs/guides/cli-only.md
The compiler guide; also the compiler archive's README.md
docs/guides/*.md
Monte Carlo, resource limits and the public route planner
docs/reference/*.md
Public results, methodology, walking evidence, the prepared-data contract and the verification record
Generated from the Rust types by npm run docs:standalone; never edit by hand
docs/navigation.json
Pages, groups and order: each page renders a file, one section of a file, or several sections
Run npm run docs:build after changing a page, then npm run check:docs and npm run check:standalone-docs. The checks verify links and anchors, generated-file freshness, executable examples, and that every engine command-line flag, request field and environment variable is documented. Add to these files rather than creating a page per topic. Version history is in the changelog.
Studio and the CLI share routing code; neither routes through the other. The public model is City → optional Scenario → Query → Result.
Studio renderer vigo command / Python wrapper
│ │
Electron preload → utility process CLI validation and output
│ │
└──────── shared City / query modules ─────┘
│
Rust timetable + street kernels
│
Result and diagnostics
Browser development uses loopback HTTP in place of the desktop memory channel, with the same handlers. The Studio HTTP API is internal; the stable programmatic boundaries are the engine and the compiler.
Build and open
Build validates GTFS and OSM in a staging directory, creates timetable and street stores, prepares required native indexes, and publishes a complete City atomically. A failed build preserves the previous City. SQLite owns durable source and build data; production path search does not query SQLite at each routing step.
Store admission accepts current formats. Obsolete source stores require a rebuild; merge, compaction, and index preparation cannot upgrade them in place. Compaction happens before transfer topology and access preparation, and retires indexes tied to the previous database generation.
Open validates identity and loads the data a query needs. Active-service timetable snapshots and directed station-access contexts can be retained with the City. Derived caches can be regenerated from compiled data; missing required street indexes require restoration or a source rebuild. Ride geometry is loaded and aligned only for selected trips. See performance for cold, reopened, and resident timing boundaries.
New City builds persist the Rust drive hierarchy and both free-flow metrics. Drive startup maps these artifacts; it does not rebuild the hierarchy. The CLI prepares only the requested mode, and Matrix streams prepare each mode on its first use. Missing required drive artifacts cause a rebuild/restore error. Older Cities marked with an ephemeral drive hierarchy retain their existing behavior until rebuilt from source.
Computation ownership
In this guide, CCH means Customizable Contraction Hierarchies, the prepared street index used to accelerate path queries. CSA means Connection Scan Algorithm, which scans timetable connections in time order. A frontier keeps competing feasible options, such as earlier arrival versus less walking. A witness is the path or journey supporting a computed cost. Materialization assembles its stops, legs, and geometry into the returned Result. Admission validates whether input data can be used; prewarming prepares it before a query, and resident state stays in memory for reuse.
Rust reads, indexes, aligns, and clips selected GTFS shapes in one native cache. A reusable 8 KiB output buffer holds the sampled leg; JavaScript copies only its displayed points into itinerary objects. Both runtimes default to a 64 MiB shape-cache budget and at most 1,024 shapes. JavaScript handles store lifetime, orchestration, and public interfaces.
Operation
Implementation boundary
Transit Route
Native forward or reverse timetable search, directed street access, then selected-journey reconstruction
Walk / Drive Route
Native directed street search, CCH acceleration, and path geometry
Bike Route / Matrix
Turn-aware bicycle CCH, shared rank sweeps and verified path geometry
Transit Matrix
Shared native forward scans per origin or reverse scans per destination; optional selected witnesses
Reach
Native timetable propagation and walk, drive, and bicycle surfaces; JavaScript contours and Result shaping
Scenario
JavaScript validation and compilation of supported changes; native routing applies the compiled overlay
JavaScript owns request validation, identity resolution, orchestration, cancellation, and presentation. Rust owns active-timetable departure/transfer indexing, GTFS-Realtime overlays (trip updates, Service Alerts and timetable reconstruction, shared with the standalone engine), station path compilation, graph search, and timetable propagation; see the kernel implementation map. Source-feature omissions remain explicit in results; shared implementation alone does not prove correctness. Independent checks validate the declared model.
Crates
All Rust code builds from the root Cargo workspace.
Crate
Responsibility
vigo-route
Timetable search: forward, reverse, Matrix and alternatives; scenario and realtime views; transfer and station operators; reusable scratch
vigo-format
Reading service timetables, validating memory-mapped snapshots and writing the portable City layout
vigo-prepare
Compiling GTFS stop_times into connections, including exact frequency expansion
vigo-gtfs
GTFS-Realtime decoding
vigo-traffic
Traffic input, including NDW DATEX II v3
vigo-model
The public request and Result types, and the generated OpenAPI document
vigo-runtime
Street, access and driving kernels, the standalone executable, and the Node adapter
The routing crate has no Node dependency, filesystem access, environment lookups, thread creation or untyped JSON. The executable and the Node addon share these implementations; Node records are generated from the Rust types. ZIP and CSV admission, source scoping, calendars, City publication and application orchestration remain in JavaScript.
npm run check:rust-workspace runs the model and schema tests, algorithm tests, strict Clippy and the dependency boundary. npm run check:compiler compares the connection compiler with retained normalized tables from the earlier reference compiler (test/fixtures/gtfs-connections-052.json), 80 seeded feeds, malformed-input rollback, City build equivalence, the frozen routing corpus and the permanent reader/writer gate. npm run profile:compiler -- --runs 3 --output output/compiler-profile.json profiles GTFS import on a synthetic or supplied feed; keep private inputs and measurements outside the repository.
Module boundaries
Area
Ownership
src/server/gtfs/
Store schema, admission and identity; calendars, stop-access indexing and coordinate-access profile lifecycle; walking policy and plans; result assembly, realtime timetables, and network previews. The coordinator retains store lifecycle and native query orchestration.
src/server/runtime/route-worker-pool.mjs
Routing-worker leases, cancellation, prewarming, and memory pressure. The API entry point supplies the worker URL so source and packaged execution resolve the same worker.
src/map/
Network, journey, vehicle, and Reach feature builders; layer definitions, paint, and basemaps. VigoMap.tsx owns React effects, map events, and selection.
src/state/
Studio state. Shell, City, service clock, Network, Route and Analyze stores hold state and actions; selectors derive shared values; runtime.tsx runs requests, leases and polling without rendering UI.
src/components/studio/
Sidebar, City library and source controls, and route surface. Workspace panels read their own store slices; App.tsx arranges the shell.
These modules do not import their coordinating entry points. Public GTFS exports remain available through national-gtfs-store.mjs. Calendar caches still belong to each admitted store. Walking-anchor profiles remain private to the walking-plan module and are cleared when the coordinator invalidates their store. Realtime query symbols and weak timetable caches belong to the realtime module; decoded street-edge bundles retain one weak cache in the Reach feature module.
Stop projections use weak references to both the timetable and street record, retaining only the current access profile for each pair. Changing a profile replaces its projection; returning to an earlier profile recomputes it. Worker transfer failures reject the affected request and release the queue slot while preserving the worker for subsequent requests.
The remaining large files have tighter state coupling: GTFS import and query orchestration share store identity and cache lifetime; national-osm-store.mjs couples graph admission and native preparation; the Rust coordinate and timetable kernels share search workspaces and snapshot layouts. Split those along explicit state ownership boundaries, with routing, cancellation, and persistence checks, rather than moving arbitrary line ranges. Vendor code is maintained separately.
Studio uses a native City overview reader and native Reach boundaries. Per-route timetable analysis, vehicle interpolation and local search remain JavaScript.
public/main.mjs owns windows, menus, dialogs, and the vigo://studio resource scheme. public/preload.cjs exposes a small desktop bridge to an isolated renderer without Node access. Engine runs in a utility process; packaged Studio has no TCP listener. Packaging copies the shared public/ distribution once.
Desktop build tooling overrides @electron/asar's glob and minimatch with patched versions for cancelled traversal and pattern amplification. These are development-only dependencies. check:studio verifies archive contents, exclusions and unpack patterns through the packaging tool's resolved ASAR library. Remove the overrides when ASAR's dependency ranges include the patched versions.
Network shares one route/station selection across its tabs, map, and line diagram. Known feed namespaces resolve against the City timetable; ambiguous bare IDs cannot select an agency. Station scope includes platforms, while a platform keeps its own events. Observation refreshes do not move the map.
Surface
Owner
Trip times and patterns
AgencyTripTimetable, NetworkTimetable
Map and line
VigoMap, AgencyRouteLine
Station board and evidence
StopArrivalBoard, AgencyEvidence
Network overview and observation exports
AgencyPanel, observationExport.mjs
Route/vehicle timing
src/agency/routeOperations.mjs
The Network service owns observation polling, timetable inspection, route and vehicle views, station boards and observation exports. Connection state lives in network.sqlite; explicit disconnects persist across restarts. Vehicle matching preserves service dates, including previous-day overnight trips.
Studio Reach retains packed reached-edge data, lazily reuses decoded coordinates across cutoffs, and serializes large map-source replacement. Changing a displayed cutoff does not require rebuilding the street graph. Runtime fixtures check map updates and rapid cutoff changes.
Storage and verification
The complete City directory is portable; individual databases and native files are implementation details. Studio library settings, drafts and feed connections are separate application state.
Use the contribution guide to choose checks. Routing fixtures verify feasibility and witnesses; desktop runtime fixtures verify interaction. Network checks include connection persistence, source replacement, access control, in-flight invalidation and preservation of legacy data. No fixture or build proves field accuracy.
Itinerary geometry and identifiers
Rust reads selected shape rows directly from SQLite into numeric buffers and builds a distance prefix and a hierarchy of bounds in unit-sphere coordinates. The bounds skip sections that cannot contain a nearer candidate, including across the antimeridian and near the poles. The matcher still retains up to 16 points within 1 km per stop, evaluates the original haversine distances and tie rules, and aligns the complete trip monotonically to disambiguate loops. JavaScript samples the selected range from a compact coordinate column using the existing distinct-point stride and 512-point limit. Shapes with consecutive duplicates also carry an index of distinct source positions. Range clipping uses two binary searches and visits only sampled positions; shapes without duplicates use source positions directly. Short ranges use a single bounded pass. Final duplicate cleanup and distance calculation share one pass over the newly materialized coordinates. Prepared shapes remain subject to the store's entry and byte budgets, including the coordinate column, distinct-position index, spatial index, and bounded native candidate cache. A read-only source connection has a 2 MiB SQLite page-cache budget and closes when its routing store is disposed or invalidated. No itinerary answer cache is introduced.
Plan identifiers retain the existing 64-bit hash and Unicode code-point semantics. Rust performs that arithmetic; identifiers are selection keys, not security digests. npm run check:accuracy includes differential tests against the previous JavaScript shape matcher and identifier arithmetic.
Local OSM uses cartographic features retained in the City's SQLite street store. It does not query or load the pedestrian or driving accelerator. The /local-basemap endpoint returns roads and water in one GeoJSON collection. The former routing-edge renderer and its /local-streets endpoint have been removed.
Import and geometry
The importer first selects water multipolygon members, then includes their node references in the street import's existing selection and geometry passes. Untagged members are joined in either direction, and inner rings remain island holes. These temporary relation tables are dropped before publication. Map tables survive routing-store compaction and travel with the SQLite artifact; no external source file or sidecar is required at runtime.
Only motorway, trunk, primary, secondary, and tertiary roads are drawn. Links enter at zoom 12; lesser road classes never enter the basemap. The routing graph still retains its original walk/drive eligibility rules. Rivers, canals, water polygons, and directed coastlines are independent of routing permissions.
Geometry is rounded to six decimal places and simplified at three detail levels during import. Identical geometries share one stored row across levels; invisible levels are omitted. Line pieces contain at most 128 input vertices, and persisted geometry contains at most 8,000 vertices per feature. Water relations exceeding 200,000 input vertices, containing unsupported nested geometric members, or missing complete rings are skipped and counted in metadata. Oversized source ways are also skipped for display. Display geometry is never used for routing.
Coastal water follows OSM's land-left, sea-right direction. The query clips and joins shorelines, closes complete chains along the viewport boundary, and retains coastal islands as holes. A nearby shoreline supplies the side for views wholly on land or sea. Interior breaks suppress ocean fill rather than inventing a coast. The PBF header bounds, or the retained feature extent when the header omits bounds, limit coverage. This does not reconstruct missing ocean geography beyond a regional extract.
Runtime bounds
An SQLite R-tree selects the requested area, detail level, feature class, and zoom before loading geometry. Coastline searches do not scan unrelated roads.
Each request opens a read-only connection with a 4 MiB page-cache target and no memory mapping; it closes the connection after querying. This is a SQLite cache setting, not a total process-memory guarantee.
Responses contain at most 4,500 features and 80,000 vertices. Water has a separate half-budget so it cannot displace all roads. SQL sorts feature metadata and fetches geometry only after it fits the response budget.
Coastline assembly separately caps both candidate input and clipped geometry at 4,096 pieces and 80,000 vertices. Boundary joins use sorted crossings instead of scanning all crossings repeatedly. Island assignment has a containment-work budget; exceeding either geometry or work limits keeps bounded shoreline outlines and omits ocean fill.
The browser requests 18% padding around its viewport, reuses it for small pans, debounces moves, aborts superseded fetches, and discards geometry on City or basemap changes. A fresh OSM import invalidates the loaded geometry.
Worker updates are serialized with only the newest waiting viewport retained. City changes hide the old layers immediately and wait for active worker work before removing or reusing the source, preventing delayed geometry from the previous City from reappearing.
One GeoJSON source serves all five map layers. Its tile index stops at zoom 14 with a 32-pixel buffer and 0.75 simplification tolerance. Light/dark changes update paint without fetching geometry.
Responses report sampling and incomplete geometry. There is no city-wide JavaScript geometry cache or tile-provider fallback.
These limits bound retained feature data, not total Electron, worker, tile-cache, or GPU memory. Viewport queries run synchronously; an R-tree query over many matching features can still take longer than a small-city query. Full-region import and prolonged large-city use require separate memory and responsiveness measurements.
Existing street stores remain usable for routing. A store without localBasemap metadata returns needs-import with a fresh-import instruction; it cannot recover road classes or water from routing snapshots that omitted them.
Verification
Run npm run check:map, npm run check:osm-pbf, node test/check-city-build-equivalence.mjs, and node test/check-map-runtime.mjs. The basemap fixture checks road selection, lake holes, coastal islands, offshore and inland views, query budgets, pathological coastline clipping, R-tree access, compaction, and independence from routing snapshots. The Electron fixture renders both appearances through the local Studio protocol with all external HTTP requests blocked, overlaps updates with repeated City-source replacement, verifies that only the newest geometry renders, and checks source removal.
For manual visual review, the runtime fixture accepts VIGO_BASEMAP_PREVIEW_FILE pointing to a local GeoJSON response and VIGO_BASEMAP_SCREENSHOT_DIR for light/dark screenshots. Keep downloaded extracts and generated images outside tracked source files.
Measure the operation the caller waits for. Keep source data, City revision, query semantics, output detail, and status counts fixed when comparing runs.
For the shared native timetable workspace and a reproducible component comparison, see Timetable query performance.
Operation
Start
End
Build from raw files
Invoke vigo build with local inputs and a new output City
The complete City is published and the command returns
Raw files to first answer
The same Build invocation
The first complete Query Result returns
Reopen a prepared City
Start a new runtime on a complete saved City
Its first Query Result returns
Resident query
Submit to an already open City
The complete Result returns to the caller
Report downloads and runtime installation separately. State whether process startup, transport, export, and operating-system file-cache effects are included. A new process does not imply a cold filesystem cache; reading a saved Result is not a new computation.
What the timers include
network.json.timing describes compiler stages. totalMs begins inside the compiler after input/staging checks and ends before writing the manifest. It excludes process startup, shutdown, final City publication, and the first query. Stages may overlap; their durations cannot be summed into wall time. osmBuildMs can include waiting until the parent collects the worker result.
Route searchStats.queryMs measures the timed route-search and selected-journey work, including street access. It excludes fare annotation performed by the caller, final CLI decoration, transport and Result serialization. CLI routeMs / computeMs wraps routing, fare annotation and CLI decoration; it still excludes final serialization and transport.
materializationMs covers selected itinerary assembly. Its components include trip connection loading, metadata lookup, shape extraction, access/egress geometry, leg normalization and identity construction. Components need not sum to the enclosing timer. A geometry improvement is not automatically the same improvement in the complete response.
engineQueryMs measures native timetable work. For arrive-by, this includes reverse feasibility and forward selection; arriveByNativeQueryMs and forwardEngineQueryMs identify those components. Street access and geometry are outside that timetable total.
Matrix computeMs covers engine execution; requestPreparationMs and resultAssemblyMs describe caller preparation and row assembly. openMs reports mode initialization, including the first request of each mode in a stream. JSON serialization and transport require an external timer. Optional journey timings describe witness rendering, not independent searches or a share of batch time.
Use an external elapsed timer for complete Build and query latency. A small native search time does not establish the same user-perceived response time.
Fare parsing and localized display have separate costs. Whole-unit prices within the exact-integer fast path need no currency formatter; fractional and large prices still consult currency precision, and displayed labels still format currency symbols. Include the first fare-bearing result when measuring a fresh process. A preceding blocked route does not initialize every successful-route presentation path.
Preparation and reuse
Build includes import, required street indexes, stop transfers, station access, and publication. The first query may also compile its active-service timetable and align selected ride geometry. Report this cache-miss preparation separately from resident query time.
Portable binary timetable snapshots and prepared station access can be reused after moving the complete City. Timetable diagnostics distinguish loaded from written; a loaded snapshot reports compileMs: 0. New service patterns, changed walking policies, evicted caches, or older derived formats can require preparation. Missing required street indexes are errors, not permission to use a different graph.
Queries are recomputed. disableCache: true on transit Route/Matrix disables access/path caches while retaining the prepared City. Larger walking matrices may build temporary destination indexes; that setup belongs in the measured request.
Node Reach retains up to 64 next-departure schedule diagnostics per opened source store and active service context. This lookup preserves raw SQLite times and the inclusive 24-hour horizon; changing the service context clears it, and replacing the source creates a new lookup. It is immutable schedule metadata and remains available with disableCache: true. Reach still recomputes the timetable frontier and pedestrian surface. Measure first or changed departure clocks separately from repeated clocks; diagnostics.timetable.departureLookupMs exposes this cost alongside residentPrepareMs, search and surface timing. A faster repeated diagnostic lookup does not establish a faster native search or City opening.
Native timetable preparation
Standalone profile/trace output includes timing.timetableActivationMs, the time spent activating the service timetable during that request. A source preparation also reports timing.timetablePreparation with setupMs, sourceAndRealtimeMs, indexMs, and kernelMs. Setup includes calendar resolution and retiring the preceding timetable; source includes SQLite loading and realtime application. These scopes belong to execution and exclude public formatting, serialization, transport, and initial City opening. A reused timetable has no new preparation record. Profile scopes can overlap total execution; do not add them to it.
Rust constructs per-stop departure order, deduplicates transfers, expands station fallback links, and packs transfer adjacency. JavaScript resolves source IDs and passes typed arrays to the native preparation operator. This runs on active-timetable cache misses; loading a compatible persisted snapshot bypasses it.
Measure input marshalling and native preparation together when comparing the migration with the previous implementation. Keep SQLite reads, native search-index construction, snapshot loading, and resident query time separate. Preserved transfer ordering and snapshot layout do not by themselves establish a speedup. Filesystem lifecycle, source admission, and Result presentation remain JavaScript responsibilities.
Compare equivalent work
Record exact date/time, coordinates or stop IDs, walking speed and limits, boarding requirement, transfer cap, horizon, realtime snapshot, and output detail. Allowing a walk-only answer changes the workload. Separate ready, blocked, and error counts; a faster blocked result or a different journey is not an equivalent successful query.
For Build comparisons, hold raw inputs and compiler options fixed and compare compiled content; fresh revision IDs and build timestamps are expected. Performance checks complement accuracy checks, not replace them.
Cold service and street preparation
The native service reader opens the admitted SQLite source read-only and packs active connections directly into column buffers. JavaScript retains source admission and memory guards; Rust retains connection permissions, trip ordering, and discontinuity rules. A missing native reader is an error, not a JavaScript fallback. VIGO_ACTIVE_KERNEL_PERSIST=0 disables both reading and writing the active timetable snapshot when measuring compilation from source.
Prepared street graphs and CCH structures are validated concurrently during native construction. Validation still scans every required array. Path-query scratch distances use zero-filled storage with an encoded unreachable value, so the first path does not need to fill city-wide distance and predecessor arrays. These changes do not reuse previous route results.
Both persisted and in-memory Drive hierarchy construction use one 33-percent balanced four-axis flow cut per component. New City builds persist the hierarchy; opening that City loads it instead of repeating construction. Both retain every node and edge and use the same exact CCH search and distance certification; ordering can change the chosen witness between equal-cost paths. Arc ordering uses a shared stable counting sort. Native kernel diagnostics expose the hierarchy's arc count so preparation time can be evaluated alongside its size.
For a cold comparison, alternate baseline and candidate in separate fresh processes, include imports, graph opening, timetable compilation and result serialization, and compare route contents as well as latency. Keep immutable City inputs and hierarchy preparation policy identical. In particular, an in-memory drive hierarchy must be rebuilt on both sides; loading a saved hierarchy only on the candidate is not a cold code speedup. Report operating system page-cache control separately from application cache isolation.
Resident routing and realtime updates
For warm routing, retain the prepared City but disable access and path result caches. Verify the per-request cache diagnostics, rotate endpoints and departure times, and report native search separately from geometry materialization and whole-request time. Shared immutable indexes are preparation, not query answers.
Realtime measurements need two workloads: queries against an already prepared snapshot, and changed snapshots that force reconstruction and native indexing. Keep freshness, service date, applied update counts and fallback status in the retained evidence. Controlled updates on a real timetable measure computation; they do not establish live prediction accuracy. Compare reconstructed columns and route results, including cancellation and skipped-stop behavior.
Drive constrained-search buffers and traffic weights are allocated on demand. Report reserved bytes separately from resident memory: operating systems can back zero-filled allocations lazily, and allocator retention can obscure RSS changes after buffers are released. A normal CCH query should not allocate the constrained-search workspace merely to keep a kernel resident.
Compact street indexes and geometry
The v2 hierarchy stores seven aligned query columns. Its size without customization data is 104 + 16 * nodes + 12 * hierarchy_arcs bytes. Walking indexes use exactly this layout. Driving appends gzip-compressed input mappings for traffic updates; normal queries map the query columns without decoding the mappings. Inverse rank and arc tails are reconstructed only when customization needs them. Serialization uses a fixed 16 KiB buffer.
Transit shape coordinates and their distinct-point index remain native. Each selected Studio leg writes at most 512 points into an 8 KiB worker-local scratch buffer, then copies those points into its owned response. No full shape is exported or retained in JavaScript. The exhaustive clipping checks include loops, duplicate runs, signed zero, endpoint preservation, aliased endpoint views, and repeated buffer reuse. Shared output buffers are rejected at the native boundary.
Measure shape-cache bytes, temporary allocation, and whole-request latency separately. Reducing duplicate coordinates need not reduce timetable search time, and a hierarchy file reduction is not the same percentage reduction in the complete City.
The standalone Rust executable and Node interface use the same timetable kernel. Standalone transit Route requests obtain a journey through the shared Matrix kernel with one origin and one destination. Matrices can request scalar times or full journeys.
Journey construction allocates its scratch workspace lazily and retains it with the immutable timetable. Each source clears only the frontiers it touched; each boarding round visits only reached stops. Run generation tags separate rounds, sources, and requests, including wraparound. The workspace contains no cached answers. Changing direction, endpoint policy, or boarding limits still performs a fresh search. Replacing the timetable also replaces its scratch workspace.
Scalar Matrix queries prepare the common endpoint arrays once per batch and reuse the changing source or destination buffers. Validation and routing objectives are unchanged. Depart-at still shares a forward search per origin; arrive-by shares a reverse search per destination. Journey selection keeps the same dominance rules, run order, transfer rules, time horizon, and tie breaks.
For coordinate batches, journey rounds finish after every reachable target has attained its own exact scalar time bound. The final round completes before stopping, preserving boarding and walking ties. Targets without a route retain their blocked result. Selected-stop requests that permit terminal transfers keep the general round path. Endpoint projection also shares identical directed access searches within one batch, even when persistent endpoint caches are disabled; stop IDs remain part of the standalone endpoint identity. Each input still receives its own output row or column.
Arrive-by Route retains the scalar forward reachability envelope through successive capped and deadline certifications. Reuse requires identical origin and destination seeds, costs, departure, horizon, and terminal-transfer policies. Extending a deadline admits the remaining timetable events; contracting it keeps a conservative superset that exact rounds filter against the requested deadline. A new scalar search or a separately built forward envelope invalidates the retained identity. The reverse latest-departure search and exact deadline/boarding/walking certification still run.
Capped coordinate arrive-by searches first obtain the unrestricted latest departure and seek a forward witness at that same boundary. They accept the bound only when the witness reaches the deadline within the boarding cap; an unrestricted blocked result also proves the capped result blocked. Otherwise the existing layered reverse scan resolves the cap. A 1×1 Matrix uses this same certified bound before its unchanged journey rounds. Work counters include the proof and any fallback; no trip choice or tie criterion is removed.
Retaining scratch trades some resident memory for fewer allocations. Native workspaceBytes diagnostics include the journey arrays and their retained capacities. Scalar-only users do not allocate journey scratch.
The scalar point scan rejects strictly later arrivals before computing boarding and walking tie-breakers; equal arrivals still receive the full comparison. An epoch-scoped lower bound on stop arrival skips boarding searches when every label is in the future. It uses eight additional workspace bytes per stop and does not change prepared data. The preliminary unrestricted scan for a capped point query retains labels and its forward run envelope but omits predecessor writes and intermediate chain construction. Exact capped rounds still recover the final journey with the existing boarding and walking objectives.
For ordinary Node Route responses, the adapter passes only the plan diagnostic fields consumed by the shared Rust public formatter: realtime metadata, arrival reserves, and the service clock date. This avoids serializing and parsing unused search trees. Full journeys, alternatives, and geometry remain present; requested summary, profile, and trace responses retain their existing diagnostic input.
Coordinate routes and materialization
For capped fastest depart-at queries, the Node adapter permits the fused Rust call to return the selected access and egress witnesses, including walking geometry. The existing native guard uses this compact result only for certified one- or two-boarding routes. Uncapped queries, balanced preferences, departure-window alternatives, and arrive-by deadline certification retain the full candidate frontier. The change removes candidate conversion and subsequent path calls without limiting the search.
The standalone adapter retains immutable route metadata and trip-to-shape identifiers within each opened City. Journeys still reconstruct their active timetable stop sequence and geometry on every request. The metadata maps are bounded by the City's route/trip counts, are released with that City, and remain separate from endpoint or answer caches.
When opening an access context, the standalone stop projection parses only the normalized fields it consumes and validates JSON in skipped fields. Coordinate type checks and the null-coordinate exception for location types 3/4 remain unchanged. This changes reader allocations, not the portable City layout.
Reached-street propagation uses a monotone queue keyed by exact finite nonnegative floating-point duration bits. Equal-time entries use the existing walking-distance, node, seed, and witness ordering. A nonmonotone insertion falls back to the original heap. This does not round times, change walking budgets, or alter Pareto dominance. Node and standalone use the same operator. Compare full rasters and edge evidence, alongside measured execution and process memory, when evaluating queue changes.
Compiled GTFS shapes and their geometric alignment candidates are retained separately in a City-owned least-recently-used store, limited to 4,096 shapes and 256 MiB of estimated geometry storage, matching the Node interface's shape-cache limits. Lookups examine the most recently used entries first. This avoids the much smaller standalone cache repeatedly evicting geometry on varied city-wide workloads; the larger upper bound can increase resident memory. Sizes are accounted again after alignment grows candidate data. Oversized shapes are used for the current request and released. Timetable paths, realtime stop sequences, and selected shape slices are still reconstructed for each journey; the store does not retain route answers.
The standalone store also retains up to eight exact stop-to-shape alignments per shape within the same byte budget. The complete active stop coordinates, including their floating-point bits, form the key. A changed realtime stop sequence cannot inherit the scheduled alignment. Materialization copies only the selected shape slice. Point endpoint roles use the shared two-worker native executor. Batch endpoint evidence remains typed and is shared for identical request endpoints; it becomes JSON only when a response includes that evidence.
Generic street geometry keeps the original directed snap pairs, raw path distance, and tie rules. CCH path reconstruction shares one forward sweep across the candidate destinations for a source. Every destination still performs its exact backward sweep and shortcut reconstruction. The shared state is scoped to that batch call, so a subsequent source or metric never inherits it.
Standalone startup and output boundaries
The standalone City reader deserializes the used access-context fields directly into native structures and skips unused projections. Scheduled transit can load the compiler's portable active-service snapshot after checking database identity, access policy, active services, transfer projection, dictionaries, canonical array layout, and native kernel invariants. Missing or invalid optional sidecars fall back to the existing SQLite preparation path. Realtime and modified street-transfer policies use source preparation. timing.timetableSource exposes the selected preparation path; timing.totalMs still excludes process startup and initial City opening.
Rust Matrix defaults to full display and walking-evidence detail. Node Matrix returns compact timed witnesses. For a comparable analytical workload, request Rust journeyFormat: "compact" with includeJourneys: true, or request duration-only matrices from both. Compact changes response detail only: the same native journey search runs, with the same trips, boarding sequences, clocks, and transfer count. Full remains the default and the required format for geometry and walking-evidence consumers. The stream uses bounded 64 KiB serialization scratch instead of retaining another complete encoded response.
Forward and reverse batch bounds share one endpoint accumulator. Reverse scans minimize negated departure times with nonnegative access offsets, and stop once all nonempty endpoint frontiers have a bound that earlier connections cannot improve. Empty frontiers remain unreachable; an unreached nonempty frontier keeps the scan open. Directed terminal transfers and equal-time closure retain their existing semantics. This removes the former full-horizon scan for bulk arrive-by queries and the separate per-origin readout. Matrix still shares one forward scan per origin or one reverse scan per destination, so rectangular matrices can have different costs in the two directions.
cargo test -p vigo-route timetable::many::tests checks reverse batches against time-mirrored forward queries and scans forced to retain the entire horizon, including boarding caps, directed transfers, excluded trips, duplicate and empty endpoints, zero-duration connections, and reuse after a bulk query. The synthetic cutoff fixture examines fewer than 10 connections rather than at least 1,002. These are work counts for that fixture, not a production latency guarantee.
Full arrive-by journeys use a shared forward prefix bound before reverse journey rounds. Each requested origin is seeded at its already proven latest departure for that destination, including only its permitted initial transfer. The prefix scan ignores the boarding cap to remain optimistic, retains direct walking seeds, and permits post-ride transfers. Reverse candidates earlier than all reachable prefixes are discarded before transfer/frontier comparisons. The exact rounds still choose boardings, walking, actual arrival, and full witnesses. A conservative floating-point tolerance retains boundary-equal candidates.
The prefix pass reuses the many-target scan with endpoint-cutoff bookkeeping disabled: it needs all stops through the horizon. Its work is included in Matrix search counters. Prefix scratch is recomputed per destination and reused across requests; it does not cache answers.
Full depart-at journeys use the corresponding reverse suffix bound. Each destination is seeded at the latest of its exact earliest arrivals across the requested origins, allowing one conservative pass to serve all rows. It retains direct egress and the destination's permitted final transfer, ignores boarding caps, and includes walking into a first ride. The existing reverse scan reads out first-boarding deadlines for every stop without endpoint maps. A forward label after that stop's deadline cannot complete an optimal journey; runs departing after the same bound need not enter the boarding round. The bound is recomputed for every request, including when endpoints or direction change. Its scan and transfer work is included in the query counters.
opposite_bounds_preserve_complete_journeys compares complete witnesses with pruning disabled across fractional access costs, empty/duplicate endpoints, directed terminal transfers, boarding caps, transfer buffers, zero-time connections, unreachable prefixes and suffixes, and changes of direction on a reused kernel.
Reproduce a kernel comparison
Build each version with npm run build:rust-routing-kernel using the same toolchain and release settings. Save the earlier crates/vigo-runtime/vigo-routing-kernel.node under a separate path before building the changed version. Then run:
The script generates deterministic synthetic timetables with 256 and 4,096 served stops. It measures 1×1, 16×16, 1×128, and 128×1 requests in both time directions, with and without journeys and terminal transfers, using a three-boarding cap. Baseline and changed calls alternate execution order. Every call must preserve times, blocked cells, and full journey contents. Reports retain search counters separately because an optimization can reduce the work. They also include individual samples, medians, p95, native timing, and resident workspace bytes.
The outer timing includes Node-API argument/result conversion. Native timing excludes that conversion. Both exclude City loading, endpoint street routing, geometry, fares, JSON serialization, HTTP, and process startup. No answer cache is used; the prepared timetable and scratch memory remain resident. The first request for a workload is measured on the existing kernel and is not a cold-process or cold-filesystem measurement.
Quality checks
test/check-timetable-query-reuse.mjs compares a reused kernel with fresh kernels across changing endpoints, time directions, boarding limits, endpoint transfer policies, empty access, and invalid requests. Rust unit tests exercise generation wraparound and recovery after a journey-bound error. Run the existing native matrix, independent routing-accuracy, transfer, equal-time, and standalone parity checks as well: agreement between two adapters does not independently prove the shared kernel correct.
For workload measurements, use complete caller-visible Route and Matrix requests on representative prepared Cities. Alternate identical requests between resident baseline and candidate processes, exclude a stated warm-up round, retain all responses, and compare complete route semantics. Keep cold loading, street access, timetable search, journey/geometry construction, serialization, and transport separate. The standalone engine already moves request execution into Rust; additional migration should target a measured remaining cost and preserve each interface's supported behavior. Private City inputs and workload evidence belong in the private benchmark repository.
Standalone query execution
Capped coordinate point queries use the same destination-directed exact certifier as Node Route. Arrive-by first proves the latest departure, then certifies boardings, walking, and actual arrival within the deadline. Unsupported cases retain shared Matrix reconstruction; selected-stop and unbounded queries retain that path. Full geometry and walking evidence remain part of the response. Equal objective values can select different source-valid transfer stops; check source legs and objectives separately from byte equality.
Transit matrices group repeated endpoint identities before timetable search and journey construction, then restore every requested row and column. Coordinates and stop identity must both agree; different co-located stops cannot share permissions. Full and compact output remain explicit choices, and scalar requests retain their original dimensions.
These limits and recovery rules apply to Studio's routing runtime and the compiler's Node workers. The engine's limits are in Server limits and Resource limits.
Memory and request admission
Studio's native runtime admits at most VIGO_NATIVE_CITY_MAX Cities (default 2, range 1–8), with at most VIGO_NATIVE_CITY_PROCESSES processes each (default 2, range 1–8). When all City slots are busy, a new City returns HTTP 503 with capacity_exceeded; idle slots can be reused. These count limits complement the native memory budgets. Complete and fragmented native response lines share a 256 MiB limit. Mode preparation uses street.prepare, bike.prepare, drive.prepare or timetable.prepare, without retaining or replaying journeys.
Each native request follows one serving contract:
Admission. A request already cancelled, or for a City whose files are being replaced, is refused before any City is opened, evicted or started. An admitted request reserves a count and an encoded-byte permit, globally and for its City, and returns them however it ends. With no permit left the request fails at once with HTTP 503 and VIGO_NATIVE_OVERLOADED, marked retryable; nothing queues without bound. The VIGO_ROUTE_MAX_PENDING/VIGO_ROUTE_MAX_QUEUED limits below belong to the separate preparation pool, not to these requests.
One deadline.VIGO_NATIVE_QUERY_TIMEOUT_MS (default 600,000) is the request's whole budget from admission: waiting, a process start and one automatic retry all spend it. A request that expires while waiting leaves the queue without stopping a process; only the request a process is computing can stop that process.
Dispatch. Waiting work stays in its City's queue and goes to the first ready process that is free, including one that has just started; a request already written to a process is never moved. Work waiting behind busy processes starts another one, up to the process limit. Point routes go before Matrix and Reach analyses, which may be passed over at most four times. A request waits up to VIGO_NATIVE_AFFINITY_WAIT_MS for a process that has its travel mode loaded, then takes any idle process, which loads it first.
Generations. Replacing a City's files in the same library is a two-phase fence (withRetiredRouting): the City starts a new generation and its processes exit, then the files are replaced, then the City is released. Admitted work does not fail: waiting requests, and requests arriving meanwhile, wait until the release and then run on the new generation; a request the retirement stopped mid-computation runs once more there. Each stays within its own deadline. A failed replacement or its rollback releases too, and a release that never comes ends after VIGO_RETIRE_HOLD_MS, when the held work fails as being updated. The preparation pool follows the same rule for its route analysis and preparation jobs. A caller that knows which City it replaces (the wheelchair City's publish) names it by root, so its parent City is never stopped. Switching library instead resets the native runtime and the preparation pool: everything admitted before is refused, and work begun under the old library (a request still on its way, an import, a warm-up) is refused when it reaches either runtime, so it never reopens an old City. Both keep serving the new library without a restart.
Control
Default
Supported range
VIGO_NATIVE_MAX_PENDING
256 requests waiting or running
1–100,000
VIGO_NATIVE_MAX_PENDING_BYTES
Capacity ÷ 64, between 16 and 256 MiB
1 MiB–4 GiB
VIGO_NATIVE_CITY_MAX_PENDING
128 per City
1–100,000
VIGO_NATIVE_CITY_MAX_PENDING_BYTES
Half the global byte limit
1 MiB–4 GiB
VIGO_NATIVE_RESPONSE_BUDGET_BYTES
Capacity ÷ 8, between 256 MiB and 2 GiB
1 MiB–16 GiB; never below one response line
VIGO_NATIVE_AFFINITY_WAIT_MS
500
1–60,000
VIGO_NATIVE_RESTART_BUDGET
6 process starts per City in 30 seconds
1–100
VIGO_RETIRE_HOLD_MS
300,000 ms a City or store waits for its replacement to finish
1,000–3,600,000
The response budget counts native answers being received and decoded across every process. The first answer being received always finishes; others pause their output while the total is over budget. GET /api/health reports nativeRuntime.admission, responses and counters (overload refusals, expiries, retries, process starts and requests refused after a retirement or reset).
The Node routing-time validator has explicit interface bounds: Studio accepts whole minutes from 0 through 1799, and GTFS orchestration through 2880. The native public request schema accepts seconds through 71:59:59. Tests retain these boundary distinctions. Engine and Python documentation readers ship independently; their shared Markdown subset is checked for rendering parity.
The runtime uses the smaller of host RAM and Node's reported container limit to choose its default budgets. Configuration accepts finite positive integers; invalid values use the default, and valid values are clamped to the supported range. Zero does not disable the timetable byte guard.
Timetable admission counts the active service slice before allocating native arrays, estimates its size, and checks retained bytes after construction. Realtime reconstruction estimates the resident scheduled view, rebuilt arrays and replacement calls before native compilation against the same budget. Default cache budgets scale with capacity.
The pool rejects excess work with status 503. Capacity waits have a deadline, and a worker watchdog requests termination when an operation exceeds its deadline. Under memory pressure the pool avoids adding a second City until an unleased idle worker can be retired. Worker diagnostics expose limits and pending counts. Shutdown wakes waiting requests and permanently closes the pool.
Within queued query work, Studio prioritizes point Route, departure-window, and street Route requests. An older analytical job runs after at most four point-query bypasses. Preparation and unknown operations preserve their queue order, and running native work is not preempted. Worker diagnostics expose maximumPointBypasses.
These are admission and retention safeguards, not a hard whole-process memory limit. V8's worker heap limit excludes native arrays and mapped street data. Imports, realtime reconstruction, result assembly, and serialization can still have temporary allocation peaks. The RSS check cannot interrupt a native allocation already in progress. A native call must return before thread termination can complete; operating-system memory exhaustion remains possible. Street and timetable budgets must be considered together for large Cities.
Recovery
A routing-thread failure rejects its active and queued work, waits for termination, and reopens authoritative City data for a subsequent request. Structured-clone failures reject only the affected job and leave the worker usable. No failed query is converted into a fabricated journey.
Studio keeps its window when the Engine exits. It allows three starts within a rolling minute, including the initial start, with increasing restart delays. Startup has a 30-second deadline. Once the restart budget is exhausted, a later request can try again after the rolling window permits it. Engine startup failure does not prevent the window from opening. Pending requests fail rather than being replayed automatically, because some requests change stored data. Studio admits at most 128 Engine requests, including those waiting for startup. When the Engine is unavailable or the restart budget is exhausted, desktop API requests return a structured 503 response. The interface can show the failure without waiting for an unresolved protocol request.
Packaged Engine environment filtering lives in public/engine-environment.mjs. Studio supplies its own application-data path after filtering so startup and recovery use the same configuration directory.
Tests with real execution
test/check-national-runtime-isolation.mjs builds real GTFS and OSM inputs and uses the production worker and native kernel: it verifies exact journeys after thread termination, rejects a 50,000-trip input under a 4 MiB budget, rejects an oversized realtime reconstruction while scheduled routing keeps working, and checks overload and shutdown. test/check-engine-recovery-runtime.mjs runs the Electron entry point, kills Engine processes, and checks health, the restart budget and the subsequent 503. These checks do not establish other-platform behavior, live-feed accuracy or immunity to memory exhaustion.
Use a retained NDJSON request file containing public Route, Matrix, and Reach requests. Each line includes kind, the City or scenario selection supported by your service, the service date, and all routing constraints. Keep the file and prepared City together with their source checksums.
Set VIGO_API_TOKEN if the service requires authentication. The benchmark does not write the token to its report and refuses to overwrite an existing result. It calls the service's /v1/route, /v1/matrix, and /v1/reach endpoints.
The report retains every measured call, warmup calls, request-file hash, runtime capabilities, client platform, and optional unique-file City storage. Latency includes queueing, HTTP, response transfer, and JSON parsing. Quantiles use nearest rank. Successful results, valid no-journey results, HTTP failures, overload, service unavailability, timeouts, invalid responses, and transport failures are reported separately. Errors during warmup also fail the run.
For a cold-start measurement, start a fresh service and use --warmup 0 --rounds 1. Measure readiness separately from the first query. For sustained use, retain the same workload and increase rounds; report how much the workload repeats and whether caches are enabled. Compare equivalent inputs, constraints, output detail, hardware limits, and runtime builds.
This replay is closed-loop: each client sends its next request after the previous one completes, so offered load falls when the service slows. To measure behavior at an independent arrival rate, use the open-loop companion against a privately started service:
It schedules arrivals at a fixed rate, caps its own in-flight requests and counts arrivals it could not send instead of queueing them invisibly. The report gives offered and completed arrivals, overloads, timeouts and latency from scheduled arrival. Only loopback targets are allowed unless --allow-remote is given, and it never overwrites a report. Raise the rate until successful arrivals within the SLO stop rising, and measure server memory and CPU separately.
City storage counts each file identity once, including shared scenario directories. It is logical file size, not physical APFS clone allocation. Server memory must be measured at the service: retain process-tree RSS/PSS or cgroup memory samples at startup, first query, repeated and concurrent queries, scenario switches, and peak large-output requests. Include the full application stack when claiming a deployment budget. The benchmark client's memory is not server memory.
Use public synthetic fixtures for CI and caller-owned Cities for operational acceptance. A short replay establishes behavior for that retained workload; it does not establish production reliability across unobserved traffic. See upgrading for installation and rollback checks.
All Rust code builds from the root Cargo workspace and Cargo.lock; see Crates. The vendored CCH dependency stays isolated with its license and notices. src/ contains Studio, its application services and GTFS and OSM import. Build outputs live in the root target/; do not add a nested lockfile or target tree.
CI (.github/workflows/ci.yml) runs inside the Release workflow, or when started by hand; pushes and pull requests start no workflows. It runs source, documentation and Rust workspace checks, the Python package checks on Python 3.10–3.13 and three operating systems, and the engine, compiler, Studio and live Python suite on Linux. One Release workflow, started by the v<VERSION> engine tag, reuses CI's source and Python checks, then builds and tests the engine, the compiler, Studio and the Python wheels on all four platforms from that commit, packages the tested executable, checks Cities built on other platforms, and verifies the Linux containers before attestation and publication. Release container checks use deploy/Dockerfile.release and the verified archive; deploy/Dockerfile builds from source.
Within one unchanged CI job, VIGO_USE_BUILT_RUNTIME=1 reuses the runtime built earlier in that job and fails if a binary is missing. Never use it after editing Rust or embedded documentation; local builds stay source-checked by Cargo.
VIGO supports an optional bicycle graph in bike_nodes, bike_edges, bike_turns, and bike_way_turns tables inside the existing street database. Existing readers ignore these tables; no existing field, snapshot or format identifier changes. CLI builds opt in with --street-modes=walk,bike or --street-modes=walk,drive,bike. Studio OSM imports include bike streets.
The bicycle engine customizes one turn-aware contraction hierarchy for the selected profile, speed and stress limit. Ordinary movements use scalar shortcuts. Dated entries and endpoint-only permissions narrow the shortcut choices. When time or metres constrain a path, the same rank sweeps retain the necessary undominated travel time, preference cost and distance states. Endpoint projection uses the road segment index, and verified pedestrian connectors share the pedestrian hierarchy with unrounded distance weights.
A source-bound hierarchy cache can reuse the upward topology and shortcut witnesses on process start; opening it rebuilds the remaining columns and weights exactly. It contains graph data only. The original City remains the source of truth; its prepared files and portable layout do not change.
Bicycle Reach first bounds every cell's walking access with one relaxed hierarchy sweep from the fixed endpoint: a cell searches only as far as a bicycle node could still beat its best candidate. Cells whose minimum the path certificate cannot settle repeat with every walking candidate.
Preference cost is distinct from physical travel seconds. The default balanced and quiet profiles penalize traffic exposure; fast minimizes estimated travel time. Mapped surfaces and incline change speed. Dismount segments use walking time and are materialized as walk legs with geometrySource: "osm-dismount". Off-network coordinate connectors remain unverified walks. Bicycle Reach supports both departure and arrival queries. Bikes-on-transit, bike sharing and elevation rasters are outside this model. Unhandled relation shapes are counted in diagnostics.
All street modes estimate travel duration. A dated bicycle request also uses the City's time zone to evaluate supported weekly road and turn permissions at the moment of entry. When the request has no usable service clock, the engine excludes timed roads and applies conditional turn restrictions conservatively. Walk uses a static pedestrian graph; Drive can apply an admitted traffic snapshot to its static road metric.
The importer follows the OSM access hierarchy. Trunk roads retain explicit bicycle restrictions and motorroad exclusions; their classification alone does not make them motorways. Movable gates inherit the admitted way's access unless private, locked, or time-restricted. Mandatory separate cycle paths (bicycle=use_sidepath) exclude the roadway. These portable defaults are not a country-specific traffic-law model.
Run npm run check:bike, the Rust bike::tests, and npm run check:format-050. The latter checks that the published reference reader can open a newly written City with the optional bike tables.
Valhalla's bicycle costing documentation and elevation model provide feature references. VIGO's weights are its own documented heuristics. Passing synthetic regressions does not establish route-quality or performance parity with Valhalla, GraphHopper, or BRouter. Comparative evidence belongs in the separate benchmark workspace.