London Underground Map Data - The Data Format

London Underground Map Data Format

The map data in the data file is designed to store information in a form which is suitable for insertion into a relational database. Effectively, the records described below are relational tables without the foreign keys connected. Connecting the foreign keys to a suitable generated primary key values is what the data manipulation program does.

The diagram below is really of the database table, but it should also be useful in trying to understand the text file content. Note that both the diagram and the description below make reference to station alignments, which are no longer extant.

The map contains the following things: In general, the records in the data file all follow the form -
<record type> TAB <comma delimited data>

The individual records are defined as follows:

LINE Type String: line

Format: <line code>,<colour>,<name>
STATION Type String: station

Format: <name>,<zone>,{<default quadrant>}

... where <zone> is the zone number for stations in only one zone but both zone numbers separated by 'b' for zone border stations (eg 2b3);
and <default quadrant> is the quadrant compass point if all nodes in the station lie in the same quadrant. Quadrant boundaries are signified by specifying the half.

STATION NODE Type String: node

Format: <line code>,<ordinal>,({<flags>}),(<x>,<y>){,<quadrant>}

... where {...} indicate something optional;
and <flags> includes an 'i' for an interchange and a 't' for a terminus (eg Stratford (DL) would be it);
and <x>,<y> are in pixel coordinates relative to Tottenham Court Road;
and <quadrant> is defined in the same way as for <default quadrant above>, and is only needed where the node quadrant varies from that default.

Note: the station of which a particular node is deemed to be a part is the most recently named one.

LINE SEGMENT Type String: line

Format: <direction>,({<flags>}),<to station>:<node ordinal>

... where <direction> is a compass direction;
and <flags> are 'p' for peak only line sections.

Note: the <from station>:<node ordinal> is taken to be the most recently defined node.