Maps/Transport for London/Lines

From Bjoern Hassler's website
Jump to: navigation, search

Template:Sketch Line

1 London Underground - working out the lines[edit]

7225135 (XML, iD, JOSM, Potlatch2, history, analyse, manage, gpx)

1.1 Overpass[edit]

The routes are all there. However, few routes have route masters.

List:

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
[out:csv(::type,::id,network,type,ref,name)][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]}}
(
  relation{{sel}};
);
out meta qt;

View all lines on map:

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
[out:json][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]}}
(
  relation{{sel}};
);
out geom qt;

1.2 Table: All relations[edit]

The above overpass query produces a table. Here's a similar table, with some links put in.

@type @id network type name Sketch
relation 6354922 (JOSM) London Underground route_master Victoria Victoria
relation 102768 (JOSM) London Underground route Central Central
relation 102770 (JOSM) London Underground route District District
relation 102773 (JOSM) London Underground route Jubilee line Jubilee
relation 102783 (JOSM) London Underground route Metropolitan Metropolitan
relation 102787 (JOSM) London Underground route Hammersmith & City Hammersmith & City
relation 102788 (JOSM) London Underground route Piccadilly Piccadilly
relation 102767 (JOSM) London Underground route Northern Northern
relation 102769 (JOSM) London Underground route Circle Circle
relation 102771 (JOSM) London Underground route Bakerloo Bakerloo
relation 309383 (JOSM) London Underground route Piccadilly Piccadilly
relation 6354920 (JOSM) London Underground route Victoria Line: Brixton => Walthamstow Central London Underground
relation 6354921 (JOSM) London Underground route Victoria Line: Walthamstow Central => Brixton London Underground
relation 102762 (JOSM) London Underground route Waterloo & City Waterloo & City

2 Inspecting the route relations[edit]

The stops should be ordered. Also, part of each route are certain features such as stops, as well as platforms. Lets check these.

2.1 Checking order of stops: route diagrams[edit]

Now that we have the lines, let's look at some diagrams to check the order of stops. This doesn't work well - the data in OSM isn't well organised for many lines. E.g.

Use the above table for more.

The order of stops are usefully inspected in JOSM.

2.1.1 Query[edit]

This query is not useful, as the order of stops is not preserved. Though it tells you which stops have names.

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
[out:csv(::type,::id,name)][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]["name"="Central"]}}
(
  relation{{sel}};
)->.a;
(node(r.a:"stop"))->.stops;
out meta qt;

However, you could do this:

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
// stops in order
//[bbox:{{bbox}}]
[out:csv(::type,::id,ref,name,railway,public_transport;true;" || |")][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]["name"="Central"]}}
(
  relation{{sel}};
)->.a;
(
  node(r.a:"stop");
)->.stops;
foreach.stops (
  out meta;
);

This fetches stops and platforms - not perfect, but the only way I can think of:

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
// stops and platforms in order
//[bbox:{{bbox}}]
[out:csv(::type,::id,ref,name,railway,public_transport;true;" || |")][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]["name"="Central"]}}
(
  relation{{sel}};
)->.a;
(
  node(r.a:"stop");
// I don't know of a way that would also get the platforms in order by including them here:
//  way(r.a:"platform");
)->.stops;
// Instead:
way(r.a:"platform")->.plats;
foreach.stops (
  out meta;
  // The loop places the stop into ._
  // See whether a platform (in the relation) is near.
  way.plats(around:50);  
  // The problem is this duplicates the platforms - but if the route was properly defined, then it would be ok.
  out meta;
);

Sample output available.

2.2 Checking tagging of stops[edit]

You can also see in the line diagrams that some stops do not have names. Check that the object entered as "stop" is appropriately tagged.

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
// stops - check
//[bbox:{{bbox}}]
[out:json][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]["name"="Central"]}}
(
  relation{{sel}};
)->.a;
(node(r.a:"stop"))->.stops;
(.stops);
out meta qt;
(way(r.a:"platform");)->.plats;
(.a; .plats);
out meta qt;
>;
out skel qt;
(
way(around.stops:20)[railway=platform];
way(around.stops:20)[public_transport=platform];
)->.b;
(.a; .b;);
out meta qt;
>;
out skel qt;
{{style:
node {
  color: magenta;
  fill-color: magenta;
  symbol-size: 25; 
}
node[railway=stop], node[public_transport=stop_position] {
  color: red;
  fill-color: red;
}
node[name] {
  color: blue;
  fill-color: yellow;
  symbol-size: 10; 
}
node[name][railway=stop], node[name][public_transport=stop_position] {
  color: blue;
  fill-color: blue;
}
node[name][railway=stop][public_transport=stop_position] {
  color: green;
  fill-color: green;
  symbol-size: 10;
}
way {
  color: red;
  symbol-size: 3;
  fill-color: yellow;
}
relation way {
 	color: green; 
    symbol-size: 2;
    fill-color: green;
}
}}

