Data Structures

ESR 

 

 

 ESR Data Structure 

 

 - refnum (string) - this is made up of a route specific prefix, a three digit incremental counter, plus the two digit year 

 

 - speed (object) - "Freight Speed / Passenger Speed" - single number if both are same, units and unrestricted line speed 

 

 - route (object) - all properties of the route 

 - du (object) - responsible Delivery Unit 

 - elr (object) - ELR of track segment impacted e.g. LTN1 

 - lor (object) - LOR properties 

 - location (string) - description of where the restriction is applied, should be "At X" or "Between X and Y" 

 - reason (object) - describes reason the ESR is imposed 

 - withdrawn (bool) - 0 = active, 1 = withdrawn 

 - whenimposed (string) - W3C format date time string, updated during amendment 

 - etc (null|string) - if set this is a W3C format date time string 

 - whenwithdrawn (null|string) - if withdrawn === 1, W3C format date time string 

 - lines (array) - object for each "line". A "line" is the combination of ELR + TrackID 

     - elr (object) - as above 

     - trackId (int) - e.g. 1100 = Up Main 

     - direction (string) - "Up Direction" | "Down Direction" (yuk) 

     - linedescription (string) - can be driven by trackId or overridden by Controller 

     - routeheader (string) - "Primary Line" | "Additional Line" 

     - boards (array) 

         - type (string) - short name (no spaces) 

         - description (string) - long name 

         - elrId (int) - copied from line 

         - trackId (int) - copied from line 

         - miles (int) - 

         - chains (int) - 0 >= X < 80 

         - serialNumber (string) - not currently used 

         - marker (GeoJSON) 

 - references (object) 

 - updated_at - time of last database change 

   

 

 Example Response 

 

 {

 "id": 5,

 "refnum": "AICC 001.26",

 "speed": {

 "value": "40",

 "unit": "mph",

 "linespeed": "120"

 },

 "route": {

 "routecode": "EA",

 "routename": "Anglia",

 "shortname": "AICC",

 },

 "du": {

 "name": "Ipswich",

 "routeId": 2,

 },

 "elr": {

 "elrcode": "LTN1",

 "elrdescription": "LIVERPOOL STREET - TROWSE LOWER JN",

 },

 "lor": {

 "lorcode": "EA1011",

 "lordescription": "SEVEN KINGS TO IPSWICH",

 },

 "location": "At Colchester South Jn",

 "reason": {

 "reason": "Structural - Station",

 },

 "lines": [

 {

 "elr": {

 "elrId": 668,

 "elrcode": "LTN1",

 "elrdescription": "LIVERPOOL STREET - TROWSE LOWER JN",

 "active": true

 },

 "trackId": 1100,

 "routeheader": "Primary Line",

 "direction": "Up Direction",

 "linedescription": "Up Main",

 "newStyleBoards": true,

 "boards": [

 {

 "type": "commencement",

 "description": "Speed Indicator (Commencement)",

 "elrId": 668,

 "trackId": 1100,

 "miles": 50,

 "chains": 75,

 "serialNumber": null,

 "marker": {

 "type": "Feature",

 "geometry": {

 "type": "Point",

 "coordinates": [

 0.876876605,

 51.90208042

 ]

 },

 "properties": {

 "type": "commencement",

 "description": "Speed Indicator (Commencement)",

 "elrId": 668,

 "trackId": 1100,

 "miles": 50,

 "chains": 75,

 "serialNumber": null

 }

 }

 },

 {

 "type": "termination",

 "description": "Termination Indicator",

 "elrId": 668,

 "trackId": 1100,

 "miles": 49,

 "chains": 75,

 "serialNumber": null,

 "marker": {

 "type": "Feature",

 "geometry": {

 "type": "Point",

 "coordinates": [

 0.85427535,

 51.89894058

 ]

 },

 "properties": {

 "type": "termination",

 "description": "Termination Indicator",

 "elrId": 668,

 "trackId": 1100,

 "miles": 49,

 "chains": 75,

 "serialNumber": null

 }

 }

 }

 ]

 }

 ],

 "whenimposed": "2026-03-18 11:42:06",

 "etr": null,

 "withdrawn": false,

 "whenwithdrawn": null,

 "references": {

 "fmsnumber": "123",

 "ccilnumber": "23645657",

 "tsrreference": "",

 "tdanumber": "",

 "wo": "",

 "rdms": "",

 "trustcode": "",

 "owner": ""

 },

 "updated_at": "2026-03-18 11:42:06"

}