-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjourneyPlanner.js
177 lines (147 loc) · 81.9 KB
/
journeyPlanner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// Import packages from NPM
import readline from 'readline-sync'; // Obtain input from the terminal
import winston from 'winston'; // Logging package
// Creating a logger
const logger = winston.createLogger({
transports: [
new winston.transports.Console(),
new winston.transports.File({ filename: 'combined.log' })
]
});
// Logger types...
const ERROR = "ERROR";
const WARN = "WARN";
const INFO = "INFO";
// let locationData = 1;
// let busStops;
// let busInfo;
// let nearestStops = []
let startPostCode = "", destPostCode = "", directionsReqd = "";
const yesOrNo = /[YyNn]/;
let errorMessage = "";
// Main processing
while (true) {
try {
// Get the start postcode from the user via the terminal
// startPostCode = readline.prompt({ prompt: "Start postcode: " });
// if (!isPostCodeValid(startPostCode)) {
// errorMessage = `Start postcode, "${startPostCode}", is not valid`;
// logMessage(ERROR, errorMessage, logger); // To be confirmed...
// throw errorMessage;
// }
// Get the destination postcode from the user via the terminal
// destPostCode = readline.prompt({ prompt: "Destination postcode: " });
// if (!isPostCodeValid(destPostCode)) {
// errorMessage = `Destination postcode, "${destPostCode}", is not valid`;
// logMessage(ERROR, errorMessage, logger); // To be confirmed...
// throw errorMessage;
// }
// TEST:
startPostCode = "NW5 1TS";
destPostCode = "NW7 1QS";
// Call the Journey Planner API...
// const response = await fetch(`https://api.tfl.gov.uk/Journey/JourneyResults/${startPostCode}/to/${destPostCode}`)
// if (response.status != 200) {
// errorMessage = `Unable to get directions from ${postCode} to ${destPostCode}`;
// logMessage(ERROR, errorMessage, logger);
// throw errorMessage;
// }
// Obtain the Journey Planner data...
// const journeyPlanner = await directionsResp.json();
// ****************** TESTING - TO BE REMOVED ******************
const journeyPlanner =
{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.ItineraryResult, Tfl.Api.Presentation.Entities", "journeys": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Journey, Tfl.Api.Presentation.Entities", "startDateTime": "2024-07-06T13:22:00", "duration": 50, "arrivalDateTime": "2024-07-06T14:12:00", "alternativeRoute": false, "legs": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 16, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to Tufnell Park Station", "detailed": "Walk to Tufnell Park Station", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "Sanderson Close for 176 metres", "turnDirection": "STRAIGHT", "streetName": "Sanderson Close", "distance": 176, "cumulativeDistance": 176, "skyDirection": 232, "skyDirectionDescription": "SouthWest", "cumulativeTravelTime": 158, "latitude": 51.55475381281, "longitude": -0.14593243178, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Highgate Road, continue for 25 metres", "turnDirection": "RIGHT", "streetName": "Highgate Road", "distance": 25, "cumulativeDistance": 201, "skyDirection": 146, "skyDirectionDescription": "SouthEast", "cumulativeTravelTime": 181, "latitude": 51.55441740226, "longitude": -0.144561307, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn right", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Lady Somerset Road, continue for 356 metres", "turnDirection": "LEFT", "streetName": "Lady Somerset Road", "distance": 356, "cumulativeDistance": 557, "skyDirection": 55, "skyDirectionDescription": "NorthEast", "cumulativeTravelTime": 501, "latitude": 51.5542254906, "longitude": -0.14436716667000002, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn left", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Fortess Road, continue for 213 metres", "turnDirection": "LEFT", "streetName": "Fortess Road", "distance": 213, "cumulativeDistance": 770, "skyDirection": 23, "skyDirectionDescription": "NorthEast", "cumulativeTravelTime": 694, "latitude": 51.555122541139994, "longitude": -0.13968571992, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn left", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Brecknock Road, continue for 22 metres", "turnDirection": "SHARP_RIGHT", "streetName": "Brecknock Road", "distance": 22, "cumulativeDistance": 792, "skyDirection": 151, "skyDirectionDescription": "SouthEast", "cumulativeTravelTime": 714, "latitude": 51.55687347179, "longitude": -0.13838808012, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Take a sharp right", "trackType": "None" }] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000239, "position": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "LIFT", "incline": "DOWN", "stopId": 1000239, "position": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "UP", "stopId": 1000239, "position": "IDEST" }], "departureTime": "2024-07-06T13:22:00", "arrivalTime": "2024-07-06T13:38:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "platformName": "", "icsCode": "99999997", "commonName": "NW5 1TS", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55470819605, "lon": -0.14589101131 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUTFP", "platformName": "", "icsCode": "1000239", "individualStopId": "9400ZZLUTFP1", "commonName": "Tufnell Park Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.556801578780004, "lon": -0.13839101567 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55470819605, -0.14589101131],[51.55475381281, -0.14593243178],[51.55470148739, -0.14603553545],[51.55470171518, -0.14604995132],[51.55453676592, -0.14585470715],[51.55435407084, -0.14567461110],[51.55423769983, -0.14570819372],[51.55404670142, -0.14557171190],[51.55402781668, -0.14551478026],[51.55441740226, -0.14456130700],[51.55422549060, -0.14436716667],[51.55436403279, -0.14402975267],[51.55461301360, -0.14328393726],[51.55502200749, -0.14185360852],[51.55531042533, -0.14075995423],[51.55531735593, -0.14062984357],[51.55512254114, -0.13968571992],[51.55524698257, -0.13959409062],[51.55536243728, -0.13950282752],[51.55578023674, -0.13919726897],[51.55587794650, -0.13912115354],[51.55619780665, -0.13887728846],[51.55687347179, -0.13838808012],[51.55670020967, -0.13823647120],[51.55670019543, -0.13823648747],[51.55671703912, -0.13816365503],[51.55662226081, -0.13672494974],[51.55680159543, -0.13839098747]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 792.0, "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:22:00", "scheduledArrivalTime": "2024-07-06T13:38:00", "interChangeDuration": "4", "interChangePosition": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 13, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Northern line to Mill Hill East", "detailed": "Northern line towards Mill Hill East Station", "steps": [] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000147, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000147, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "WALKWAY", "incline": "LEVEL", "stopId": 1000147, "position": "AFTER" }], "departureTime": "2024-07-06T13:38:00", "arrivalTime": "2024-07-06T13:51:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUTFP", "platformName": "", "icsCode": "1000239", "individualStopId": "9400ZZLUTFP1", "commonName": "Tufnell Park Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.556801578780004, "lon": -0.13839101567 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUMHL", "platformName": "", "icsCode": "1000147", "individualStopId": "9400ZZLUMHL1", "commonName": "Mill Hill East Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.60818960822, "lon": -0.20984292593 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55680327183, -0.13839711183],[51.55689951670, -0.13832931327],[51.55763161584, -0.13799647073],[51.55840034681, -0.13770539970],[51.56028204411, -0.13728228294],[51.56072817027, -0.13706207443],[51.56463157469, -0.13489272274],[51.56463157469, -0.13489272274],[51.56540788084, -0.13446123541],[51.56573116894, -0.13443357409],[51.56624615565, -0.13458563996],[51.56659177215, -0.13483121442],[51.56763205524, -0.13578425795],[51.56920689056, -0.13698965340],[51.57056717942, -0.13827604715],[51.57165534122, -0.13941489132],[51.57253755895, -0.14004268465],[51.57644526034, -0.14376537380],[51.57693021952, -0.14429403762],[51.57745705060, -0.14519624840],[51.57775402794, -0.14583462701],[51.57775402794, -0.14583462701],[51.57804349059, -0.14645686725],[51.58011941533, -0.15093328589],[51.58354015602, -0.15802598298],[51.58524709195, -0.16136356065],[51.58660743619, -0.16382036952],[51.58678314879, -0.16413086110],[51.58725208124, -0.16492335875],[51.58725208124, -0.16492335875],[51.58755901247, -0.16544208734],[51.58853527381, -0.16691852042],[51.58989413772, -0.16871166088],[51.59147810087, -0.17110220630],[51.59209751902, -0.17218897162],[51.59269243716, -0.17343555740],[51.59468714477, -0.17796117859],[51.59608752801, -0.18128367192],[51.59619939372, -0.18153909118],[51.59793391160, -0.18554154082],[51.60101178762, -0.19274045749],[51.60101178762, -0.19274045749],[51.60147888149, -0.19383312862],[51.60266170592, -0.19648652011],[51.60484699848, -0.20177195587],[51.60541420567, -0.20299148093],[51.60679431763, -0.20562311460],[51.60766797294, -0.20748054585],[51.60788436760, -0.20810746537],[51.60805670544, -0.20879389261],[51.60818941029, -0.20984294789]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUACY", "name": "Archway Underground Station", "uri": "/StopPoint/940GZZLUACY", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUHGT", "name": "Highgate Underground Station", "uri": "/StopPoint/940GZZLUHGT", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUEFY", "name": "East Finchley Underground Station", "uri": "/StopPoint/940GZZLUEFY", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUFYC", "name": "Finchley Central Underground Station", "uri": "/StopPoint/940GZZLUFYC", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUMHL", "name": "Mill Hill East Underground Station", "uri": "/StopPoint/940GZZLUMHL", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "Northern", "directions": ["Mill Hill East Station"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "northern", "name": "Northern", "uri": "/Line/northern", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Outbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "tube", "name": "tube", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "1", "network": "tfl" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:38:00", "scheduledArrivalTime": "2024-07-06T13:51:00", "interChangeDuration": "4", "interChangePosition": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 5, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "240 bus to Mill Hill School", "detailed": "240 bus towards Edgware Station", "steps": [] }, "obstacles": [], "departureTime": "2024-07-06T14:05:00", "arrivalTime": "2024-07-06T14:10:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUMHL", "platformName": "A", "stopLetter": "A", "icsCode": "1000147", "individualStopId": "490000147A", "commonName": "Mill Hill East Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.60855414664, "lon": -0.21016075426 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->N", "icsCode": "1009907", "individualStopId": "490009907N", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.618811357770007, "lon": -0.22953287861000002 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.60857105245, -0.21005673366],[51.60865212228, -0.21009913239],[51.60873102360, -0.20996604976],[51.60892349008, -0.21020399670],[51.60983067109, -0.21190128322],[51.60983067109, -0.21190128322],[51.60991390413, -0.21205701338],[51.61038234795, -0.21270297062],[51.61124183897, -0.21363688884],[51.61205309480, -0.21435608658],[51.61323455307, -0.21458414937],[51.61345966517, -0.21460420337],[51.61362208837, -0.21464116108],[51.61401006269, -0.21472704409],[51.61436757675, -0.21517522181],[51.61465262858, -0.21550796193],[51.61465262858, -0.21550796193],[51.61483446814, -0.21572022540],[51.61520030735, -0.21612475987],[51.61530091838, -0.21623636887],[51.61573207656, -0.21679723913],[51.61649815847, -0.21809611589],[51.61708864759, -0.21967635929],[51.61721224390, -0.22071150336],[51.61721224390, -0.22071150336],[51.61722254917, -0.22079781577],[51.61741670212, -0.22233582548],[51.61753853275, -0.22325553998],[51.61759457699, -0.22384515242],[51.61759457699, -0.22384515242],[51.61765617320, -0.22449321189],[51.61770019848, -0.22502595756],[51.61773414330, -0.22548687252],[51.61775800852, -0.22587595627],[51.61777838224, -0.22603405667],[51.61784892529, -0.22653688142],[51.61822622926, -0.22829892414],[51.61859790683, -0.22909338304],[51.61884724601, -0.22948728819]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00011892", "name": "Sanders Lane", "uri": "/StopPoint/490G00011892", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00006590", "name": "Engel Park", "uri": "/StopPoint/490G00006590", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009783", "name": "Medawar Drive", "uri": "/StopPoint/490G00009783", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00012971", "name": "St Vincent's School", "uri": "/StopPoint/490G00012971", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009907", "name": "Mill Hill School", "uri": "/StopPoint/490G00009907", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "240", "directions": ["Edgware Station"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "240", "name": "240", "uri": "/Line/240", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Outbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "bus", "name": "bus", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "3", "network": "tfl" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T14:05:00", "scheduledArrivalTime": "2024-07-06T14:10:00" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 2, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to NW7 1QS", "detailed": "Walk to NW7 1QS", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "The Ridgeway for 57 metres", "turnDirection": "STRAIGHT", "streetName": "The Ridgeway", "distance": 57, "cumulativeDistance": 57, "skyDirection": 314, "skyDirectionDescription": "NorthWest", "cumulativeTravelTime": 50, "latitude": 51.61883744781, "longitude": -0.22947408194, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }] }, "obstacles": [], "departureTime": "2024-07-06T14:10:00", "arrivalTime": "2024-07-06T14:12:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->N", "icsCode": "1009907", "individualStopId": "490009907N", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.618811357770007, "lon": -0.22953287861000002 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.Place, Tfl.Api.Presentation.Entities", "commonName": "NW7 1QS", "placeType": "StopPoint", "lat": 51.618978067369994, "lon": -0.23045089398 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.61883744781, -0.22947408194],[51.61887426666, -0.22953043030],[51.61888347137, -0.22954451741],[51.61921440450, -0.23002278303],[51.61897806737, -0.23045089398]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 57.0, "isDisrupted": false, "hasFixedLocations": false, "scheduledDepartureTime": "2024-07-06T14:10:00", "scheduledArrivalTime": "2024-07-06T14:12:00" }], "fare": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.JourneyFare, Tfl.Api.Presentation.Entities", "totalCost": 365, "fares": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 2, "highZone": 4, "cost": 190, "chargeProfileName": "Standard peak/off peak", "isHopperFare": false, "chargeLevel": "Off Peak", "peak": 280, "offPeak": 190, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUTFP", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "Gate", "nationalLocationCode": 733, "tapTimestamp": "2024-07-06T14:38:00+01:00" } }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUMHL", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "PVal", "nationalLocationCode": 643, "tapTimestamp": "2024-07-06T14:51:00+01:00" } }] }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 0, "highZone": 0, "cost": 175, "isHopperFare": false, "peak": 0, "offPeak": 0, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUMHL", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Bus", "validationType": "Entry", "hostDeviceType": "ETM", "busRouteId": "240", "nationalLocationCode": 0, "tapTimestamp": "2024-07-06T15:05:00+01:00" } }] }], "caveats": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "<p>Fares between two stations may vary depending on the direction of travel, time of day and day of the week.</p><p>We charge higher fares at the busiest times of the day (usually between 06:30 and 09:30, and between 16:00 and 19:00, Monday to Friday).</p><p>When you pay as you go, you must touch your contactless or Oyster card on a yellow reader at the start and end of your journey.</p><p>Some journeys are charged via Zone 1 regardless of the route taken.</p><p>If your journey avoids Zone 1 and you see a pink card reader when changing trains, touch your contactless or Oyster card on it to pay the right fare.</p>", "type": "allRailModes" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "The price shown is a single adult pay as you go fare.", "type": "generic" }] } }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Journey, Tfl.Api.Presentation.Entities", "startDateTime": "2024-07-06T13:25:00", "duration": 50, "arrivalDateTime": "2024-07-06T14:15:00", "alternativeRoute": false, "legs": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 3, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to Lady Somerset Road, Gospel Oak", "detailed": "Walk to Lady Somerset Road, Gospel Oak", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "Sanderson Close for 176 metres", "turnDirection": "STRAIGHT", "streetName": "Sanderson Close", "distance": 176, "cumulativeDistance": 176, "skyDirection": 232, "skyDirectionDescription": "SouthWest", "cumulativeTravelTime": 158, "latitude": 51.55475381281, "longitude": -0.14593243178, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Highgate Road, continue for 105 metres", "turnDirection": "LEFT", "streetName": "Highgate Road", "distance": 105, "cumulativeDistance": 281, "skyDirection": 333, "skyDirectionDescription": "NorthWest", "cumulativeTravelTime": 252, "latitude": 51.55441740226, "longitude": -0.144561307, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn left", "trackType": "None" }] }, "obstacles": [], "departureTime": "2024-07-06T13:25:00", "arrivalTime": "2024-07-06T13:28:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "platformName": "", "icsCode": "99999997", "commonName": "NW5 1TS", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55470819605, "lon": -0.14589101131 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00015367", "platformName": "GW", "stopLetter": "GW", "icsCode": "1015367", "individualStopId": "490015367S", "commonName": "Lady Somerset Road", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55529822613, "lon": -0.14510247548 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55470819605, -0.14589101131],[51.55475381281, -0.14593243178],[51.55470148739, -0.14603553545],[51.55470171518, -0.14604995132],[51.55453676592, -0.14585470715],[51.55435407084, -0.14567461110],[51.55423769983, -0.14570819372],[51.55404670142, -0.14557171190],[51.55402781668, -0.14551478026],[51.55441740226, -0.14456130700],[51.55458121386, -0.14468446682],[51.55489893829, -0.14487349102],[51.55528139232, -0.14517528692]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 281.0, "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:26:00", "scheduledArrivalTime": "2024-07-06T13:29:00" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 3, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "214 bus to Kentish Town Station", "detailed": "214 bus towards Finsbury Square", "steps": [] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "WALKWAY", "incline": "LEVEL", "stopId": 1000123, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "UP", "stopId": 1000123, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000123, "position": "AFTER" }], "departureTime": "2024-07-06T13:28:00", "arrivalTime": "2024-07-06T13:31:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00015367", "platformName": "GW", "stopLetter": "GW", "icsCode": "1015367", "individualStopId": "490015367S", "commonName": "Lady Somerset Road", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55529822613, "lon": -0.14510247548 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00123B", "platformName": "KB", "stopLetter": "KB", "icsCode": "1000123", "individualStopId": "490000123A", "commonName": "Kentish Town Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55021088578, "lon": -0.14070824562 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55528034487, -0.14517866620],[51.55489893829, -0.14487349102],[51.55458121386, -0.14468446682],[51.55441740226, -0.14456130700],[51.55422549060, -0.14436716667],[51.55371083578, -0.14366687020],[51.55368319155, -0.14362472120],[51.55350112576, -0.14329630737],[51.55350112576, -0.14329630737],[51.55322961360, -0.14280655634],[51.55294303985, -0.14231336799],[51.55245045601, -0.14187185408],[51.55242303946, -0.14184412245],[51.55204995711, -0.14151070662],[51.55204995711, -0.14151070662],[51.55182101561, -0.14130610951],[51.55167380359, -0.14109574722],[51.55120931744, -0.14072523287],[51.55087566931, -0.14066671683],[51.55072289630, -0.14067294590],[51.55021155389, -0.14076233260]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00008660", "name": "Greenwood Centre", "uri": "/StopPoint/490G00008660", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00006943", "name": "Fortess Road", "uri": "/StopPoint/490G00006943", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00123B", "name": "Kentish Town Station", "uri": "/StopPoint/490G00123B", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "214", "directions": ["Finsbury Square"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "214", "name": "214", "uri": "/Line/214", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Outbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "bus", "name": "bus", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "3", "network": "tfl" }, "disruptions": [{ "$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities", "category": "RealTime", "type": "lineInfo", "categoryDescription": "RealTime", "description": "CITY ROAD, EC2: ROUTES 21 43 76 141 and 214 are on diversion towards Molesworth Street London Bridge Station, Lower Marsh and Finsbury Square via Old Street, Goswell Road, Aldersgate Street, Beech Street and Chiswell Street due to Thames Water works taking place at City Road. Bus stops 'City Road/Leonard Street' (M) and 'Epworth Street' (E) will be missed.", "summary": "D68406 - CITY ROAD, EC2 - ROUTES 21 43 76 141 214 - THAMES WATER WORKS", "additionalInfo": "", "created": "2024-07-06T10:50:00", "lastUpdate": "2024-07-06T10:55:00" }], "plannedWorks": [], "isDisrupted": true, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:29:00", "scheduledArrivalTime": "2024-07-06T13:33:00", "interChangeDuration": "5", "interChangePosition": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 15, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Thameslink to Mill Hill Broadway", "detailed": "Thameslink towards St Albans City", "steps": [] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1001193, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "WALKWAY", "incline": "LEVEL", "stopId": 1001193, "position": "AFTER" }], "departureTime": "2024-07-06T13:38:00", "arrivalTime": "2024-07-06T13:53:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "910GKNTSHTN", "platformName": "", "icsCode": "1000123", "individualStopId": "9100KNTSHTN1", "commonName": "Kentish Town Rail Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.550616806309996, "lon": -0.13965317806 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "910GMLHB", "platformName": "", "icsCode": "1001193", "individualStopId": "9100MLHB0", "commonName": "Mill Hill Broadway Rail Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.613190384170004, "lon": -0.24926478443 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55061644127, -0.13965357038],[51.55087848745, -0.14027715572],[51.55100125393, -0.14064717231],[51.55175730937, -0.14353003430],[51.55232024734, -0.14614677751],[51.55257041358, -0.14775214604],[51.55273899568, -0.14931756946],[51.55281723565, -0.15085781865],[51.55282096901, -0.15166544085],[51.55278575438, -0.15342665912],[51.55266359254, -0.15537891007],[51.55243740582, -0.15758056845],[51.54895894930, -0.18189450467],[51.54850924188, -0.18537397768],[51.54839761485, -0.18687841798],[51.54833699624, -0.18819332489],[51.54842599169, -0.19221382505],[51.54842971650, -0.19226006112],[51.54842971650, -0.19226006112],[51.54842599169, -0.19221382505],[51.54833699624, -0.18819332489],[51.54839761485, -0.18687841798],[51.54850924188, -0.18537397768],[51.54823123922, -0.18775041298],[51.54822550838, -0.18854390610],[51.54831925924, -0.19229017093],[51.54846627711, -0.19424588166],[51.54873474603, -0.19649968715],[51.54889182828, -0.19735886742],[51.54910194044, -0.19815826534],[51.54924360623, -0.19859979085],[51.55047579804, -0.20271956621],[51.55071895249, -0.20333020525],[51.55105307677, -0.20400938724],[51.55230182153, -0.20628251232],[51.55302919763, -0.20739343503],[51.55352484437, -0.20805190833],[51.55412877148, -0.20873499167],[51.55641925830, -0.21092424438],[51.55774193010, -0.21215625348],[51.55854750043, -0.21309122035],[51.55855277716, -0.21309816199],[51.55855277716, -0.21309816199],[51.55854750043, -0.21309122035],[51.55774193010, -0.21215625348],[51.55641925830, -0.21092424438],[51.55412877148, -0.20873499167],[51.55352484437, -0.20805190833],[51.55302919763, -0.20739343503],[51.55230182153, -0.20628251232],[51.55105307677, -0.20400938724],[51.55071895249, -0.20333020525],[51.55047579804, -0.20271956621],[51.54924360623, -0.19859979085],[51.54910194044, -0.19815826534],[51.54889182828, -0.19735886742],[51.54873474603, -0.19649968715],[51.54846627711, -0.19424588166],[51.54831925924, -0.19229017093],[51.54822550838, -0.18854390610],[51.54823123922, -0.18775041298],[51.54850924188, -0.18537397768],[51.54839761485, -0.18687841798],[51.54833699624, -0.18819332489],[51.54842599169, -0.19221382505],[51.54859275954, -0.19428414300],[51.54887021472, -0.19653759959],[51.54900732958, -0.19726776261],[51.54921788514, -0.19809599122],[51.55056301771, -0.20254304413],[51.55079674458, -0.20312520727],[51.55108416970, -0.20369083724],[51.55239803351, -0.20610563621],[51.55312541126, -0.20721655837],[51.55361207200, -0.20787538430],[51.55418859895, -0.20853069338],[51.55647974903, -0.21076318938],[51.55780220279, -0.21198077798],[51.55866169647, -0.21291362924],[51.55968931303, -0.21425829925],[51.56012792929, -0.21471720006],[51.56059240822, -0.21510296264],[51.56123816095, -0.21558262635],[51.56166800439, -0.21605632560],[51.56624048426, -0.22226925599],[51.56738744740, -0.22378285140],[51.56805127417, -0.22465980404],[51.56805127417, -0.22465980404],[51.57010343605, -0.22737104016],[51.57049837393, -0.22791844744],[51.57080496272, -0.22857030920],[51.57100174463, -0.22909657523],[51.57117025757, -0.22953736280],[51.57143936672, -0.23008968848],[51.57543301118, -0.23553399742],[51.57593640727, -0.23612063407],[51.57657525693, -0.23674533694],[51.57749530260, -0.23753236438],[51.57803994285, -0.23787210383],[51.57851972359, -0.23808446682],[51.58013046768, -0.23875825415],[51.58023911706, -0.23879649741],[51.58023911706, -0.23879649741],[51.58098023263, -0.23905736590],[51.58162069675, -0.23919137606],[51.58292707085, -0.23935738619],[51.58404233527, -0.23937201446],[51.58503860318, -0.23924689675],[51.58598008243, -0.23906615173],[51.58886309578, -0.23823288746],[51.59115620445, -0.23763889416],[51.59429852756, -0.23670876985],[51.59558215911, -0.23655799236],[51.59760771473, -0.23671055246],[51.59910606815, -0.23708568889],[51.59983878723, -0.23737497810],[51.60135284112, -0.23819717756],[51.60200748932, -0.23867723871],[51.60280830987, -0.23931050122],[51.60361107463, -0.24007367467],[51.61162199146, -0.24780861307],[51.61315372033, -0.24935782551]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "910GWHMPSTM", "name": "West Hampstead Thameslink Rail Station", "uri": "/StopPoint/910GWHMPSTM", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "910GCRKLWD", "name": "Cricklewood Rail Station", "uri": "/StopPoint/910GCRKLWD", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "910GBRENTX", "name": "Brent Cross West Station", "uri": "/StopPoint/910GBRENTX", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "910GHDON", "name": "Hendon Rail Station", "uri": "/StopPoint/910GHDON", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "910GMLHB", "name": "Mill Hill Broadway Rail Station", "uri": "/StopPoint/910GMLHB", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "Thameslink", "directions": ["St Albans City Rail Station"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "thameslink", "name": "Thameslink", "uri": "/Line/thameslink", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Inbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "national-rail", "name": "national-rail", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "6", "network": "nrc" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:38:00", "scheduledArrivalTime": "2024-07-06T13:53:00", "interChangeDuration": "3", "interChangePosition": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 7, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "240 bus to Mill Hill School", "detailed": "240 bus towards Golders Green", "steps": [] }, "obstacles": [], "departureTime": "2024-07-06T14:06:00", "arrivalTime": "2024-07-06T14:13:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "910GMLHB", "platformName": "F", "stopLetter": "F", "icsCode": "1001193", "individualStopId": "490015207F", "commonName": "Mill Hill Broadway Rail Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.61440503244, "lon": -0.24810586874999999 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->S", "icsCode": "1009907", "individualStopId": "490009907S", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.61858652417, "lon": -0.22893492846 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.61435231310, -0.24806620934],[51.61454020713, -0.24752290703],[51.61531950302, -0.24551403863],[51.61540764763, -0.24539508597],[51.61549622367, -0.24530500466],[51.61588640293, -0.24499806003],[51.61588640293, -0.24499806003],[51.61605615043, -0.24486452189],[51.61617276641, -0.24484557872],[51.61654231515, -0.24490354506],[51.61659688500, -0.24494477367],[51.61682817444, -0.24477696014],[51.61682580004, -0.24461816052],[51.61655999405, -0.24428174645],[51.61635666464, -0.24391403580],[51.61616059315, -0.24343049261],[51.61600262850, -0.24308992587],[51.61599895539, -0.24284451297],[51.61564656773, -0.24033037228],[51.61557266514, -0.23966908459],[51.61557266514, -0.23966908459],[51.61551155338, -0.23912227730],[51.61538659709, -0.23798602082],[51.61523185004, -0.23666315075],[51.61590504102, -0.23656933361],[51.61590504102, -0.23656933361],[51.61638045427, -0.23650307731],[51.61705383030, -0.23643364151],[51.61751130084, -0.23635812835],[51.61776228673, -0.23630506359],[51.61836159722, -0.23609404218],[51.61855844391, -0.23602862886],[51.61889720263, -0.23588079901],[51.61889720263, -0.23588079901],[51.61910339775, -0.23579081702],[51.62011220356, -0.23530387620],[51.62061664916, -0.23476425531],[51.62158008078, -0.23425014357],[51.62169452302, -0.23408679266],[51.62160386540, -0.23344023344],[51.62126352424, -0.23293339173],[51.62111696276, -0.23272155312],[51.62111696276, -0.23272155312],[51.62109806370, -0.23269423673],[51.62060124436, -0.23194790728],[51.61976581043, -0.23081028307],[51.61888347137, -0.22954451741],[51.61859790683, -0.22909338304],[51.61855146851, -0.22899412004]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009905", "name": "Mill Hill Circus / Flower Lane", "uri": "/StopPoint/490G00009905", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00004031", "name": "Birkbeck Road", "uri": "/StopPoint/490G00004031", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00014791", "name": "Wise Lane", "uri": "/StopPoint/490G00014791", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00012035", "name": "Shakespeare Road", "uri": "/StopPoint/490G00012035", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00000374", "name": "Mill Hill Village / the Ridgeway", "uri": "/StopPoint/490G00000374", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009907", "name": "Mill Hill School", "uri": "/StopPoint/490G00009907", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "240", "directions": ["Golders Green"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "240", "name": "240", "uri": "/Line/240", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Inbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "bus", "name": "bus", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "3", "network": "tfl" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T14:06:00", "scheduledArrivalTime": "2024-07-06T14:13:00" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 2, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to NW7 1QS", "detailed": "Walk to NW7 1QS", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "The Ridgeway for 105 metres", "turnDirection": "STRAIGHT", "streetName": "The Ridgeway", "distance": 105, "cumulativeDistance": 105, "skyDirection": 288, "skyDirectionDescription": "West", "cumulativeTravelTime": 93, "latitude": 51.61854224265, "longitude": -0.22897998808, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }] }, "obstacles": [], "departureTime": "2024-07-06T14:13:00", "arrivalTime": "2024-07-06T14:15:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->S", "icsCode": "1009907", "individualStopId": "490009907S", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.61858652417, "lon": -0.22893492846 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.Place, Tfl.Api.Presentation.Entities", "commonName": "NW7 1QS", "placeType": "StopPoint", "lat": 51.618978067369994, "lon": -0.23045089398 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.61854224265, -0.22897998808],[51.61859790683, -0.22909338304],[51.61888347137, -0.22954451741],[51.61921440450, -0.23002278303],[51.61897806737, -0.23045089398]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 105.0, "isDisrupted": false, "hasFixedLocations": false, "scheduledDepartureTime": "2024-07-06T14:13:00", "scheduledArrivalTime": "2024-07-06T14:15:00" }], "fare": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.JourneyFare, Tfl.Api.Presentation.Entities", "totalCost": 485, "fares": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 0, "highZone": 0, "cost": 175, "isHopperFare": false, "peak": 0, "offPeak": 0, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "490G00015367", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Bus", "validationType": "Entry", "hostDeviceType": "ETM", "busRouteId": "214", "nationalLocationCode": 0, "tapTimestamp": "2024-07-06T14:28:00+01:00" } }] }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 2, "highZone": 4, "cost": 310, "chargeProfileName": "Standard peak/off peak", "isHopperFare": false, "chargeLevel": "Off Peak", "peak": 380, "offPeak": 310, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "910GKNTSHTN", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "PVal", "nationalLocationCode": 619, "tapTimestamp": "2024-07-06T14:38:00+01:00" } }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "910GMLHB", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "Gate", "nationalLocationCode": 1527, "tapTimestamp": "2024-07-06T14:53:00+01:00" } }] }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 0, "highZone": 0, "cost": 0, "isHopperFare": true, "peak": 0, "offPeak": 0, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "910GMLHB", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Bus", "validationType": "Entry", "hostDeviceType": "ETM", "busRouteId": "240", "nationalLocationCode": 0, "tapTimestamp": "2024-07-06T15:06:00+01:00" } }] }], "caveats": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "<p>Unlimited bus and tram journeys within one hour.</p>", "type": "hopper" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "<p>Fares between two stations may vary depending on the direction of travel, time of day and day of the week.</p><p>We charge higher fares at the busiest times of the day (usually between 06:30 and 09:30, and between 16:00 and 19:00, Monday to Friday).</p><p>When you pay as you go, you must touch your contactless or Oyster card on a yellow reader at the start and end of your journey.</p><p>Some journeys are charged via Zone 1 regardless of the route taken.</p><p>If your journey avoids Zone 1 and you see a pink card reader when changing trains, touch your contactless or Oyster card on it to pay the right fare.</p>", "type": "allRailModes" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "The price shown is a single adult pay as you go fare.", "type": "generic" }] } }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Journey, Tfl.Api.Presentation.Entities", "startDateTime": "2024-07-06T13:38:00", "duration": 49, "arrivalDateTime": "2024-07-06T14:27:00", "alternativeRoute": false, "legs": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 16, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to Tufnell Park Station", "detailed": "Walk to Tufnell Park Station", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "Sanderson Close for 176 metres", "turnDirection": "STRAIGHT", "streetName": "Sanderson Close", "distance": 176, "cumulativeDistance": 176, "skyDirection": 232, "skyDirectionDescription": "SouthWest", "cumulativeTravelTime": 158, "latitude": 51.55475381281, "longitude": -0.14593243178, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Highgate Road, continue for 25 metres", "turnDirection": "RIGHT", "streetName": "Highgate Road", "distance": 25, "cumulativeDistance": 201, "skyDirection": 146, "skyDirectionDescription": "SouthEast", "cumulativeTravelTime": 181, "latitude": 51.55441740226, "longitude": -0.144561307, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn right", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Lady Somerset Road, continue for 356 metres", "turnDirection": "LEFT", "streetName": "Lady Somerset Road", "distance": 356, "cumulativeDistance": 557, "skyDirection": 55, "skyDirectionDescription": "NorthEast", "cumulativeTravelTime": 501, "latitude": 51.5542254906, "longitude": -0.14436716667000002, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn left", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Fortess Road, continue for 213 metres", "turnDirection": "LEFT", "streetName": "Fortess Road", "distance": 213, "cumulativeDistance": 770, "skyDirection": 23, "skyDirectionDescription": "NorthEast", "cumulativeTravelTime": 694, "latitude": 51.555122541139994, "longitude": -0.13968571992, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Turn left", "trackType": "None" }, { "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "on to Brecknock Road, continue for 22 metres", "turnDirection": "SHARP_RIGHT", "streetName": "Brecknock Road", "distance": 22, "cumulativeDistance": 792, "skyDirection": 151, "skyDirectionDescription": "SouthEast", "cumulativeTravelTime": 714, "latitude": 51.55687347179, "longitude": -0.13838808012, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Take a sharp right", "trackType": "None" }] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000239, "position": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "LIFT", "incline": "DOWN", "stopId": 1000239, "position": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "UP", "stopId": 1000239, "position": "IDEST" }], "departureTime": "2024-07-06T13:38:00", "arrivalTime": "2024-07-06T13:54:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "platformName": "", "icsCode": "99999997", "commonName": "NW5 1TS", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.55470819605, "lon": -0.14589101131 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUTFP", "platformName": "", "icsCode": "1000239", "individualStopId": "9400ZZLUTFP1", "commonName": "Tufnell Park Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.556801578780004, "lon": -0.13839101567 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55470819605, -0.14589101131],[51.55475381281, -0.14593243178],[51.55470148739, -0.14603553545],[51.55470171518, -0.14604995132],[51.55453676592, -0.14585470715],[51.55435407084, -0.14567461110],[51.55423769983, -0.14570819372],[51.55404670142, -0.14557171190],[51.55402781668, -0.14551478026],[51.55441740226, -0.14456130700],[51.55422549060, -0.14436716667],[51.55436403279, -0.14402975267],[51.55461301360, -0.14328393726],[51.55502200749, -0.14185360852],[51.55531042533, -0.14075995423],[51.55531735593, -0.14062984357],[51.55512254114, -0.13968571992],[51.55524698257, -0.13959409062],[51.55536243728, -0.13950282752],[51.55578023674, -0.13919726897],[51.55587794650, -0.13912115354],[51.55619780665, -0.13887728846],[51.55687347179, -0.13838808012],[51.55670020967, -0.13823647120],[51.55670019543, -0.13823648747],[51.55671703912, -0.13816365503],[51.55662226081, -0.13672494974],[51.55680159543, -0.13839098747]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 792.0, "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:37:00", "scheduledArrivalTime": "2024-07-06T13:53:00", "interChangeDuration": "4", "interChangePosition": "IDEST" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 13, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Northern line to Mill Hill East", "detailed": "Northern line towards Mill Hill East Station", "steps": [] }, "obstacles": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000147, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "STAIRS", "incline": "DOWN", "stopId": 1000147, "position": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Obstacle, Tfl.Api.Presentation.Entities", "type": "WALKWAY", "incline": "LEVEL", "stopId": 1000147, "position": "AFTER" }], "departureTime": "2024-07-06T13:54:00", "arrivalTime": "2024-07-06T14:07:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUTFP", "platformName": "", "icsCode": "1000239", "individualStopId": "9400ZZLUTFP1", "commonName": "Tufnell Park Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.556801578780004, "lon": -0.13839101567 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUMHL", "platformName": "", "icsCode": "1000147", "individualStopId": "9400ZZLUMHL1", "commonName": "Mill Hill East Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.60818960822, "lon": -0.20984292593 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.55680327183, -0.13839711183],[51.55689951670, -0.13832931327],[51.55763161584, -0.13799647073],[51.55840034681, -0.13770539970],[51.56028204411, -0.13728228294],[51.56072817027, -0.13706207443],[51.56463157469, -0.13489272274],[51.56463157469, -0.13489272274],[51.56540788084, -0.13446123541],[51.56573116894, -0.13443357409],[51.56624615565, -0.13458563996],[51.56659177215, -0.13483121442],[51.56763205524, -0.13578425795],[51.56920689056, -0.13698965340],[51.57056717942, -0.13827604715],[51.57165534122, -0.13941489132],[51.57253755895, -0.14004268465],[51.57644526034, -0.14376537380],[51.57693021952, -0.14429403762],[51.57745705060, -0.14519624840],[51.57775402794, -0.14583462701],[51.57775402794, -0.14583462701],[51.57804349059, -0.14645686725],[51.58011941533, -0.15093328589],[51.58354015602, -0.15802598298],[51.58524709195, -0.16136356065],[51.58660743619, -0.16382036952],[51.58678314879, -0.16413086110],[51.58725208124, -0.16492335875],[51.58725208124, -0.16492335875],[51.58755901247, -0.16544208734],[51.58853527381, -0.16691852042],[51.58989413772, -0.16871166088],[51.59147810087, -0.17110220630],[51.59209751902, -0.17218897162],[51.59269243716, -0.17343555740],[51.59468714477, -0.17796117859],[51.59608752801, -0.18128367192],[51.59619939372, -0.18153909118],[51.59793391160, -0.18554154082],[51.60101178762, -0.19274045749],[51.60101178762, -0.19274045749],[51.60147888149, -0.19383312862],[51.60266170592, -0.19648652011],[51.60484699848, -0.20177195587],[51.60541420567, -0.20299148093],[51.60679431763, -0.20562311460],[51.60766797294, -0.20748054585],[51.60788436760, -0.20810746537],[51.60805670544, -0.20879389261],[51.60818941029, -0.20984294789]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUACY", "name": "Archway Underground Station", "uri": "/StopPoint/940GZZLUACY", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUHGT", "name": "Highgate Underground Station", "uri": "/StopPoint/940GZZLUHGT", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUEFY", "name": "East Finchley Underground Station", "uri": "/StopPoint/940GZZLUEFY", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUFYC", "name": "Finchley Central Underground Station", "uri": "/StopPoint/940GZZLUFYC", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "940GZZLUMHL", "name": "Mill Hill East Underground Station", "uri": "/StopPoint/940GZZLUMHL", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "Northern", "directions": ["Mill Hill East Station"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "northern", "name": "Northern", "uri": "/Line/northern", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Outbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "tube", "name": "tube", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "1", "network": "tfl" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T13:53:00", "scheduledArrivalTime": "2024-07-06T14:06:00", "interChangeDuration": "4", "interChangePosition": "AFTER" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 5, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "240 bus to Mill Hill School", "detailed": "240 bus towards Edgware Station", "steps": [] }, "obstacles": [], "departureTime": "2024-07-06T14:20:00", "arrivalTime": "2024-07-06T14:25:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "940GZZLUMHL", "platformName": "A", "stopLetter": "A", "icsCode": "1000147", "individualStopId": "490000147A", "commonName": "Mill Hill East Underground Station", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.60855414664, "lon": -0.21016075426 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->N", "icsCode": "1009907", "individualStopId": "490009907N", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.618811357770007, "lon": -0.22953287861000002 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.60857105245, -0.21005673366],[51.60865212228, -0.21009913239],[51.60873102360, -0.20996604976],[51.60892349008, -0.21020399670],[51.60983067109, -0.21190128322],[51.60983067109, -0.21190128322],[51.60991390413, -0.21205701338],[51.61038234795, -0.21270297062],[51.61124183897, -0.21363688884],[51.61205309480, -0.21435608658],[51.61323455307, -0.21458414937],[51.61345966517, -0.21460420337],[51.61362208837, -0.21464116108],[51.61401006269, -0.21472704409],[51.61436757675, -0.21517522181],[51.61465262858, -0.21550796193],[51.61465262858, -0.21550796193],[51.61483446814, -0.21572022540],[51.61520030735, -0.21612475987],[51.61530091838, -0.21623636887],[51.61573207656, -0.21679723913],[51.61649815847, -0.21809611589],[51.61708864759, -0.21967635929],[51.61721224390, -0.22071150336],[51.61721224390, -0.22071150336],[51.61722254917, -0.22079781577],[51.61741670212, -0.22233582548],[51.61753853275, -0.22325553998],[51.61759457699, -0.22384515242],[51.61759457699, -0.22384515242],[51.61765617320, -0.22449321189],[51.61770019848, -0.22502595756],[51.61773414330, -0.22548687252],[51.61775800852, -0.22587595627],[51.61777838224, -0.22603405667],[51.61784892529, -0.22653688142],[51.61822622926, -0.22829892414],[51.61859790683, -0.22909338304],[51.61884724601, -0.22948728819]]", "stopPoints": [{ "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00011892", "name": "Sanders Lane", "uri": "/StopPoint/490G00011892", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00006590", "name": "Engel Park", "uri": "/StopPoint/490G00006590", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009783", "name": "Medawar Drive", "uri": "/StopPoint/490G00009783", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00012971", "name": "St Vincent's School", "uri": "/StopPoint/490G00012971", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }, { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "490G00009907", "name": "Mill Hill School", "uri": "/StopPoint/490G00009907", "type": "StopPoint", "routeType": "Unknown", "status": "Unknown" }], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "240", "directions": ["Edgware Station"], "lineIdentifier": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "240", "name": "240", "uri": "/Line/240", "type": "Line", "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" }, "routeType": "Unknown", "status": "Unknown" }, "direction": "Outbound" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "bus", "name": "bus", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "3", "network": "tfl" }, "disruptions": [], "plannedWorks": [], "isDisrupted": false, "hasFixedLocations": true, "scheduledDepartureTime": "2024-07-06T14:20:00", "scheduledArrivalTime": "2024-07-06T14:25:00" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities", "duration": 2, "instruction": { "$type": "Tfl.Api.Presentation.Entities.Instruction, Tfl.Api.Presentation.Entities", "summary": "Walk to NW7 1QS", "detailed": "Walk to NW7 1QS", "steps": [{ "$type": "Tfl.Api.Presentation.Entities.InstructionStep, Tfl.Api.Presentation.Entities", "description": "The Ridgeway for 57 metres", "turnDirection": "STRAIGHT", "streetName": "The Ridgeway", "distance": 57, "cumulativeDistance": 57, "skyDirection": 314, "skyDirectionDescription": "NorthWest", "cumulativeTravelTime": 50, "latitude": 51.61883744781, "longitude": -0.22947408194, "pathAttribute": { "$type": "Tfl.Api.Presentation.Entities.PathAttribute, Tfl.Api.Presentation.Entities" }, "descriptionHeading": "Continue along ", "trackType": "None" }] }, "obstacles": [], "departureTime": "2024-07-06T14:25:00", "arrivalTime": "2024-07-06T14:27:00", "departurePoint": { "$type": "Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities", "naptanId": "490G00009907", "platformName": "", "stopLetter": "->N", "icsCode": "1009907", "individualStopId": "490009907N", "commonName": "Mill Hill School", "placeType": "StopPoint", "additionalProperties": [], "lat": 51.618811357770007, "lon": -0.22953287861000002 }, "arrivalPoint": { "$type": "Tfl.Api.Presentation.Entities.Place, Tfl.Api.Presentation.Entities", "commonName": "NW7 1QS", "placeType": "StopPoint", "lat": 51.618978067369994, "lon": -0.23045089398 }, "path": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Path, Tfl.Api.Presentation.Entities", "lineString": "[[51.61883744781, -0.22947408194],[51.61887426666, -0.22953043030],[51.61888347137, -0.22954451741],[51.61921440450, -0.23002278303],[51.61897806737, -0.23045089398]]", "stopPoints": [], "elevation": [] }, "routeOptions": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.RouteOption, Tfl.Api.Presentation.Entities", "name": "", "directions": [""], "direction": "" }], "mode": { "$type": "Tfl.Api.Presentation.Entities.Identifier, Tfl.Api.Presentation.Entities", "id": "walking", "name": "walking", "type": "Mode", "routeType": "Unknown", "status": "Unknown", "motType": "100", "network": "" }, "disruptions": [], "plannedWorks": [], "distance": 57.0, "isDisrupted": false, "hasFixedLocations": false, "scheduledDepartureTime": "2024-07-06T14:25:00", "scheduledArrivalTime": "2024-07-06T14:27:00" }], "fare": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.JourneyFare, Tfl.Api.Presentation.Entities", "totalCost": 365, "fares": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 2, "highZone": 4, "cost": 190, "chargeProfileName": "Standard peak/off peak", "isHopperFare": false, "chargeLevel": "Off Peak", "peak": 280, "offPeak": 190, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUTFP", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "Gate", "nationalLocationCode": 733, "tapTimestamp": "2024-07-06T14:54:00+01:00" } }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUMHL", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Rail", "validationType": "None", "hostDeviceType": "PVal", "nationalLocationCode": 643, "tapTimestamp": "2024-07-06T15:07:00+01:00" } }] }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Fare, Tfl.Api.Presentation.Entities", "lowZone": 0, "highZone": 0, "cost": 175, "isHopperFare": false, "peak": 0, "offPeak": 0, "taps": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTap, Tfl.Api.Presentation.Entities", "atcoCode": "940GZZLUMHL", "tapDetails": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareTapDetails, Tfl.Api.Presentation.Entities", "modeType": "Bus", "validationType": "Entry", "hostDeviceType": "ETM", "busRouteId": "240", "nationalLocationCode": 0, "tapTimestamp": "2024-07-06T15:20:00+01:00" } }] }], "caveats": [{ "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "<p>Fares between two stations may vary depending on the direction of travel, time of day and day of the week.</p><p>We charge higher fares at the busiest times of the day (usually between 06:30 and 09:30, and between 16:00 and 19:00, Monday to Friday).</p><p>When you pay as you go, you must touch your contactless or Oyster card on a yellow reader at the start and end of your journey.</p><p>Some journeys are charged via Zone 1 regardless of the route taken.</p><p>If your journey avoids Zone 1 and you see a pink card reader when changing trains, touch your contactless or Oyster card on it to pay the right fare.</p>", "type": "allRailModes" }, { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.FareCaveat, Tfl.Api.Presentation.Entities", "text": "The price shown is a single adult pay as you go fare.", "type": "generic" }] } }], "lines": [{ "$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities", "id": "214", "name": "214", "modeName": "bus", "disruptions": [], "created": "2024-06-26T13:08:06.15Z", "modified": "2024-06-26T13:08:06.15Z", "lineStatuses": [{ "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities", "id": 0, "lineId": "214", "statusSeverity": 0, "statusSeverityDescription": "Special Service", "reason": "CITY ROAD, EC2: ROUTES 21 43 76 141 and 214 are on diversion towards Molesworth Street London Bridge Station, Lower Marsh and Finsbury Square via Old Street, Goswell Road, Aldersgate Street, Beech Street and Chiswell Street due to Thames Water works taking place at City Road. Bus stops 'City Road/Leonard Street' (M) and 'Epworth Street' (E) will be missed.", "created": "0001-01-01T00:00:00", "validityPeriods": [{ "$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities", "fromDate": "2024-07-06T09:50:00Z", "toDate": "2024-07-14T22:59:00Z", "isNow": true }], "disruption": { "$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities", "category": "RealTime", "categoryDescription": "RealTime", "description": "CITY ROAD, EC2: ROUTES 21 43 76 141 and 214 are on diversion towards Molesworth Street London Bridge Station, Lower Marsh and Finsbury Square via Old Street, Goswell Road, Aldersgate Street, Beech Street and Chiswell Street due to Thames Water works taking place at City Road. Bus stops 'City Road/Leonard Street' (M) and 'Epworth Street' (E) will be missed.", "created": "2024-07-06T10:50:00Z", "affectedRoutes": [], "affectedStops": [] } }], "routeSections": [], "serviceTypes": [{ "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities", "name": "Regular", "uri": "/Line/Route?ids=214&serviceTypes=Regular" }], "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" } }, { "$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities", "id": "240", "name": "240", "modeName": "bus", "disruptions": [], "created": "2024-06-26T13:08:06.12Z", "modified": "2024-06-26T13:08:06.12Z", "lineStatuses": [{ "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities", "id": 0, "statusSeverity": 10, "statusSeverityDescription": "Good Service", "created": "0001-01-01T00:00:00", "validityPeriods": [] }], "routeSections": [], "serviceTypes": [{ "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities", "name": "Regular", "uri": "/Line/Route?ids=240&serviceTypes=Regular" }], "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" } }, { "$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities", "id": "northern", "name": "Northern", "modeName": "tube", "disruptions": [], "created": "2024-06-26T13:08:06.15Z", "modified": "2024-06-26T13:08:06.15Z", "lineStatuses": [{ "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities", "id": 0, "statusSeverity": 10, "statusSeverityDescription": "Good Service", "created": "0001-01-01T00:00:00", "validityPeriods": [] }], "routeSections": [], "serviceTypes": [{ "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities", "name": "Regular", "uri": "/Line/Route?ids=Northern&serviceTypes=Regular" }, { "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities", "name": "Night", "uri": "/Line/Route?ids=Northern&serviceTypes=Night" }], "crowding": { "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities" } }], "stopMessages": [], "recommendedMaxAgeMinutes": 5, "searchCriteria": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.SearchCriteria, Tfl.Api.Presentation.Entities", "dateTime": "2024-07-06T13:15:00", "dateTimeType": "Departing", "timeAdjustments": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.TimeAdjustments, Tfl.Api.Presentation.Entities", "earliest": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.TimeAdjustment, Tfl.Api.Presentation.Entities", "date": "20240706", "time": "0300", "timeIs": "departing", "uri": "/journey/journeyresults/nw5%201ts/to/nw7%201qs?time=0300&date=20240706&timeIs=departing" }, "earlier": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.TimeAdjustment, Tfl.Api.Presentation.Entities", "date": "20240706", "time": "1300", "timeIs": "departing", "uri": "/journey/journeyresults/nw5%201ts/to/nw7%201qs?time=1300&date=20240706&timeIs=departing" }, "later": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.TimeAdjustment, Tfl.Api.Presentation.Entities", "date": "20240706", "time": "1339", "timeIs": "departing", "uri": "/journey/journeyresults/nw5%201ts/to/nw7%201qs?time=1339&date=20240706&timeIs=departing" }, "latest": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.TimeAdjustment, Tfl.Api.Presentation.Entities", "date": "20240707", "time": "0300", "timeIs": "departing", "uri": "/journey/journeyresults/nw5%201ts/to/nw7%201qs?time=0300&date=20240707&timeIs=departing" } } }, "journeyVector": { "$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.JourneyVector, Tfl.Api.Presentation.Entities", "from": "nw51ts", "to": "nw71qs", "via": "", "uri": "/journey/journeyresults/nw5%201ts/to/nw7%201qs" } }
// Sort the journeys by duration ascending...
journeyPlanner.journeys = journeyPlanner.journeys.sort((j1, j2) => j1.duration - j2.duration);
// console.log(journeyPlanner.journeys[0]);
// console.log("LEGS", journeyPlanner.journeys[0].legs[0]);
// console.log("STEP", journeyPlanner.journeys[0].legs[0].instruction.steps[0]);
// TODO: Is it possible to use the actual street name, as opposed to the postcodes?
let instructions = `Journey from ${startPostCode} to ${destPostCode}:\n`;
let hrs = 0, mins = 0;
// Process each journey
const noOfJourneys = journeyPlanner.journeys.length;
for (let journeyIndex = 0; journeyIndex < noOfJourneys; journeyIndex++) {
let journey = journeyPlanner.journeys[journeyIndex];
// Get the hrs/mins...
hrs = parseInt(journey.duration / 60);
mins = journey.duration % 60;
// Ensure the fare is float...
let farePrice = journey.fare.totalCost / 100;
// Format the journey header...
instructions += ` Journey ${journeyIndex + 1} - duration:${(hrs > 0 ? " " + hrs + "h" : "")}${(mins > 0 ? " " +mins + "m" : "")}, cost; £${farePrice}:\n`;
// Process each leg
let noOfLegs = journey.legs.length;
for (let legsIndex = 0; legsIndex < noOfLegs; legsIndex++) {
let leg = journey.legs[legsIndex];
// Get the hrs/mins...
hrs = parseInt(leg.duration / 60);
mins = leg.duration % 60;
// Format the leg portion of the journey
instructions += ` ${leg.instruction.detailed}, duration:${(hrs > 0 ? " " +hrs + "h" : "")}${(mins > 0 ? " " +mins + "m" : "")}\n`;
// Process each step
let noOfSteps = leg.instruction.steps.length;
for (let stepsIndex = 0; stepsIndex < noOfSteps; stepsIndex++) {
let step = leg.instruction.steps[stepsIndex];
// Format the step(s) for each leg
instructions += ` - ${step.descriptionHeading.trim()} ${step.description}\n`;
}
}
instructions += "\n";
}
// Output the results
console.log(instructions);
break;
} catch (err) {
console.log(err)
} finally {
// These may not be necessary but just in case...
startPostCode = "";
destPostCode = "";
directionsReqd = "";
}
}
async function isPostCodeValid(postCode) {
// The format of a valid postcode... This is a work-in-progress...
const postCodeFormat = /^[a-zA-Z]{1,2}\d(?:[a-zA-Z0-9\s])*\d[a-zA-Z]{2}$/;
// Ensure that the format is correct...
if (!postCode.match(postCodeFormat)) {
return false;
}
// Get the postcode info from postcodes.io
const response = await fetch(`https://api.postcodes.io/postcodes/${postCode}`);
if (response.status !== 200) {
return false;
}
// Ensure that the postcode is in London
const postCodeInfo = await response.json();
if (postCodeInfo.result.region !== "London")
return false;
// The postcode is valid...
return true;
}
function logMessage(type, message, logger) {
// Get the date and time that the function is called
const dateTime = new Date();
// Format the log entry in a standard way
const logEntry = `[journeyPlanner.js - ${dateTime.toLocaleDateString()} ${dateTime.toLocaleTimeString()}] : ${message}`;
// Based on the type of message to log...
switch (type) {
case ERROR:
logger.error(logEntry)
break;
case WARN:
logger.warn(logEntry);
break;
case INFO:
logger.info(logEntry);
break;
default:
break;
}
}
function getHrsAndMins(duration) {
let hrs = parseInt(duration / 60);
let mins = duration % 60;
return `${(hrs > 0 ? " " +hrs + "h" : "")}${(mins > 0 ? " " +mins + "m" : "")}`;
}