The following script was developed first, and is incorporated in the above script (with slightly changed MapCSS).

2.3 Checking for platforms[edit]

This query checks for platforms. Platforms that are already in the relation are in green. The query then looks for nearby platforms (i.e. platforms near stops.) - those are in red. This work well is you have "show small objects as points". You can easily spot issues that way.

Overpass-turbo (run)
Overpass-turbo (run)
Overpass-turbo (view)
// nodes as stop with plats
//[bbox:{{bbox}}]
[out:json][timeout:25];
{{sel=["network"~"London Underground"]["type"~"route"]["name"="Central"]}}
(
  relation{{sel}};
)->.a;
(node(r.a:"stop"))->.stops;
(.stops);
out meta qt;
(way(r.a:"platform");)->.plats;
(.a; .plats);
out meta qt;
>;
out skel qt;
(
way(around.stops:20)[railway=platform];
way(around.stops:20)[public_transport=platform];
)->.b;
(.a; .b;);
out meta qt;
>;
out skel qt;
{{style:
node {
  color: blue;
  fill-color: blue;
  set color=green;
}
way {
  color: red;
  symbol-size: 30;
  fill-color: yellow;
}
relation way {
 	color: green; 
    symbol-size: 28;
    fill-color: green;
}
}}

3 Route variations[edit]

As there aren't many route_masters, the route usually contains all variations. Let look at the central line. The central line route now needs breaking up into 5+ routes in each direction. The core part of the central line (North Acton -> Leytonstone, indicated by "...") is served by all routes, but towards either end of the line, these combinations are possible:

  1. West Ruislip -> ... -> Woodford -> Epping
  2. West Ruislip -> ... -> Woodford -> Hainault
  3. West Ruislip -> ... -> Newbury Park -> Hainault
  4. Ealing Broadway -> ... -> Newbury Park -> Hainault
  5. Ealing Broadway -> ... -> Epping
  6. ... sometimes the Epping trains terminate in Loughton (rather than continue to Epping), which strictly speaking is probably a separate route (or possibly two, as variants of 1 and 5)

Plus the same routes in reverse:

  1. Epping -> Woodford -> ... -> West Ruislip
  2. Hainault -> Woodford -> ... -> West Ruislip
  3. Hainault -> Newbury Park -> ... -> West Ruislip
  4. Hainault -> Newbury Park -> ... -> Ealing Broadway
  5. Epping -> Woodford -> ... -> Ealing Broadway
  6. Not sure whether trains can also start in Loughton, but presumably they can.

C.f. https://tfl.gov.uk/tube/route/central/

So this means that there would be about 5+5 routes (or perhaps 6+6) that would need to be created, and then combined into a route_master.

3.1 Route variations for all lines[edit]

Network Line Variations (per direction) Link
London Underground Bakerloo 1 https://tfl.gov.uk/tube/route/bakerloo
Central 5 https://tfl.gov.uk/tube/route/central/
Circle 1 https://tfl.gov.uk/tube/route/circle
Hammersmith & City 1 https://tfl.gov.uk/tube/route/hammersmith-city
Jubilee 1 https://tfl.gov.uk/tube/route/jubilee
Metropolitan 5 https://tfl.gov.uk/tube/route/metropolitan/
Northern 6 (all from/to Morden) https://tfl.gov.uk/tube/route/northern/
Picadilly 3 (all from/to Cockfosters) https://tfl.gov.uk/tube/route/piccadilly/
Victoria 1 https://tfl.gov.uk/tube/route/victoria
Waterloo & CIty 1 https://tfl.gov.uk/tube/route/waterloo-city
London Overground 12 https://tfl.gov.uk/overground/route/london-overground/
TfL Rail 1 https://tfl.gov.uk/tflrail/route/tfl-rail/
DLR 5 https://tfl.gov.uk/dlr/route/dlr/
Tram 4 https://tfl.gov.uk/tram/route/tram/