Each assumption: value, reason, expected sensitivity, what would replace it. The viewer shows simulation
outputs; it adds no traffic data of its own. The data contract is sim/VIEWER.md; this file records the
exact format and the choices made while implementing it.
python -m vhsim.viewer.export --net <net.xml> --run <run_dir> [--run <seed2> ...] --out <data_dir> --scenario S
--condition C --year Y --growth G [--seed N] [--network-name NAME] [--begin s] [--end s] [--bookmark "HH:MM=label"]
[--bookmarks file.json] [--pois pois.geojson] [--zones zones.geojson] [--junctions junctions.csv]
<data_dir>/index.json {version, networks: {name: "networks/<name>.json"},
runs: [{id, scenario, network, condition, year, growth, seed, label, path}]}
<data_dir>/networks/<name>.json one per network variant
<data_dir>/runs/<run_id>/meta.json run_id = "<scenario>__<condition>__<year>-<growth>__s<seed>" (or "__mean")
<data_dir>/runs/<run_id>/lanes.bin.gz
<data_dir>/runs/<run_id>/edge_times.bin.gz
Several --run directories (seeds) are averaged into one run with seed mean (plain mean per lane/edge and
interval; a seed with no vehicles on a lane is left out of that lane's speed and density mean). index.json is merged,
so runs can be exported one at a time into the same folder.
Safety checks: the exporter refuses to replace networks/<name>.json with a network whose lane/edge ids differ
(--force-network overrides; then re-export every run on it), refuses runs whose measured edges are mostly not in
--net, and refuses seeds with different output periods. The viewer refuses a run whose network_hash, n_lanes
or n_edges do not match the loaded network.
version, name, hash (16 hex digits of SHA-1 over the edge and lane id lists: the order the run binaries
follow), lefthand, bbox [w, s, e, n], projection, routing_vclass (passenger).nodes: id, lon, lat, name (from S1 junctions.csv when given, else null), type (SUMO junction type).edges: id, from/to (node index), length (m), speed_kmh, name, lanes (lane indices), shape
(flat [lon, lat, lon, lat, …], 6 decimals ≈ 0.1 m, the edge's centre line from junction to junction),
routable (1 if passenger may use it), next (edge indices reachable through a SUMO connection),
via_s (free-flow time through the junction's internal lane for each next), bearing (deg, first→last point),
slot (drawing offset of the direction line, see below).lanes: id, edge (edge index), index (SUMO lane index, 0 = kerb), bearing, name, speed_kmh, length,
slot, shape (the lane's own SUMO shape in lon/lat; the viewer draws lanes from the edge centre line + slot).pois: {id, category, name, lon, lat, node (nearest node a car can enter), snap_m, source}.zones: {id, name, geometry (GeoJSON), edges (routable edges whose midpoint is inside), suburb?, dwellings?, …}.run_id, label, network, network_hash, scenario, condition, year, growth, seed, begin_s, interval_s (900), n_intervals,
n_lanes, n_edges, files {lanes, edge_times} (binary layouts, below), bookmarks [{t, label, kind: auto|scenario,
detail}], series {delay_veh_h, waiting_veh_h, vehicles_mean, speed_ratio_mean} (one value per interval),
summary {loaded, inserted, arrived, teleports, waiting, running, delay_veh_h_total, peak_interval_begin_s},
queue_threshold_vehicles, sources (run dirs), synthetic, notes, created.
gzip-compressed, little-endian, interval-major planes (value[t * n + i] for lane/edge i in interval t),
each plane padded to a 4-byte boundary; decoded = raw * scale unless raw == missing. meta.files.*.planes
lists {name, dtype, offset, scale, missing, unit, description}.
| file | plane | dtype | scale | missing | meaning |
|---|---|---|---|---|---|
| lanes | waiting_s |
uint16 | 2 | – | seconds vehicles were halted on the lane in the interval, summed over vehicles (cap 131070 s ≈ 145 vehicles halted all interval) |
| lanes | vehicles |
uint16 | 1 | – | vehicles entering the lane, incl. lane changes onto it (entered + departed + laneChangedTo); a vehicle can count on two lanes of one road |
| lanes | speed_ratio |
uint8 | 1/254 | 255 | time-weighted mean speed / lane limit (SUMO speedRelative), capped at 1; 255 = no vehicles |
| lanes | density |
uint8 | 1 | 255 | vehicles per km of lane (cap 254) |
| edge_times | travel_time_s |
uint16 | 0.1 | 65535 | SUMO edgeData traveltime; free-flow time where no vehicle; cap 6553.4 s; 65535 = impassable |
Size: 6 bytes per lane-interval + 2 per edge-interval before gzip. Victor Harbor scale (~15k lanes, 96 intervals) is about 9 MB raw per run; gzip typically reduces it 5–10×. The sample (1,238 lanes, 76 intervals) is 120–140 kB per run.
traveltime, free-flow where emptytraveltime is edge length × vehicle-seconds ÷ the distance the vehicles' fronts
travelled in the interval. When the vehicles covered less than one edge length (traveltime > vehicle-seconds),
the exporter uses the vehicle-seconds observed plus the free-flow time of the part of the edge not covered
(t = sampled + free_flow × (1 − sampled / traveltime)). Intervals in which at least one edge length was
travelled are unchanged; a real queue (vehicles on the edge for much of the interval) keeps a long time.-42530401#0, 194 m) in the 2025 summer baseline, 12:15–12:30: seed 2
recorded 19,308 s from 11.8 vehicle-seconds and seed 3 9,678 s from 6.5 (one vehicle each, entered 0, left 1);
the seed mean hit the format's cap (6,553 s), so the residents' site showed Grantley Ave → Woolworths at 12:30
taking 56.6 minutes today and the council package "53 minutes faster". The vehicles' own exit times (vehroute)
show the longest traversal of that street between 12:00 and 13:00 was 70, 97 and 79 s in the three seeds; the
rule gives 24 s for the interval (seed mean), and the trip becomes 2.7 minutes today against 3.6 under the package.traveltime, so only the viewer and the
residents' site were affected. Runs exported before the fix are re-timed in place with
python -m vhsim.viewer.retime (edge times only; lane data unchanged).edges_nearest: true); a zone with no road within 300 m (e.g. Granite Island) stays grey.vhsim/viewer/bookmarks.py)timeLoss, vehicle-hours per interval); up to two sharpest
rises and two falls (each ≥ 15% of the peak and ≥ 0.5 vehicle-hours per 15 min; neighbouring intervals merged; a rise
into the peak interval is folded into the peak); the first interval where a junction approach (edge ending at a node
with 3+ legs) averages ≥ 5 halted vehicles per lane (waitingTime / 900 / lanes), top 5 approaches by peak queue; the label says
"halted vehicles per lane (15-minute average)".
In the browser, A-vs-B bookmarks mark the intervals where network delay differs most each way (≥ 10% of the peak and
≥ 0.5 vehicle-hours).--queue-threshold changes the queue one.waiting_s / 900). Volume shown per hour. Lanes with no vehicles are grey.--run).
If a scenario patch renames edges (e.g. splits one), those edges will not match and show as removed + new.getRawShape) with a pixel offset
(slot lane widths, MapLibre line-offset): two-way roads put each direction on its driving side (left in
left-hand networks, read from the net's lefthand attribute), kerb lane outermost, 0.15 lane widths gap at the
centre line; one-way roads are centred. Widths are exaggerated below zoom 16 and true to scale (3.2 m) above.spreadType=right are drawn half a road width off.sim/data/viewer/sample/, python -m vhsim.viewer.sample)--lefthand, OSM speeds, no S1 fixes); 15,000 synthetic car/truck trips (shape of the S3 hourly profile, made-up
purposes: home ↔ centre/shops, 15% through traffic, 250 school trips per school each way at drop-off and pick-up);
2041-high = 1.3 × trips; summer peak = beach trips instead of school trips; "test_variant" = Victoria Street one-way
(south/west-bound edges deleted) and Esplanade 40 km/h. One seed per run. Places from S-E03; zones are a 3 × 3 grid
of test cells. Every run is marked synthetic and the UI shows a banner.viewer/index.html); no build step. The tests load the same version from
viewer/node_modules so they run offline. Background map: OpenStreetMap raster tiles, off by default.viewer/residents/)routeFromNode) from the simulated junction nearest each
end of the trip, departing at the trip's time, on the run for that option, day type, year and growth. Places more
than 800 m from any junction count as "outside the simulated area". Door-to-door parts (parking, walking) are not included.weekday_term, Saturday → saturday, Summer holidays → summer_peak. Day types or
years without a run are shown as "not simulated yet"; nothing is interpolated or borrowed from another day or year.
2025 is "today" (growth base) for both growth settings.localStorage (key vh-residents-v1), every access wrapped in try/catch; if
storage is blocked the site works for the visit and says nothing is saved. No trip data goes in URLs, requests
or logs; all routing runs in the browser on the published results. Place search uses the published places list
(no external address lookup). The only third-party requests are the map library (cdnjs) and, if a future
version turns it on, background map tiles.networks/<name>.lite.json (routing-only, written by the exporter, or backfilled with
python -m vhsim.viewer.lite --data <dir>; falls back to the full network file) and each run's
edge_times.bin.gz. The "all options at a glance" table loads every option's network and only runs when asked.viewer/basemap/, vhsim/viewer/basemap.py, vhsim/viewer/terrain.py)Provenance, licences and hand-placed labels: viewer/basemap/SOURCES.md. These choices only change how the map
looks; no simulation result depends on them.
height when present (none in G-01), else building:levels × 3 m + 1 m (4 buildings), else a
default by type: house / detached / semi-detached / terrace / residential, and building=yes up to 800 m²: 4.5 m;
garage / carport / shed / roof / hut: 2.8 m; apartments: 10 m; retail / commercial / supermarket / office (or any
building with a shop tag): 6.5 m; school / college: 7 m; church or place of worship: 10 m; hospital: 9 m;
industrial / warehouse: 7 m; hotel: 10 m; building=yes over 800 m²: 6.5 m. Rounded to 0.5 m.building=yes with no height or levels. Victor Harbor is mostly single-storey
detached houses (about 3 m walls plus a pitched roof, so about 4.5 m to the ridge); footprints over 800 m² are
shops, halls and sheds with high single-storey roofs. The type defaults are typical heights for one-storey
outbuildings, two-storey schools and shops, and three-storey apartment and hotel blocks.c): from the building value, then amenity / shop / tourism tags; plain building=yes with
no other tag is other (not guessed to be a house), so most buildings are other.landuse=construction (10 new housing estates) and landuse=quarry (1) are left out: they have no class in the
map style. leisure=nature_reserve, swimming_pool and playground areas are left out too.viewer/basemap/SOURCES.md). The 1 m and 5 m thresholds deal with noise in the source near the coast; a lower
coast (beaches under 1 m) would be drawn as sea, a 30–50 m effect at this scale.