Mapping TIPLOC to CRS (Network Rail Data)

712 views
Skip to first unread message

RailAleFan

unread,
Jan 21, 2023, 6:44:40 AM1/21/23
to A gathering place for the Open Rail Data community
Hi all,

I want to move my timetable consumer codebase over to the Network Rail JSON feeds and ultimately want to use CRS rather than TIPLOC to access relevant schedules and want to do this mapping at import time.

However, CORPUS does not appear to have 3ALPHA populated for all TIPLOCs specific to a location; for example Clapham Junction;

{
    "NLC": 559500,
    "STANOX": "87219",
    "TIPLOC": "CLPHMJN",
    "3ALPHA": "CLJ",
    "UIC": "55950",
    "NLCDESC": "CLAPHAM JUNCTION LONDON",
    "NLCDESC16": " "
}
{
    "NLC": 559572,
    "STANOX": "87219",
    "TIPLOC": "CLPHMJW",
    "3ALPHA": " ",
    "UIC": "55957",
    "NLCDESC": "CLAPHAM JN (WINDSOR)",
    "NLCDESC16": " "
}

Looking at the above, I noticed that STANOX is common; so I tried processing CORPUS in 2 passes first mapping STANOX to 3ALPHA and creating a TIPLOC to 3ALPHA lookup table from that, but that only worked as far as Reading;

{
    "NLC": 314900,
    "STANOX": "74237",
    "TIPLOC": "RDNGSTN",
    "3ALPHA": "RDG",
    "UIC": "31490",
    "NLCDESC": "READING",
    "NLCDESC16": " "
}
{
    "NLC": 312800,
    "STANOX": "74236",
    "TIPLOC": "RDNG4AB",
    "3ALPHA": "RDZ",
    "UIC": "31280",
    "NLCDESC": "READING PLATFORMS 4A&B",
    "NLCDESC16": " "
}


...which has 2 gotchas - a 3ALPHA associated with "RDNG4AB" that isn't "RDG", and also different values for STANOX.

Am I missing something!?

I've got all the data I need from Darwin but i'd like to complete my understanding of how TIPLOCs can be associated with CRS codes as used by the public solely from Network Rail data if possible...

Cheers

RailAleFan

unread,
Jan 21, 2023, 9:56:32 AM1/21/23
to A gathering place for the Open Rail Data community
Just to add sorry, the TiplocV1 records included in the schedule feed match CORPUS;

{
  "TiplocV1":
  {
    "transaction_type":"Create",
    "tiploc_code":"RDNG4AB",
    "nalco":"312800",
    "stanox":"74236",
    "crs_code":"RDZ",
    "description":null,
    "tps_description":"READING"
  }
}


Cheers

Ian Sargent

unread,
Jan 23, 2023, 4:09:49 AM1/23/23
to A gathering place for the Open Rail Data community
Whereas the majority of passenger locations around the country have a 1-to-1 relationship between the TIPLOC and the CRS code, there are around 150 locations with more than one TIPLOC to describe specific parts of stations for operating reasons. For instance, HROW is used for "main line" platforms at Harrow & Wealdstone, whilst HROWDC is used to describe the two "DC" platforms for the Euston-Watford Junction local services at the same station. For retail and journey planning purposes, both should be mapped the HRW CRS Code.

To complicate things further, between 12-15 locations with multiple TIPLOCS have two CRS codes - this being a consequence of the requirements of one particular system that was consigned to history some years back. For these locations that second CRS code can be ignored, e.g. RDZ for RDNG4AB should be put to one side and RDG used instead.

N.B. At Clapham Junction there are 5 or 6 TIPLOCs that need to be taken account of, not just the two in your list.

RailAleFan

unread,
Jan 24, 2023, 12:38:49 PM1/24/23
to A gathering place for the Open Rail Data community
Hi Ian,

Thanks for that - this is my first in-depth foray into the Network Rail data and wasn't aware of the legacy CRS/3ALPHA codes in use at some locations!

> For these locations that second CRS code can be ignored, e.g. RDZ for RDNG4AB
> should be put to one side and RDG used instead.

My question really is can that be resolved programmatically purely from official Network Rail data, or is it only possible with reference to other sources, in my case Darwin?

Cheers

Ian Sargent

unread,
Jan 25, 2023, 4:59:44 AM1/25/23
to A gathering place for the Open Rail Data community
From the 1960s onwards, five separate location codes ranges were developed for different purposes: National Location Code (NLC), STANOX, TIPLOC, CRS Code and UIC Code. When each of the systems were developed they were standalone. That wasn't really a problem at the time, but as integration across operating and retail systems has developed it has become necessary to find a way of linking them. 

