Input files#
Every file openmobisim reads, with the columns its readers take. A column not listed is ignored. Names of columns are matched without regard to case unless a section says otherwise. Coordinates are WGS84 longitude and latitude in degrees; times of day are seconds after midnight; every other unit is stated in the table.
All tables on this page share one layout: Column, Type, Unit, Required (yes, or no), Default (what an absent column or an empty cell means) and Meaning.
Example files. openmobisim_example_inputs.zip holds a small
file in each format below, made from the package’s toy network and read back by its reader: a GMNS network,
trips, traveller classes, zones and an origin–destination matrix. Its README.txt gives the line that reads each.
Demand#
Trips: trips.parquet, trips.csv or rows in memory#
One row per trip. openmobisim.Scenario.from_parts() takes the path of a trips.parquet file, the path of a
trips.csv file (read by openmobisim.demand_read_trips()), or the rows themselves as tuples in the column order
below (nine fields, or ten with the mode). In a Parquet file the column names must be exactly these (lower case).
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string or integer |
— |
yes |
— |
Who travels. An integer and its text are the same id. |
|
whole number ≥ 0 |
— |
yes |
— |
The trip’s place in its traveller’s day. |
|
float |
degrees |
yes |
— |
Where the trip starts. |
|
float |
degrees |
yes |
— |
|
|
float |
degrees |
yes |
— |
Where it ends. |
|
float |
degrees |
yes |
— |
|
|
whole number ≥ 0 |
s after midnight |
yes |
— |
When it leaves. A trip departing outside the simulation window is left out of the run, with a |
|
string or integer |
— |
yes |
— |
The traveller class (see the class table). |
|
whole number ≥ 1 |
people |
no |
the scenario’s |
How many people the traveller stands for. A property of the traveller: the first row’s value is kept. |
|
string |
— |
no |
none stated |
|
A traveller’s day is a chain. Trips are ordered by trip_seq; where trip n + 1’s stated origin differs from trip
n’s destination, the chain wins (the origin is replaced) and the run records trip_chain_origin_overridden in
diagnostics.parquet. Two rows with the same trip_seq keep the first (duplicate_trip_seq); rows that disagree on
weight or user_class keep the first (inconsistent_traveller_weight, inconsistent_user_class). A required column
with an empty value (null) in a Parquet file is refused.
openmobisim.demand_write_trips() writes rows as a trips.csv with exactly these columns, an empty cell for a
missing weight or mode.
Persons: persons.parquet or rows in memory (optional)#
One row per traveller whose ownership or class differs from their class’s. Scenario.from_parts(persons=...) takes the
file’s path or rows as tuples (traveller_id, owns_car, owns_bike, has_transit_pass, user_class), None for “no
override”.
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string or integer |
— |
yes |
— |
Must name a traveller of the trips; a row that names none is ignored ( |
|
boolean |
— |
no |
the class’s |
Whether the traveller has a car (needed for |
|
boolean |
— |
no |
the class’s |
Whether the traveller has a bike (needed for |
|
boolean |
— |
no |
the class’s |
Whether the traveller holds a transit pass. |
|
string |
— |
no |
the trips’ |
Replaces the class the trips state. |
A second row for the same traveller is dropped (duplicate_person_row); each traveller overridden is counted
(ownership_overridden).
Zones: zones.csv#
Read by openmobisim.demand_read_zones(), for turning an OD matrix into trips.
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The zone; an id listed twice is refused. |
|
float |
degrees |
yes |
— |
The zone’s point (GMNS’s names first). |
|
float |
degrees |
yes |
— |
Zone points: zone_points.csv (optional)#
Read by openmobisim.demand_read_zone_points(): where within a zone its trips start and end, so that trips are
placed where the buildings are (homes as origins, workplaces as destinations) instead of around the zone’s point.
Given to openmobisim.demand_from_od() as zone_points, a zone that has points draws each trip end among them
by weight; a trip within such a zone ends at a point other than its origin’s when the zone has more than one; a zone
without points keeps the rule of spread_m and points_per_zone. A starter case names the table in its case.json.
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
A zone of the zones table; several rows per zone. |
|
float |
degrees |
yes |
— |
The point. |
|
float |
degrees |
yes |
— |
|
|
float ≥ 0 |
— |
no |
1 |
How likely a trip from the zone starts here, relative to the zone’s other points (for example its residents). |
|
float ≥ 0 |
— |
no |
1 |
How likely a trip to the zone ends here (for example its workplaces). A zone whose weights are all 0 draws uniformly. |
OD matrix: od.csv#
Read by openmobisim.demand_read_od(); openmobisim.demand_from_od() turns it into trips (whole trips per
cell, one traveller per trip, departures drawn in the window, trip ends spread around the zone’s point).
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
A zone of the zones table. |
|
string |
— |
yes |
— |
|
|
float ≥ 0 |
people |
yes |
— |
How many trips; may be fractional. |
|
whole number |
s after midnight |
no |
|
The departure window’s start. |
|
whole number |
s after midnight |
no |
|
Its end. |
|
string |
— |
no |
|
The class of these trips. |
|
string |
— |
no |
none stated |
The mode, as in the trips table. |
Traveller classes: classes.csv or a dict#
Read by openmobisim.demand_read_classes(), or given to Scenario(classes=...) as {class: {column: value}}.
One row per class; a class must not repeat. A column not in this table and not a beta_* coefficient is refused, with
the list.
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The class, as the trips’ |
|
float ≥ 0 |
share of people |
no |
none |
The share of the people in the class, read only by |
|
list, |
— |
no |
every mode the run offers |
The modes its travellers may use, among |
|
|
— |
no |
as the modes imply |
A car, unless a persons row says otherwise. Implied when the class may use |
|
|
— |
no |
as the modes imply |
A bike; implied by |
|
|
— |
no |
|
A transit pass: a holder pays no fare. Never implied: a pass is money, not access (who may take transit is said by |
|
float |
per unit of the attribute |
no |
the choice model’s |
The class’s own coefficient for the built-in logit and nested logit (for example |
|
float > 0 |
s |
no |
|
The longest walk offered to the class’s trips choosing their mode; |
|
float > 0 |
s |
no |
|
The longest bike ride offered. |
|
finite float > 0 |
s |
no |
|
The longest walk to or from a stop. |
A class not listed (all of them, without a class table) may use every mode, with the model’s coefficients, and owns a car and a bike, and holds no transit pass, unless a persons row says otherwise.
Parkings: a parking table#
Read by openmobisim.parking_read_table(): a CSV or TSV file (the delimiter found from the header), its text,
or rows as dicts. One row per parking. A run snaps each parking to its vehicle’s layer and to the walk layer and keeps
it only if a stop is within parking_options walk_max_s on foot.
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
Unique in the table. |
|
float |
degrees |
yes |
— |
Where it is. |
|
float |
degrees |
yes |
— |
|
|
string |
— |
yes |
— |
|
|
whole number ≥ 0 |
vehicles |
yes |
— |
How many vehicles it holds. A full parking refuses nobody; parking there takes longer. |
|
string |
— |
no |
none |
A name, for figures and tables. |
|
string |
— |
no |
its own hub |
Rows sharing one join one hub (a station’s car park and its bike parking). |
|
whole number ≥ 0 |
vehicles |
no |
0 |
Vehicles parked when the day starts. |
|
float ≥ 0 |
€ per stay |
no |
|
What a stay costs, seen by choice models as |
openmobisim.parking_read_osm() reads parkings from OpenStreetMap instead (see below).
Networks#
A link table and a node table#
Read by openmobisim.network_read_table(): a CSV or TSV file, a TNTP-style file (a ~-headed, ;-terminated
table, its <…> metadata lines skipped), its text, or rows as dicts. The first alias present in a row wins. One row is
one directed link: a two-way street is two rows. Fields may not contain the delimiter (no quoting). A value not given
comes from the road class’s row of the parameters (network group), as an untagged OpenStreetMap way’s
would.
Links:
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The link’s start node. |
|
string |
— |
yes |
— |
Its end node. |
|
string |
— |
no |
|
The link’s id. |
|
float |
|
no |
the straight line between its nodes |
Its length. |
|
whole number |
lanes |
no |
the class’s |
Lanes in this direction. |
|
float |
|
no |
from |
Its free-flow speed. A column named |
|
float |
|
no |
— |
Read only without a speed, and only with a length: the speed is length over time. |
|
float |
PCU/h, the whole link |
no |
the class’s per lane × lanes |
Its capacity; a link whose capacity is given is not capped at signals. |
|
string |
— |
no |
|
A road class name ( |
|
boolean ( |
— |
no |
false |
Part of a roundabout’s circulating carriageway: entering traffic gives way. |
|
boolean |
— |
no |
false |
A signal at the link’s end that stops this link alone (one direction’s stop line). |
Nodes (optional):
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The node, as the links name it; a row without one is skipped. |
|
float |
degrees, or the table’s own unit with |
no |
0 |
Its position. With |
|
float |
as |
no |
0 |
|
|
boolean |
— |
no |
false |
A signalised node: every approach gets a control delay and a green fraction. |
|
boolean |
— |
no |
false |
A signal stands here but stops only the links whose own |
Without a node table, the nodes are laid out on a grid layout_spacing_m apart, for figures only.
GMNS: node.csv, link.csv, config.csv#
GMNS, the General Modeling Network Specification, is a plain-CSV network
standard. openmobisim.network_read_gmns() reads either one GMNS folder (the road network; its bike and walk
layers are then derived from it) or a folder holding road/, bike/ and walk/ GMNS folders, as
openmobisim.network_write_gmns() writes them (each layer read as written). A link whose directed is false
becomes two links. Units are converted once, on reading, from config.csv; a link’s geometry is not read.
config.csv (optional; metres and km/h without it):
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
no |
|
The length unit: |
|
string |
— |
no |
|
The speed unit: |
|
string |
— |
no |
WGS84 |
Only |
node.csv:
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The node. |
|
float |
degrees |
yes |
— |
Longitude. |
|
float |
degrees |
yes |
— |
Latitude. |
|
string |
— |
no |
none |
|
|
string |
— |
no |
|
With |
link.csv:
Column |
Type |
Unit |
Required |
Default |
Meaning |
|---|---|---|---|---|---|
|
string |
— |
yes |
— |
The link ( |
|
string |
— |
yes |
— |
Its start node. |
|
string |
— |
yes |
— |
Its end node. |
|
boolean |
— |
no |
true |
|
|
float |
|
no |
the straight line |
Its length. |
|
float |
|
road: no; bike and walk: yes |
the class’s |
Its free-flow speed (on the bike and walk layers, the speed ridden or walked). |
|
string |
— |
no |
from |
The road class name. |
|
whole number |
lanes |
no |
the class’s |
Road layer. |
|
float |
PCU/h per lane (GMNS’s convention) |
no |
the class’s |
Road layer: multiplied by the lanes on reading. |
|
list, |
— |
no |
all |
Road layer: a link that names uses but not |
|
boolean |
— |
no |
false |
Road layer (an openmobisim column). |
|
boolean |
— |
no |
false |
Road layer: a signal stopping this link alone (an openmobisim column). |
|
string |
— |
no |
|
Bike layer: |
What openmobisim.network_write_gmns() writes: one folder per layer (road/, and with layers=True
bike/ and walk/), each with node.csv (node_id, x_coord, y_coord, and ctrl_type on the road layer),
link.csv (link_id, from_node_id, to_node_id, directed always true, length in m, free_speed in km/h,
facility_type; on the road layer lanes, capacity per lane, allowed_uses, roundabout, signal; on the bike
layer bike_facility; with geometry=True the link’s polyline as WKT) and config.csv (m, kmh, EPSG:4326). Ids
are the network’s own indices, zero-padded, so a network read back keeps its order but not its earlier ids.
OpenStreetMap: .osm.pbf#
openmobisim.network_read_osm() reads an extract into the road network and its bike and walk layers. A tag it
cannot interpret falls back to the road class’s default and is counted in Network.report_import(); nothing stops the
import. These are the tags it reads.
Roads (the car network):
Tag |
Values read |
Effect |
|---|---|---|
|
|
The road class; a way of another value is not a road. |
|
|
Left out (a square, not a way). |
|
|
Left out, unless |
|
|
With |
|
|
Direction. Without it, |
|
|
One-way; |
|
whole numbers |
Lanes per direction: the directional tags win; else the total, all of it on a one-way street, half (rounded down, at least 1) each way on a two-way one. Absent: the class’s. |
|
a number (km/h), or with |
The free-flow speed; a list takes its first value. |
Nodes:
Tag |
Values read |
Effect |
|---|---|---|
|
|
A signal: the approaches it stops get a control delay and their turns a green fraction. Not when |
|
|
The signal stops only the traffic going that way along the way (a stop line). Without it, a signal within |
|
|
The way is split at the node. |
The bike layer:
Tag |
Values read |
Effect |
|---|---|---|
(every road but motorways and |
— |
A bike link in mixed traffic, in the road’s directions. |
|
|
No bike link. |
|
|
Footways, paths, tracks, steps and pedestrian streets carry bikes (shared with pedestrians; separated if |
|
|
The bike is walked: walking speed. |
|
|
A separated track. |
|
a lane or a track |
Dedicated infrastructure on that side: on a two-way street the right side serves the way’s direction and the left the reverse (right-hand traffic assumed); on a one-way street a lane on either side serves its direction. |
|
|
Opens the contraflow on a one-way street (mixed, or the lane or track named). |
|
|
Overrides the road’s direction for bikes. |
|
|
A cycle street: counted as a lane. |
|
|
A ferry crossing, ridden unless |
The walk layer: every way with a highway tag is walked, both ways, except motorways and their slip roads,
motorroad=yes, foot=no, foot=use_sidepath, areas, ways with access=no/private unless foot is yes,
designated or permissive, and busways unless foot allows. Cycleways are walked unless foot=no. Ferries are walked
unless foot=no.
Region: with region (a rectangle or a polygon), nodes outside are dropped; with region_stubs each road keeps its
first node outside, and with region_buffer_m motorways, trunk roads and their slip roads within that distance are kept
(2 000 m by default; a main road cut by the buffer’s edge is joined to its other carriageway by a turnaround).
connectivity="strong" keeps only the largest part of the car network in which every node reaches every other.
OpenStreetMap parkings#
openmobisim.parking_read_osm() reads park-and-ride car parks and bike parkings from an extract, from nodes and
ways (an area’s centroid), inside the region if one is given.
Tag |
Values read |
Effect |
|---|---|---|
|
|
A car park, kept only if it is a park-and-ride: |
|
|
A bike parking. |
|
|
Left out. |
|
a number |
Its capacity; else, for an area, its ground area over |
A node inside an area of the same kind is the same parking mapped twice and is left out; parkings of one kind closer
than merge_m (100 m) are merged into one site, capacities added. The five numbers are arguments of
parking_read_osm, uncalibrated defaults.
Timetables: GTFS#
openmobisim.transit_read_gtfs() reads one service day of a GTFS feed (a
zip, or a folder of its .txt files): the date given, else the busiest weekday (the Monday to Friday with the most
trips in service, the earliest on a tie, within a year of the feed’s first date). With a network, only the stops
within 300 m of its walk layer’s nearest node are kept, and each run keeps its calls at them; a run left with fewer than
two calls is dropped. A row that cannot be read (a bad number, an unknown stop or trip) is skipped and counted in
Transit.report; only a missing file or column, or a day with no service, is an error.
File |
Columns read (required in bold) |
What is kept |
|---|---|---|
|
|
Stops and platforms ( |
|
|
The line’s name (the short name, else the long one) and kind: |
|
|
The trips in service on the day. |
|
|
Which services run on the day. |
|
|
Exceptions to the calendar. |
|
|
The calls of the day’s trips, in sequence. |
|
|
Stop-to-stop minimum transfer times: |
|
|
A listed trip is a template: it runs from each row’s start, every headway, while before its end, one run each, named |
Not read: agency.txt, shapes.txt, fares, and trips of the previous service day that run past midnight into this
one.