Parchment Docs
Usage

Transit

Live departures, vehicle positions, service alerts, and signed directions.

Parchment reads the same real-time feeds agencies publish for their own apps. Where an agency publishes GTFS-RT, departures carry live predictions rather than the timetable, vehicles move on the map, and anything the agency has said about a disruption is shown alongside them.

All of it comes through Barrelman, which discovers each feed's real-time URLs from Transitland during the GTFS import and stores them on the feed.


Finding a line

Transit lines are search results. Type a line the way a rider says it — "7 train", "route 40", "Flushing Local" — and the line appears alongside places, in the palette and on the results page; picking it opens the route detail with its stops, vehicles and alerts. Stations only the transit feed knows about show up too, opening on their departure board.

Behind it, Barrelman matches the query against the GTFS routes it has imported and drops anything that duplicates an OpenStreetMap result, so a station never appears twice under two spellings.

Following a run

Tap any departure on a stop's board (a countdown, a later time, or a direction's row for the next run) and the line's route page opens following that run. The stop list turns to face its direction, shows when the run reaches each stop ahead, and greys out the stops it has already left.

If the vehicle reports a position, it is selected on the map and the timeline. If not, a marker sits where the run's predicted times put it. The run stays in the page's address (?trip=<trip id>), so a reload or a shared link opens the same run.

Stop times come from the agency's GTFS-RT trip updates. A run with no realtime prediction opens on the right line and direction, without times.


Service alerts

A service alert is the agency's own word on a disruption — a detour around roadworks, a suspended line, a lift out of service. Parchment reads the GTFS-RT ServiceAlerts feed and shows each alert wherever it applies:

WhereWhat you see
Route pageEvery alert on that line, worst first, under "Alerts on this line"
Stop departure boardAlerts naming the stop, plus a badge on each line that has one
Planned tripThe alerts for each transit leg, above that leg's departure board
Departure chipA badge on a run the agency has published something about

Alerts already in effect lead; anything whose window opens later is filed under "Upcoming alerts", so next weekend's planned closure doesn't sit above tonight's suspension. Where the feed says an alert is planned work rather than a live incident, it is drawn one step quieter — a scheduled closure warns, an unplanned one is red.

Severity

Agencies are inconsistent about setting a severity on an alert, so Parchment falls back to the alert's effect when they leave it unset — a suspension with no severity is still drawn as a suspension, not as a footnote.

Drawn asWhen
RedSeverity SEVERE, or effect NO_SERVICE
AmberSeverity WARNING, or effects like DETOUR, SIGNIFICANT_DELAYS, REDUCED_SERVICE, STOP_MOVED
MutedEverything else

Agency prose runs long — stop lists, notes about arrival predictions — so anything past a few lines is collapsed behind "Show more".

Agencies that don't fill in the spec fields

Some agencies leave cause, effect and severity_level unset on every alert and publish the real category in a vendor extension instead. The MTA is one: all of its alerts arrive as UNKNOWN_EFFECT / UNKNOWN_SEVERITY, with the category — "Planned - Detour", "Planned - Suspended", "Delays" — in a MercuryAlert extension the standard GTFS-RT decoders drop.

Barrelman reads those extensions, so an MTA detour is drawn as a detour rather than as an unlabelled grey note. The extension also carries the time the agency published the alert, which is what the card's "Posted" line shows.

Support is a registry (src/services/alert-extensions.ts in Barrelman): each agency's extension is one entry giving the protobuf field number it occupies and a function that reads it. Adding another agency's format needs no change to the alerts service, and an alert's own spec fields always win — an extension only fills a gap the feed left.


Signed directions and entrances

Platform signs name a direction, not a terminal: "Uptown & The Bronx", "Manhattan". Where Barrelman knows that label, a planned trip leads with it ("A · Uptown & The Bronx") and shows the terminal underneath, departure boards group runs by it, and navigation says "Board the A, Uptown & The Bronx". Without a label everything reads as before, by headsign.

The walk into a station uses the entrance that makes the whole walk shortest, never one signed only for the other direction's platform, and never an exit-only one. The walk out never uses an entry-only entrance. Entrances are named by their OSM name or ref, else by the corner they stand on: "Enter at Broadway & West 28th Street · NW corner".