A database known as CORPUS, with the NLC as the primary index, is the primary source of these codes; however it is still up to each downstream system to work out how best to link multiple instances of one code type with a single instance of any of the other code types to meet that system's particular needs. For instance, the location data file for the system that I help to maintain was compiled by hand in the early 1990s and has been updated bit by bit over the years - but it probably wouldn't be in a format that you could use.

The stations which spring to mind that have multiple CRS Codes are: Farringdon, Glasgow Central, Glasgow Queen Street, Highbury & Islington, Lichfield Trent Valley, Liverpool Lime Street, Liverpool South Parkway, London Liverpool Street, London Paddington, Reading, Retford, Tamworth, Whitechapel, Worcestershire Parkway. There may be a couple of others but if so I can't recall them at the moment.

As for which of the 11½ thousand TIPLOCs identifies an advertised station stop: there are around 150 locations with 2-5 TIPLOCs for passenger purposes - some of which may only be used on occasion. The main TIPLOC at each station should be directly mapped to the CRS code in the data supplied by Network Rail, For the subsidiary TIPLOCs in permanent use you would need to search for examples of one of these passenger activity codes in the train schedules: D, R, T, U. Be warned though that sometimes these passenger activity codes are mistakenly applied to non-passenger locations such as junctions and passing points.

Tom Cairns

unread,
Jan 25, 2023, 5:29:50 AM1/25/23
to openrail...@googlegroups.com

I have a mapping list of TIPLOC merges for RTT which I’ve pasted below… from memory Willesden Junction is a bit of a special case as the TIPLOC list from CIF (which is where I derive my stuff from) doesn’t have Willesden Junction/WIJ at all. I have a separate list of stations with ‘main’ TIPLOC/CRS/description. This list then maps against that to merge the TIPLOCs together.

 

ASHFKY ASHFKI

ABWD   ABWDXR

ALERTN LVRPSPY

AXMNSTR           AXMNSTS

BCKNHMJ           BCKNMJC

BUSHEY BUSHYDC

CLPHMJN            CLPHMJ1

CLPHMJN            CLPHMJ2

CLPHMJN            CLPHMJC

CLPHMJN            CLPHMJW

CLPHMJN            CLPHMJM

CNNB    CNNBELL

EBSFDOM           EBSFLTI

FRNDNLT            FRNDXR

FRNDNLT            FNTLSR

GALTILL GALTINT

GLGC     GLGCLL

GLGQHL              GLGQLL

GROSMNT          GROSNYM

HGHI     HIGHBYA

HGHI     HIGHBYE

HROW  HROWDC

LCHTTVL             LCHTTVH

LIVST     LIVSTLL

LNDNBDG           LNDNBDC

LNDNBDG           LNDNBDE

LVRPLCH             LVRPLCL

LVRPLSH             LVRPLSL

MORFLDS           MORFNL

NEWXGTE          NEWXGEL

NWCROSS          NWCRELL

OXTED  OXTEDBY

PADTON             PADTLL

PCKHMRY           PKHMRYC

PHBR     POMOHSP

PHBR     POMOPLD

QPRK     QPRKAC

RDNGSTN           RDNG4AB

RDNGSTN           RDNGBUS

RICHMND           RICHNLL

RTFD     RTFDLL

RYDP     RYDCATS

SHOTTON           SHOTTHL

STANSTD            STANMFC

STFODOM          STFORDI

STPX      STPANCI

STPX      STPXBOX

STPX      STPADOM

STRBDGJ             STRBDG1

TMWTHLL          TMWTHHL

UPMNSTR           UPMNSP6

VAUXHAL           VAUXHLM

VAUXHAL           VAUXHLW

VICTRIA VICTRIC

VICTRIA VICTRIE

WATFDJ              WATFJDC

WATRLOO          WATRLMN

WATRLOO          WATR

WATRLOO          WATRLOW

WCHAPEL           WCHAPXR

WEYBDGE          WEYBDGB

WIMBLDN          WDON

WLSD    WLSDNJL

WLSD    WLSDJHL

WMBY  WMBYDC

WORCPWY         WORCPHL

WREXHMG         WREXGUB

 

 

Tom

 

--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openraildata-talk/988b4d14-b0ac-4546-a203-fe2c2fdd0f8fn%40googlegroups.com.

Ian Sargent

unread,
Jan 25, 2023, 8:01:46 AM1/25/23
to A gathering place for the Open Rail Data community
" Willesden Junction is a bit of a special case as the TIPLOC list from CIF (which is where I derive my stuff from) doesn’t have Willesden Junction/WIJ at all"

In CORPUS, WIJ is attached to TIPLOC "WLSD" - which is the TIPLOC that was used to describe the station as a whole. However, it's effectively dormant as it is not used for train planning purposes, and so does not appear in the list of TIPLOCs in the CIF file.
Reply all
Reply to author
Forward
0 new messages