Both come from OSM, enriched with agency open data where an agency publishes it (the MTA does for the NYC subway). See station labels in Barrelman's docs.

Inside the station

Barrelman builds a walking graph of each rail station from OSM, with its stairs, escalators, lifts and levels, and plans through it:

  • Transfers are classed as cross-platform, in-station, a long passage between stations, or out of system (tap out and back in, counted as 20 s for the gates). Each says whether it goes up to the street.
  • Entrance and exit: the one that makes the street walk plus the walk inside shortest.
  • Where to board: front, middle or back of the train, so it stops next to the exit or the next line's stairs. Only given where OSM maps the stairs along the platform and it saves at least 45 s.
  • Steps inside: where the station is mapped, a transfer or station walk has a drawn path across levels and written steps ("Take the stairs down to the mezzanine", "Follow signs for the 7 · Queens"), with distances and times for guidance without GPS. Elsewhere the time is an estimate and nothing is drawn.

In a trip's details, a chip between two rides names the transfer ("In-station · 1 min 22 s", "Exit and re-enter · free re-entry"), the boarding stop says where to stand ("Board toward the back · saves 2 min"), and walks inside a station expand into their steps. Estimated times are marked with ≈. On the map, walked paths inside stations are drawn dashed and fade when the indoor floor picker shows a different level. In navigation, these walks switch to step cards that follow you without GPS: the phone's step count paces out each corridor and platform, a barometer (in the apps, where the phone has one) notices when you reach the next level on stairs, escalators and lifts, and the walk to a platform ends once you are on a moving train. A step no sensor can follow moves on after its expected time, and says so with a countdown rather than a distance. Next always moves on by hand, each new step is read aloud, and a badge names the level it leads to. GPS guidance picks up again once you are back on the street.

How good this is depends on how well OSM maps a station. A station moves from estimated times to drawn paths by itself once its stairs and mezzanines are mapped.


What an agency has to publish

Alerts need a GTFS-RT ServiceAlerts feed. Barrelman finds it through Transitland, alongside the trip update and vehicle position feeds.

Discovery goes through the operator, not the feed id. An agency's realtime feeds are separate records from its static one and are not named after it — MTA New York City Transit's static subway feed is f-dr5r-nyctsubway while its realtime feeds are f-mta~nyc~rt~subway~a~c~e and nine others. Asking which operator runs a feed, then taking that operator's GTFS-RT feeds, finds all of them; deriving an id from the static feed finds none. Each URL's kind is recorded when it is discovered, because one agency's feeds cover several modes and the URL alone doesn't say which is which.

An agency that publishes no alerts feed simply shows no alerts — nothing else about its departures or vehicles changes.

If a region's real-time URLs were never discovered, run the discovery pass on Barrelman:

curl -X POST http://localhost:5001/transit/discover-rt-urls \
  -H 'Content-Type: application/json' \
  -d '{}'

Pass {"feedId": "..."} to limit it to one feed. Discovery needs a Transitland API key in Barrelman's environment.


Bikes on transit

Trips that take a bike aboard are offered only where the service allows it. Which services those are comes from the timetable, and this is one of the places the GTFS spec and the world disagree.

GTFS has three states for bikes_allowed — no information, allowed and not allowed — but the routing engine collapses them to a yes or a no, and reads no information as no. Almost every agency omits the field: across the feeds Barrelman imports, two declared a single bike-carrying trip between them. Taken literally, bikes are banned from every train in the country.

So Barrelman fills the blank at import time. A trip that says nothing becomes allowed; a trip that says not allowed is left exactly as it is, so an agency that has bothered to state its policy stays the authority on its own services.

Buses are the exception and stay unstated. Most take only a folding bike, or have a front rack that holds two, and GTFS cannot express either — so guessing allowed would route riders onto a bus that turns them away. Rail, subway, tram and ferry get the benefit of the doubt; buses don't.

This is a default, not a claim. Where an agency does publish bikes_allowed, that answer is used unchanged — including when it says no.

The fill happens when a feed is imported, so a policy change reaches trip planning on the next import rather than immediately.


Freshness

Barrelman caches each feed's alerts for a minute, and Parchment caches an answer for a minute on top of that. An alert an agency posts mid-journey reaches an open trip within about two minutes; opening a route or stop page fetches on entry.