From fd28042634d211a4d3528726405e64ac85e69725 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 12 Jun 2019 16:01:43 +0200 Subject: [PATCH] Use version 1.0.x as SDK base, better tests and documentation --- README.md | 64 +- composer.json | 2 +- src/Trafiklab/Sl/Internal/SlClient.php | 2 +- src/Trafiklab/Sl/Model/SlLeg.php | 19 +- .../Sl/Model/SlRoutePlanningRequest.php | 4 +- src/Trafiklab/Sl/Model/SlTrip.php | 38 + .../Resources/Sl/validRoutePlanningTrip.json | 1824 ++++++++--------- .../Sl/Model/SlRoutePlanningLegTest.php | 15 +- .../Sl/Model/SlRoutePlanningRequestTest.php | 41 + .../Sl/Model/SlRoutePlanningResponseTest.php | 22 + .../Sl/Model/SlRoutePlanningTripTest.php | 3 + .../Trafiklab/Sl/SlWrapperIntegrationTest.php | 10 +- 12 files changed, 1109 insertions(+), 935 deletions(-) create mode 100644 tests/Trafiklab/Sl/Model/SlRoutePlanningRequestTest.php create mode 100644 tests/Trafiklab/Sl/Model/SlRoutePlanningResponseTest.php diff --git a/README.md b/README.md index 090ddf0..f32351f 100644 --- a/README.md +++ b/README.md @@ -66,28 +66,82 @@ If you don't want to send a user agent, you can just leave out this line. Detailed information about SL request parameters can be found at [the Trafiklab website](https://www.trafiklab.se/api/). Only the most important/most used request parameters are implemented in the SDK, in order to reduce clutter, and to ensure that we can keep the SDK unchanged in case of changes to the API. If you believe we have missed an important field, please create an issue so we can review this. + ##### Response In order to use the data returned by your request, you can simply call getTimeTable() on the response object. This method returns an array of TimeTableEntry instances, each of which describes one departure or arrival. You can look at the code and PHPDoc in order to get up-to-date information on which fields are available. -Detailed information about SL responses can be found at [the Trafiklab website](https://www.trafiklab.se/api/). +Detailed information about ResRobot responses can be found at [the Trafiklab website](https://www.trafiklab.se/api/). +The following code gives a quick idea on how the SDK is used. ``` - $response->getTimetable() +$entry = $response->getTimetable()[0]; // Get the first result +// Type of transport, one of the constants in Trafiklab\Common\Model\Enum\TransportType +$entry->getTransportType(); +// The name of the stop location +$stop = $timeTableEntry->getStopName() +// The number of the line +$lineNumber = $timeTableEntry->getLineNumber(); +// The direction of the vehicle +$direction = $timeTableEntry->getDirection(); +// The scheduled departure time at the stop +$scheduledStopTime = $timeTableEntry->getScheduledStopTime(); ``` - #### Routeplanning ##### Request The following code example illustrates how you can plan a route from A to B ``` - // TODO: add example +$queryTime = new DateTime(); +$queryTime->setTime(18, 0); + +$wrapper = new SlWrapper(); + +// Create a new routeplanning object. The wrapper will instantiate an object of the interface type. +$wrapper = $wrapper->createRoutePlanningRequestObject(); +$wrapper->setOriginId("740000001"); +$wrapper->setDestinationId("740000002"); +$wrapper->setDateTime($queryTime); + +$wrapper->setUserAgent((""); +$wrapper->setRoutePlanningApiKey(""); +$response = $resRobotWrapper->getRoutePlanning($routePlanningRequest); ``` ##### Response +In order to use the data returned by your request, you can simply call getTrips() on the response object. +This method returns an array of Trip instances, each of which describes one departure or arrival. +You can look at the code and PHPDoc in order to get up-to-date information on which fields are available. +Detailed information about ResRobot responses can be found at the [ResRobot departures/arrivals API page](https://www.trafiklab.se/api/resrobot-reseplanerare). + +The following code gives a quick idea on how the SDK is used. + ``` - // TODO: add example +$trip = $response->getTrips()[0]; // Get the first result + +// Tell the user about every leg in their journey. +foreach ($trip->getLegs() as $leg) { + + // There are two types of legs (at this moment): Vehicle journeys, where a vehicle is used, or walking parts + // where a user walks between two stations. Not all fields are available for walking parts, so we need to handle them differently. + + if ($leg->getType() == RoutePlanningLegType::VEHICLE_JOURNEY) { + $leg->getVehicle()->getType(); + $leg->getVehicle()->getNumber(); + $leg->getDirection(); + $leg->getDeparture()->getStopName(); + $leg->getDeparture()->getScheduledDepartureTime()->format("H:i"); + $leg->getDeparture()->getScheduledDepartureTime()->getTimestamp(); + $leg->getArrival()->getScheduledArrivalTime()->getTimestamp(); + $leg->getArrival()->getStopName(); + // More fields are available + } else if ($leg->getType() == RoutePlanningLegType::WALKING) { + // Limited fields when walking! + $leg->getDeparture()->getStopName(); // origin + $leg->getArrival()->getStopName(); // destination + } +} ``` ## Contributing diff --git a/composer.json b/composer.json index 63d2ee3..af62a50 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require": { "php": ">=7.1", "ext-json": "*", - "trafiklab/php-sdk-commons": "0.4.0" + "trafiklab/php-sdk-commons": "1.0.*" }, "require-dev": { "phpunit/phpunit": "^5.5", diff --git a/src/Trafiklab/Sl/Internal/SlClient.php b/src/Trafiklab/Sl/Internal/SlClient.php index 6b71bfc..1ecb1e7 100644 --- a/src/Trafiklab/Sl/Internal/SlClient.php +++ b/src/Trafiklab/Sl/Internal/SlClient.php @@ -124,7 +124,7 @@ public function getRoutePlanning(string $key, RoutePlanningRequest $request): Sl "destExtId" => $request->getDestinationStopId(), "date" => $request->getDateTime()->format("Y-m-d"), "time" => $request->getDateTime()->format("H:i"), - "lang" => $request->getLang(), + "lang" => $request->getLanguage(), "searchForArrival" => $searchForArrival, "passlist" => "1", ]; diff --git a/src/Trafiklab/Sl/Model/SlLeg.php b/src/Trafiklab/Sl/Model/SlLeg.php index 6974883..c20bb35 100644 --- a/src/Trafiklab/Sl/Model/SlLeg.php +++ b/src/Trafiklab/Sl/Model/SlLeg.php @@ -44,7 +44,7 @@ public function __construct(array $json) * * @return VehicleStopWithRealtime The stoplocation at which this leg starts. */ - public function getOrigin(): VehicleStop + public function getDeparture(): VehicleStop { return $this->_origin; } @@ -54,11 +54,26 @@ public function getOrigin(): VehicleStop * * @return VehicleStopWithRealtime The stoplocation at which this leg ends. */ - public function getDestination(): VehicleStop + public function getArrival(): VehicleStop { return $this->_destination; } + /** + * Get the duration of this leg in seconds. + * + * @return int + */ + public function getDuration(): int + { + if ($this->getArrival()->getScheduledArrivalTime() == null + || $this->getDeparture()->getScheduledDepartureTime() == null) { + return 0; + } + return $this->getArrival()->getScheduledArrivalTime()->getTimestamp() - + $this->getDeparture()->getScheduledDepartureTime()->getTimestamp(); + } + /** * Remarks about this leg, for example describing facilities on board of a train, or possible disturbances on the * route. diff --git a/src/Trafiklab/Sl/Model/SlRoutePlanningRequest.php b/src/Trafiklab/Sl/Model/SlRoutePlanningRequest.php index fc16014..347cecd 100644 --- a/src/Trafiklab/Sl/Model/SlRoutePlanningRequest.php +++ b/src/Trafiklab/Sl/Model/SlRoutePlanningRequest.php @@ -67,7 +67,7 @@ public function setViaStopId(?string $viaId): void /** * @return string */ - public function getLang(): string + public function getLanguage(): string { return $this->_lang; } @@ -75,7 +75,7 @@ public function getLang(): string /** * @param string $lang */ - public function setLang(string $lang): void + public function setLanguage(string $lang): void { $this->_lang = $lang; } diff --git a/src/Trafiklab/Sl/Model/SlTrip.php b/src/Trafiklab/Sl/Model/SlTrip.php index 3f421df..3de2a03 100644 --- a/src/Trafiklab/Sl/Model/SlTrip.php +++ b/src/Trafiklab/Sl/Model/SlTrip.php @@ -5,6 +5,7 @@ use Trafiklab\Common\Model\Contract\RoutePlanningLeg; use Trafiklab\Common\Model\Contract\Trip; +use Trafiklab\Common\Model\Contract\VehicleStop; /** * A Trip, often also called Journey, describes one possibility for travelling between two locations. A Trip can @@ -41,6 +42,43 @@ public function getLegs(): array return $this->_legs; } + /** + * Get the duration of this trip in seconds. + * + * @return int + */ + public function getDuration(): int + { + return $this->getArrival()->getScheduledArrivalTime()->getTimestamp() - + $this->getDeparture()->getScheduledDepartureTime()->getTimestamp(); + } + + /** + * Get the departure for the first leg. + * + * @return VehicleStop + */ + public function getDeparture(): VehicleStop + { + if (count($this->_legs) < 1) { + return null; + } + return $this->_legs[0]->getDeparture(); + } + + /** + * Get the arrival for the last leg. + * + * @return VehicleStop + */ + public function getArrival(): VehicleStop + { + if (count($this->_legs) < 1) { + return null; + } + return end($this->_legs)->getArrival(); + } + private function parseApiResponse(array $json) { $this->_legs = []; diff --git a/tests/Resources/Sl/validRoutePlanningTrip.json b/tests/Resources/Sl/validRoutePlanningTrip.json index b9416c9..50d5dfc 100644 --- a/tests/Resources/Sl/validRoutePlanningTrip.json +++ b/tests/Resources/Sl/validRoutePlanningTrip.json @@ -1,993 +1,993 @@ { - "ServiceDays": [ - { - "planningPeriodBegin": "2019-04-29", - "planningPeriodEnd": "2019-06-13", - "sDaysR": "mån - fre", - "sDaysI": "utom 1., 30., 31. maj, 6., 7., 13. jun", - "sDaysB": "D9F3E7CE1C38" - } - ], - "LegList": { - "Leg": [ - { - "Origin": { + "ServiceDays": [ + { + "planningPeriodBegin": "2019-04-29", + "planningPeriodEnd": "2019-06-13", + "sDaysR": "mån - fre", + "sDaysI": "utom 1., 30., 31. maj, 6., 7., 13. jun", + "sDaysB": "D9F3E7CE1C38" + } + ], + "LegList": { + "Leg": [ + { + "Origin": { + "name": "Sergels torg", + "type": "ST", + "id": "A=1@O=Sergels torg@X=18064623@Y=59333929@U=74@L=400111505@", + "extId": "400111505", + "lon": 18.064623, + "lat": 59.333929, + "prognosisType": "PROGNOSED", + "time": "00:21:00", + "date": "2019-05-03", + "track": "O", + "hasMainMast": true, + "mainMastId": "A=1@O=Sergels torg (Stockholm)@X=18064561@Y=59334621@U=74@L=300101000@", + "mainMastExtId": "300101000" + }, + "Destination": { + "name": "Södra station (på Swedenborgsgatan)", + "type": "ST", + "id": "A=1@O=Södra station (på Swedenborgsgatan)@X=18064947@Y=59313910@U=74@L=400110763@", + "extId": "400110763", + "lon": 18.064947, + "lat": 59.31391, + "prognosisType": "PROGNOSED", + "time": "00:34:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", + "mainMastExtId": "300101339" + }, + "JourneyDetailRef": { + "ref": "1|10409|2|74|2052019" + }, + "JourneyStatus": "P", + "Product": { + "name": "buss 57", + "num": "36535", + "line": "57", + "catOut": "BUS ", + "catIn": "BUS", + "catCode": "3", + "catOutS": "BUS", + "catOutL": "BUSS ", + "operatorCode": "SL", + "operator": "Storstockholms Lokaltrafik", + "admin": "100057" + }, + "Stops": { + "Stop": [ + { "name": "Sergels torg", - "type": "ST", "id": "A=1@O=Sergels torg@X=18064623@Y=59333929@U=74@L=400111505@", "extId": "400111505", + "routeIdx": 10, "lon": 18.064623, "lat": 59.333929, - "prognosisType": "PROGNOSED", - "time": "00:21:00", - "date": "2019-05-03", - "track": "O", + "depTime": "00:21:00", + "depDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Sergels torg (Stockholm)@X=18064561@Y=59334621@U=74@L=300101000@", "mainMastExtId": "300101000" }, - "Destination": { - "name": "Södra station (på Swedenborgsgatan)", - "type": "ST", - "id": "A=1@O=Södra station (på Swedenborgsgatan)@X=18064947@Y=59313910@U=74@L=400110763@", - "extId": "400110763", - "lon": 18.064947, - "lat": 59.31391, - "prognosisType": "PROGNOSED", - "time": "00:34:00", - "date": "2019-05-03", + { + "name": "Jakobsgatan", + "id": "A=1@O=Jakobsgatan@X=18068453@Y=59330307@U=74@L=400110169@", + "extId": "400110169", + "routeIdx": 11, + "lon": 18.068453, + "lat": 59.330307, + "depTime": "00:22:00", + "depDate": "2019-05-03", + "arrTime": "00:22:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", - "mainMastExtId": "300101339" + "mainMastId": "A=1@O=Jakobsgatan (Stockholm)@X=18068453@Y=59330675@U=74@L=300101021@", + "mainMastExtId": "300101021" + }, + { + "name": "Gustav Adolfs torg", + "id": "A=1@O=Gustav Adolfs torg@X=18069693@Y=59329264@U=74@L=400110909@", + "extId": "400110909", + "routeIdx": 12, + "lon": 18.069693, + "lat": 59.329264, + "depTime": "00:22:00", + "depDate": "2019-05-03", + "arrTime": "00:22:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Gustav Adolfs torg (Stockholm)@X=18068893@Y=59329848@U=74@L=300101022@", + "mainMastExtId": "300101022" + }, + { + "name": "Slottsbacken", + "id": "A=1@O=Slottsbacken@X=18075402@Y=59325821@U=74@L=400110123@", + "extId": "400110123", + "routeIdx": 13, + "lon": 18.075402, + "lat": 59.325821, + "depTime": "00:25:00", + "depDate": "2019-05-03", + "arrTime": "00:25:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Slottsbacken (Stockholm)@X=18075312@Y=59325938@U=74@L=300101342@", + "mainMastExtId": "300101342" + }, + { + "name": "Slussen (Södermalmstorg)", + "id": "A=1@O=Slussen (Södermalmstorg)@X=18070484@Y=59320185@U=74@L=400111010@", + "extId": "400111010", + "routeIdx": 14, + "lon": 18.070484, + "lat": 59.320185, + "depTime": "00:29:00", + "depDate": "2019-05-03", + "arrTime": "00:29:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Slussen (Stockholm)@X=18071860@Y=59320284@U=74@L=300109192@", + "mainMastExtId": "300109192" + }, + { + "name": "Mariatorget", + "id": "A=1@O=Mariatorget@X=18062448@Y=59318854@U=74@L=400110701@", + "extId": "400110701", + "routeIdx": 15, + "lon": 18.062448, + "lat": 59.318854, + "depTime": "00:30:00", + "depDate": "2019-05-03", + "arrTime": "00:30:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Mariatorget (på Hornsgatan) (Stockholm)@X=18062610@Y=59318827@U=74@L=300101335@", + "mainMastExtId": "300101335" }, - "JourneyDetailRef": { - "ref": "1|10409|2|74|2052019" - }, - "JourneyStatus": "P", - "Product": { - "name": "buss 57", - "num": "36535", - "line": "57", - "catOut": "BUS ", - "catIn": "BUS", - "catCode": "3", - "catOutS": "BUS", - "catOutL": "BUSS ", - "operatorCode": "SL", - "operator": "Storstockholms Lokaltrafik", - "admin": "100057" - }, - "Stops": { - "Stop": [ - { - "name": "Sergels torg", - "id": "A=1@O=Sergels torg@X=18064623@Y=59333929@U=74@L=400111505@", - "extId": "400111505", - "routeIdx": 10, - "lon": 18.064623, - "lat": 59.333929, - "depTime": "00:21:00", - "depDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Sergels torg (Stockholm)@X=18064561@Y=59334621@U=74@L=300101000@", - "mainMastExtId": "300101000" - }, - { - "name": "Jakobsgatan", - "id": "A=1@O=Jakobsgatan@X=18068453@Y=59330307@U=74@L=400110169@", - "extId": "400110169", - "routeIdx": 11, - "lon": 18.068453, - "lat": 59.330307, - "depTime": "00:22:00", - "depDate": "2019-05-03", - "arrTime": "00:22:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Jakobsgatan (Stockholm)@X=18068453@Y=59330675@U=74@L=300101021@", - "mainMastExtId": "300101021" - }, - { - "name": "Gustav Adolfs torg", - "id": "A=1@O=Gustav Adolfs torg@X=18069693@Y=59329264@U=74@L=400110909@", - "extId": "400110909", - "routeIdx": 12, - "lon": 18.069693, - "lat": 59.329264, - "depTime": "00:22:00", - "depDate": "2019-05-03", - "arrTime": "00:22:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Gustav Adolfs torg (Stockholm)@X=18068893@Y=59329848@U=74@L=300101022@", - "mainMastExtId": "300101022" - }, - { - "name": "Slottsbacken", - "id": "A=1@O=Slottsbacken@X=18075402@Y=59325821@U=74@L=400110123@", - "extId": "400110123", - "routeIdx": 13, - "lon": 18.075402, - "lat": 59.325821, - "depTime": "00:25:00", - "depDate": "2019-05-03", - "arrTime": "00:25:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Slottsbacken (Stockholm)@X=18075312@Y=59325938@U=74@L=300101342@", - "mainMastExtId": "300101342" - }, - { - "name": "Slussen (Södermalmstorg)", - "id": "A=1@O=Slussen (Södermalmstorg)@X=18070484@Y=59320185@U=74@L=400111010@", - "extId": "400111010", - "routeIdx": 14, - "lon": 18.070484, - "lat": 59.320185, - "depTime": "00:29:00", - "depDate": "2019-05-03", - "arrTime": "00:29:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Slussen (Stockholm)@X=18071860@Y=59320284@U=74@L=300109192@", - "mainMastExtId": "300109192" - }, - { - "name": "Mariatorget", - "id": "A=1@O=Mariatorget@X=18062448@Y=59318854@U=74@L=400110701@", - "extId": "400110701", - "routeIdx": 15, - "lon": 18.062448, - "lat": 59.318854, - "depTime": "00:30:00", - "depDate": "2019-05-03", - "arrTime": "00:30:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Mariatorget (på Hornsgatan) (Stockholm)@X=18062610@Y=59318827@U=74@L=300101335@", - "mainMastExtId": "300101335" - }, - { - "name": "Krukmakargatan", - "id": "A=1@O=Krukmakargatan@X=18060138@Y=59318090@U=74@L=400110703@", - "extId": "400110703", - "routeIdx": 16, - "lon": 18.060138, - "lat": 59.31809, - "depTime": "00:31:00", - "depDate": "2019-05-03", - "arrTime": "00:31:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Krukmakargatan (påTimmermansg) (Stockholm)@X=18060255@Y=59318108@U=74@L=300101336@", - "mainMastExtId": "300101336" - }, - { - "name": "Wollmar Yxkullsgatan (på Timmermansgatan)", - "id": "A=1@O=Wollmar Yxkullsgatan (på Timmermansgatan)@X=18061028@Y=59316301@U=74@L=400110705@", - "extId": "400110705", - "routeIdx": 17, - "lon": 18.061028, - "lat": 59.316301, - "depTime": "00:32:00", - "depDate": "2019-05-03", - "arrTime": "00:32:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Wollmar Yxkullsg (på T.mansg) (Stockholm)@X=18061522@Y=59316283@U=74@L=300101337@", - "mainMastExtId": "300101337" - }, - { - "name": "Fatbursgatan", - "id": "A=1@O=Fatbursgatan@X=18061891@Y=59314504@U=74@L=400110707@", - "extId": "400110707", - "routeIdx": 18, - "lon": 18.061891, - "lat": 59.314504, - "depTime": "00:32:00", - "depDate": "2019-05-03", - "arrTime": "00:32:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Fatbursgatan (Stockholm)@X=18061855@Y=59314414@U=74@L=300101338@", - "mainMastExtId": "300101338" - }, - { - "name": "Södra station (på Swedenborgsgatan)", - "id": "A=1@O=Södra station (på Swedenborgsgatan)@X=18064947@Y=59313910@U=74@L=400110763@", - "extId": "400110763", - "routeIdx": 19, - "lon": 18.064947, - "lat": 59.31391, - "arrTime": "00:34:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", - "mainMastExtId": "300101339" - } - ] - }, - "idx": "0", - "name": "buss 57", - "number": "36535", - "category": "BUS", - "type": "JNY", - "reachable": true, - "direction": "Sofia" - }, - { - "Origin": { + { + "name": "Krukmakargatan", + "id": "A=1@O=Krukmakargatan@X=18060138@Y=59318090@U=74@L=400110703@", + "extId": "400110703", + "routeIdx": 16, + "lon": 18.060138, + "lat": 59.31809, + "depTime": "00:31:00", + "depDate": "2019-05-03", + "arrTime": "00:31:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Krukmakargatan (påTimmermansg) (Stockholm)@X=18060255@Y=59318108@U=74@L=300101336@", + "mainMastExtId": "300101336" + }, + { + "name": "Wollmar Yxkullsgatan (på Timmermansgatan)", + "id": "A=1@O=Wollmar Yxkullsgatan (på Timmermansgatan)@X=18061028@Y=59316301@U=74@L=400110705@", + "extId": "400110705", + "routeIdx": 17, + "lon": 18.061028, + "lat": 59.316301, + "depTime": "00:32:00", + "depDate": "2019-05-03", + "arrTime": "00:32:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Wollmar Yxkullsg (på T.mansg) (Stockholm)@X=18061522@Y=59316283@U=74@L=300101337@", + "mainMastExtId": "300101337" + }, + { + "name": "Fatbursgatan", + "id": "A=1@O=Fatbursgatan@X=18061891@Y=59314504@U=74@L=400110707@", + "extId": "400110707", + "routeIdx": 18, + "lon": 18.061891, + "lat": 59.314504, + "depTime": "00:32:00", + "depDate": "2019-05-03", + "arrTime": "00:32:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Fatbursgatan (Stockholm)@X=18061855@Y=59314414@U=74@L=300101338@", + "mainMastExtId": "300101338" + }, + { "name": "Södra station (på Swedenborgsgatan)", - "type": "ST", "id": "A=1@O=Södra station (på Swedenborgsgatan)@X=18064947@Y=59313910@U=74@L=400110763@", "extId": "400110763", + "routeIdx": 19, "lon": 18.064947, "lat": 59.31391, - "time": "00:35:00", - "date": "2019-05-03", + "arrTime": "00:34:00", + "arrDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", "mainMastExtId": "300101339" - }, - "Destination": { + } + ] + }, + "idx": "0", + "name": "buss 57", + "number": "36535", + "category": "BUS", + "type": "JNY", + "reachable": true, + "direction": "Sofia" + }, + { + "Origin": { + "name": "Södra station (på Swedenborgsgatan)", + "type": "ST", + "id": "A=1@O=Södra station (på Swedenborgsgatan)@X=18064947@Y=59313910@U=74@L=400110763@", + "extId": "400110763", + "lon": 18.064947, + "lat": 59.31391, + "time": "00:35:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", + "mainMastExtId": "300101339" + }, + "Destination": { + "name": "Stockholms södra", + "type": "ST", + "id": "A=1@O=Stockholms södra@X=18061819@Y=59313542@U=74@L=400105132@", + "extId": "400105132", + "lon": 18.061819, + "lat": 59.313542, + "time": "00:39:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", + "mainMastExtId": "300101339" + }, + "idx": "1", + "name": "", + "type": "WALK", + "duration": "PT4M", + "dist": 182, + "hide": true + }, + { + "Origin": { + "name": "Stockholms södra", + "type": "ST", + "id": "A=1@O=Stockholms södra@X=18061819@Y=59313542@U=74@L=400105132@", + "extId": "400105132", + "lon": 18.061819, + "lat": 59.313542, + "prognosisType": "PROGNOSED", + "time": "05:22:00", + "date": "2019-05-03", + "track": "1", + "hasMainMast": true, + "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", + "mainMastExtId": "300101339" + }, + "Destination": { + "name": "Märsta", + "type": "ST", + "id": "A=1@O=Märsta@X=17860955@Y=59627706@U=74@L=400105122@", + "extId": "400105122", + "lon": 17.860955, + "lat": 59.627706, + "prognosisType": "PROGNOSED", + "time": "06:04:00", + "date": "2019-05-03", + "track": "7", + "hasMainMast": true, + "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", + "mainMastExtId": "300109500" + }, + "JourneyDetailRef": { + "ref": "1|8019|0|74|3052019" + }, + "JourneyStatus": "P", + "Product": { + "name": "Pendeltåg 41", + "num": "2904", + "line": "41", + "catOut": "TRAIN ", + "catIn": "TRN", + "catCode": "0", + "catOutS": "TRN", + "catOutL": "PENDELTÅG ", + "operatorCode": "SL", + "operator": "Storstockholms Lokaltrafik", + "admin": "100041" + }, + "Stops": { + "Stop": [ + { "name": "Stockholms södra", - "type": "ST", "id": "A=1@O=Stockholms södra@X=18061819@Y=59313542@U=74@L=400105132@", "extId": "400105132", + "routeIdx": 2, "lon": 18.061819, "lat": 59.313542, - "time": "00:39:00", - "date": "2019-05-03", + "depTime": "05:22:00", + "depDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", "mainMastExtId": "300101339" }, - "idx": "1", - "name": "", - "type": "WALK", - "duration": "PT4M", - "dist": 182, - "hide": true - }, - { - "Origin": { - "name": "Stockholms södra", - "type": "ST", - "id": "A=1@O=Stockholms södra@X=18061819@Y=59313542@U=74@L=400105132@", - "extId": "400105132", - "lon": 18.061819, - "lat": 59.313542, - "prognosisType": "PROGNOSED", - "time": "05:22:00", - "date": "2019-05-03", - "track": "1", + { + "name": "Stockholm City", + "id": "A=1@O=Stockholm City@X=18059464@Y=59331125@U=74@L=400105312@", + "extId": "400105312", + "routeIdx": 3, + "lon": 18.059464, + "lat": 59.331125, + "depTime": "05:27:00", + "depDate": "2019-05-03", + "arrTime": "05:25:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", - "mainMastExtId": "300101339" + "mainMastId": "A=1@O=Centralen (Stockholm)@X=18057657@Y=59331134@U=74@L=300101002@", + "mainMastExtId": "300101002" }, - "Destination": { - "name": "Märsta", - "type": "ST", - "id": "A=1@O=Märsta@X=17860955@Y=59627706@U=74@L=400105122@", - "extId": "400105122", - "lon": 17.860955, - "lat": 59.627706, - "prognosisType": "PROGNOSED", - "time": "06:04:00", - "date": "2019-05-03", - "track": "7", + { + "name": "Stockholm Odenplan", + "id": "A=1@O=Stockholm Odenplan@X=18045719@Y=59343215@U=74@L=400105320@", + "extId": "400105320", + "routeIdx": 4, + "lon": 18.045719, + "lat": 59.343215, + "depTime": "05:30:00", + "depDate": "2019-05-03", + "arrTime": "05:30:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", - "mainMastExtId": "300109500" + "mainMastId": "A=1@O=Stockholm Odenplan (Stockholm)@X=18045683@Y=59343116@U=74@L=300101079@", + "mainMastExtId": "300101079" }, - "JourneyDetailRef": { - "ref": "1|8019|0|74|3052019" - }, - "JourneyStatus": "P", - "Product": { - "name": "Pendeltåg 41", - "num": "2904", - "line": "41", - "catOut": "TRAIN ", - "catIn": "TRN", - "catCode": "0", - "catOutS": "TRN", - "catOutL": "PENDELTÅG ", - "operatorCode": "SL", - "operator": "Storstockholms Lokaltrafik", - "admin": "100041" - }, - "Stops": { - "Stop": [ - { - "name": "Stockholms södra", - "id": "A=1@O=Stockholms södra@X=18061819@Y=59313542@U=74@L=400105132@", - "extId": "400105132", - "routeIdx": 2, - "lon": 18.061819, - "lat": 59.313542, - "depTime": "05:22:00", - "depDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Södra station(på Swedenborgsg) (Stockholm)@X=18065064@Y=59314099@U=74@L=300101339@", - "mainMastExtId": "300101339" - }, - { - "name": "Stockholm City", - "id": "A=1@O=Stockholm City@X=18059464@Y=59331125@U=74@L=400105312@", - "extId": "400105312", - "routeIdx": 3, - "lon": 18.059464, - "lat": 59.331125, - "depTime": "05:27:00", - "depDate": "2019-05-03", - "arrTime": "05:25:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Centralen (Stockholm)@X=18057657@Y=59331134@U=74@L=300101002@", - "mainMastExtId": "300101002" - }, - { - "name": "Stockholm Odenplan", - "id": "A=1@O=Stockholm Odenplan@X=18045719@Y=59343215@U=74@L=400105320@", - "extId": "400105320", - "routeIdx": 4, - "lon": 18.045719, - "lat": 59.343215, - "depTime": "05:30:00", - "depDate": "2019-05-03", - "arrTime": "05:30:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Stockholm Odenplan (Stockholm)@X=18045683@Y=59343116@U=74@L=300101079@", - "mainMastExtId": "300101079" - }, - { - "name": "Solna", - "id": "A=1@O=Solna@X=18009556@Y=59366497@U=74@L=400105032@", - "extId": "400105032", - "routeIdx": 5, - "lon": 18.009556, - "lat": 59.366497, - "depTime": "05:34:00", - "depDate": "2019-05-03", - "arrTime": "05:34:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Solna (Solna)@X=18011866@Y=59364313@U=74@L=300109509@", - "mainMastExtId": "300109509" - }, - { - "name": "Ulriksdal", - "id": "A=1@O=Ulriksdal@X=18001070@Y=59379909@U=74@L=400105042@", - "extId": "400105042", - "routeIdx": 6, - "lon": 18.00107, - "lat": 59.379909, - "depTime": "05:37:00", - "depDate": "2019-05-03", - "arrTime": "05:37:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Ulriksdals station östra (Solna)@X=18001519@Y=59380709@U=74@L=300103397@", - "mainMastExtId": "300103397" - }, - { - "name": "Helenelund", - "id": "A=1@O=Helenelund@X=17962048@Y=59409385@U=74@L=400105052@", - "extId": "400105052", - "routeIdx": 7, - "lon": 17.962048, - "lat": 59.409385, - "depTime": "05:40:00", - "depDate": "2019-05-03", - "arrTime": "05:40:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Helenelund (Sollentuna)@X=17962263@Y=59409466@U=74@L=300109507@", - "mainMastExtId": "300109507" - }, - { - "name": "Sollentuna", - "id": "A=1@O=Sollentuna@X=17948842@Y=59428001@U=74@L=400105062@", - "extId": "400105062", - "routeIdx": 8, - "lon": 17.948842, - "lat": 59.428001, - "depTime": "05:43:00", - "depDate": "2019-05-03", - "arrTime": "05:43:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Sollentuna (Sollentuna)@X=17948186@Y=59429592@U=74@L=300109506@", - "mainMastExtId": "300109506" - }, - { - "name": "Häggvik", - "id": "A=1@O=Häggvik@X=17933183@Y=59443544@U=74@L=400105072@", - "extId": "400105072", - "routeIdx": 9, - "lon": 17.933183, - "lat": 59.443544, - "depTime": "05:46:00", - "depDate": "2019-05-03", - "arrTime": "05:46:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Häggvik (Sollentuna)@X=17933408@Y=59444569@U=74@L=300109505@", - "mainMastExtId": "300109505" - }, - { - "name": "Norrviken", - "id": "A=1@O=Norrviken@X=17924581@Y=59457971@U=74@L=400105082@", - "extId": "400105082", - "routeIdx": 10, - "lon": 17.924581, - "lat": 59.457971, - "depTime": "05:48:00", - "depDate": "2019-05-03", - "arrTime": "05:48:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Norrviken (Sollentuna)@X=17923870@Y=59458124@U=74@L=300109504@", - "mainMastExtId": "300109504" - }, - { - "name": "Rotebro", - "id": "A=1@O=Rotebro@X=17914099@Y=59476561@U=74@L=400105092@", - "extId": "400105092", - "routeIdx": 11, - "lon": 17.914099, - "lat": 59.476561, - "depTime": "05:51:00", - "depDate": "2019-05-03", - "arrTime": "05:51:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Rotebro (Sollentuna)@X=17914009@Y=59476489@U=74@L=300109503@", - "mainMastExtId": "300109503" - }, - { - "name": "Upplands Väsby", - "id": "A=1@O=Upplands Väsby@X=17899519@Y=59521597@U=74@L=400105102@", - "extId": "400105102", - "routeIdx": 12, - "lon": 17.899519, - "lat": 59.521597, - "depTime": "05:55:00", - "depDate": "2019-05-03", - "arrTime": "05:55:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Upplands Väsby (Upplands Väsby)@X=17899671@Y=59521480@U=74@L=300109502@", - "mainMastExtId": "300109502" - }, - { - "name": "Rosersberg", - "id": "A=1@O=Rosersberg@X=17880237@Y=59583029@U=74@L=400105112@", - "extId": "400105112", - "routeIdx": 13, - "lon": 17.880237, - "lat": 59.583029, - "depTime": "06:00:00", - "depDate": "2019-05-03", - "arrTime": "06:00:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Rosersberg (Sigtuna)@X=17880084@Y=59583200@U=74@L=300109501@", - "mainMastExtId": "300109501" - }, - { - "name": "Märsta", - "id": "A=1@O=Märsta@X=17860955@Y=59627706@U=74@L=400105122@", - "extId": "400105122", - "routeIdx": 14, - "lon": 17.860955, - "lat": 59.627706, - "arrPrognosisType": "PROGNOSED", - "arrTime": "06:04:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", - "mainMastExtId": "300109500" - } - ] - }, - "idx": "2", - "name": "Pendeltåg 41", - "number": "2904", - "category": "TRN", - "type": "JNY", - "reachable": true, - "direction": "Märsta" - }, - { - "Origin": { + { + "name": "Solna", + "id": "A=1@O=Solna@X=18009556@Y=59366497@U=74@L=400105032@", + "extId": "400105032", + "routeIdx": 5, + "lon": 18.009556, + "lat": 59.366497, + "depTime": "05:34:00", + "depDate": "2019-05-03", + "arrTime": "05:34:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Solna (Solna)@X=18011866@Y=59364313@U=74@L=300109509@", + "mainMastExtId": "300109509" + }, + { + "name": "Ulriksdal", + "id": "A=1@O=Ulriksdal@X=18001070@Y=59379909@U=74@L=400105042@", + "extId": "400105042", + "routeIdx": 6, + "lon": 18.00107, + "lat": 59.379909, + "depTime": "05:37:00", + "depDate": "2019-05-03", + "arrTime": "05:37:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Ulriksdals station östra (Solna)@X=18001519@Y=59380709@U=74@L=300103397@", + "mainMastExtId": "300103397" + }, + { + "name": "Helenelund", + "id": "A=1@O=Helenelund@X=17962048@Y=59409385@U=74@L=400105052@", + "extId": "400105052", + "routeIdx": 7, + "lon": 17.962048, + "lat": 59.409385, + "depTime": "05:40:00", + "depDate": "2019-05-03", + "arrTime": "05:40:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Helenelund (Sollentuna)@X=17962263@Y=59409466@U=74@L=300109507@", + "mainMastExtId": "300109507" + }, + { + "name": "Sollentuna", + "id": "A=1@O=Sollentuna@X=17948842@Y=59428001@U=74@L=400105062@", + "extId": "400105062", + "routeIdx": 8, + "lon": 17.948842, + "lat": 59.428001, + "depTime": "05:43:00", + "depDate": "2019-05-03", + "arrTime": "05:43:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sollentuna (Sollentuna)@X=17948186@Y=59429592@U=74@L=300109506@", + "mainMastExtId": "300109506" + }, + { + "name": "Häggvik", + "id": "A=1@O=Häggvik@X=17933183@Y=59443544@U=74@L=400105072@", + "extId": "400105072", + "routeIdx": 9, + "lon": 17.933183, + "lat": 59.443544, + "depTime": "05:46:00", + "depDate": "2019-05-03", + "arrTime": "05:46:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Häggvik (Sollentuna)@X=17933408@Y=59444569@U=74@L=300109505@", + "mainMastExtId": "300109505" + }, + { + "name": "Norrviken", + "id": "A=1@O=Norrviken@X=17924581@Y=59457971@U=74@L=400105082@", + "extId": "400105082", + "routeIdx": 10, + "lon": 17.924581, + "lat": 59.457971, + "depTime": "05:48:00", + "depDate": "2019-05-03", + "arrTime": "05:48:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Norrviken (Sollentuna)@X=17923870@Y=59458124@U=74@L=300109504@", + "mainMastExtId": "300109504" + }, + { + "name": "Rotebro", + "id": "A=1@O=Rotebro@X=17914099@Y=59476561@U=74@L=400105092@", + "extId": "400105092", + "routeIdx": 11, + "lon": 17.914099, + "lat": 59.476561, + "depTime": "05:51:00", + "depDate": "2019-05-03", + "arrTime": "05:51:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Rotebro (Sollentuna)@X=17914009@Y=59476489@U=74@L=300109503@", + "mainMastExtId": "300109503" + }, + { + "name": "Upplands Väsby", + "id": "A=1@O=Upplands Väsby@X=17899519@Y=59521597@U=74@L=400105102@", + "extId": "400105102", + "routeIdx": 12, + "lon": 17.899519, + "lat": 59.521597, + "depTime": "05:55:00", + "depDate": "2019-05-03", + "arrTime": "05:55:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Upplands Väsby (Upplands Väsby)@X=17899671@Y=59521480@U=74@L=300109502@", + "mainMastExtId": "300109502" + }, + { + "name": "Rosersberg", + "id": "A=1@O=Rosersberg@X=17880237@Y=59583029@U=74@L=400105112@", + "extId": "400105112", + "routeIdx": 13, + "lon": 17.880237, + "lat": 59.583029, + "depTime": "06:00:00", + "depDate": "2019-05-03", + "arrTime": "06:00:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Rosersberg (Sigtuna)@X=17880084@Y=59583200@U=74@L=300109501@", + "mainMastExtId": "300109501" + }, + { "name": "Märsta", - "type": "ST", "id": "A=1@O=Märsta@X=17860955@Y=59627706@U=74@L=400105122@", "extId": "400105122", + "routeIdx": 14, "lon": 17.860955, "lat": 59.627706, - "time": "06:05:00", - "date": "2019-05-03", + "arrPrognosisType": "PROGNOSED", + "arrTime": "06:04:00", + "arrDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", "mainMastExtId": "300109500" - }, - "Destination": { + } + ] + }, + "idx": "2", + "name": "Pendeltåg 41", + "number": "2904", + "category": "TRN", + "type": "JNY", + "reachable": true, + "direction": "Märsta" + }, + { + "Origin": { + "name": "Märsta", + "type": "ST", + "id": "A=1@O=Märsta@X=17860955@Y=59627706@U=74@L=400105122@", + "extId": "400105122", + "lon": 17.860955, + "lat": 59.627706, + "time": "06:05:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", + "mainMastExtId": "300109500" + }, + "Destination": { + "name": "Märsta station", + "type": "ST", + "id": "A=1@O=Märsta station@X=17861090@Y=59628883@U=74@L=400157033@", + "extId": "400157033", + "lon": 17.86109, + "lat": 59.628883, + "time": "06:08:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", + "mainMastExtId": "300109500" + }, + "idx": "3", + "name": "", + "type": "WALK", + "duration": "PT3M", + "dist": 131, + "hide": true + }, + { + "Origin": { + "name": "Märsta station", + "type": "ST", + "id": "A=1@O=Märsta station@X=17861090@Y=59628883@U=74@L=400157033@", + "extId": "400157033", + "lon": 17.86109, + "lat": 59.628883, + "prognosisType": "PROGNOSED", + "time": "06:11:00", + "date": "2019-05-03", + "track": "B", + "hasMainMast": true, + "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", + "mainMastExtId": "300109500" + }, + "Destination": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", + "extId": "400152003", + "lon": 17.723618, + "lat": 59.617323, + "prognosisType": "PROGNOSED", + "time": "06:29:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "JourneyDetailRef": { + "ref": "1|27870|0|74|3052019" + }, + "JourneyStatus": "P", + "Product": { + "name": "buss 575", + "num": "15117", + "line": "575", + "catOut": "BUS ", + "catIn": "BUS", + "catCode": "3", + "catOutS": "BUS", + "catOutL": "BUSS ", + "operatorCode": "SL", + "operator": "Storstockholms Lokaltrafik", + "admin": "100575" + }, + "Stops": { + "Stop": [ + { "name": "Märsta station", - "type": "ST", "id": "A=1@O=Märsta station@X=17861090@Y=59628883@U=74@L=400157033@", "extId": "400157033", + "routeIdx": 0, "lon": 17.86109, "lat": 59.628883, - "time": "06:08:00", - "date": "2019-05-03", + "depPrognosisType": "PROGNOSED", + "depTime": "06:11:00", + "depDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", "mainMastExtId": "300109500" }, - "idx": "3", - "name": "", - "type": "WALK", - "duration": "PT3M", - "dist": 131, - "hide": true - }, - { - "Origin": { - "name": "Märsta station", - "type": "ST", - "id": "A=1@O=Märsta station@X=17861090@Y=59628883@U=74@L=400157033@", - "extId": "400157033", - "lon": 17.86109, - "lat": 59.628883, - "prognosisType": "PROGNOSED", - "time": "06:11:00", - "date": "2019-05-03", - "track": "B", + { + "name": "Dragonvägen", + "id": "A=1@O=Dragonvägen@X=17852343@Y=59627553@U=74@L=400151252@", + "extId": "400151252", + "routeIdx": 1, + "lon": 17.852343, + "lat": 59.627553, + "depTime": "06:12:00", + "depDate": "2019-05-03", + "arrTime": "06:12:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", - "mainMastExtId": "300109500" + "mainMastId": "A=1@O=Dragonvägen (Sigtuna)@X=17852190@Y=59627841@U=74@L=300105020@", + "mainMastExtId": "300105020" }, - "Destination": { - "name": "Sigtuna busstation", - "type": "ST", - "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", - "extId": "400152003", - "lon": 17.723618, - "lat": 59.617323, - "prognosisType": "PROGNOSED", - "time": "06:29:00", - "date": "2019-05-03", + { + "name": "Skogsvägen", + "id": "A=1@O=Skogsvägen@X=17843021@Y=59626447@U=74@L=400151973@", + "extId": "400151973", + "routeIdx": 2, + "lon": 17.843021, + "lat": 59.626447, + "depTime": "06:12:00", + "depDate": "2019-05-03", + "arrTime": "06:12:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" + "mainMastId": "A=1@O=Skogsvägen (Märsta) (Sigtuna)@X=17843129@Y=59626474@U=74@L=300105037@", + "mainMastExtId": "300105037" }, - "JourneyDetailRef": { - "ref": "1|27870|0|74|3052019" - }, - "JourneyStatus": "P", - "Product": { - "name": "buss 575", - "num": "15117", - "line": "575", - "catOut": "BUS ", - "catIn": "BUS", - "catCode": "3", - "catOutS": "BUS", - "catOutL": "BUSS ", - "operatorCode": "SL", - "operator": "Storstockholms Lokaltrafik", - "admin": "100575" - }, - "Stops": { - "Stop": [ - { - "name": "Märsta station", - "id": "A=1@O=Märsta station@X=17861090@Y=59628883@U=74@L=400157033@", - "extId": "400157033", - "routeIdx": 0, - "lon": 17.86109, - "lat": 59.628883, - "depPrognosisType": "PROGNOSED", - "depTime": "06:11:00", - "depDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Märsta (Sigtuna)@X=17860955@Y=59628919@U=74@L=300109500@", - "mainMastExtId": "300109500" - }, - { - "name": "Dragonvägen", - "id": "A=1@O=Dragonvägen@X=17852343@Y=59627553@U=74@L=400151252@", - "extId": "400151252", - "routeIdx": 1, - "lon": 17.852343, - "lat": 59.627553, - "depTime": "06:12:00", - "depDate": "2019-05-03", - "arrTime": "06:12:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Dragonvägen (Sigtuna)@X=17852190@Y=59627841@U=74@L=300105020@", - "mainMastExtId": "300105020" - }, - { - "name": "Skogsvägen", - "id": "A=1@O=Skogsvägen@X=17843021@Y=59626447@U=74@L=400151973@", - "extId": "400151973", - "routeIdx": 2, - "lon": 17.843021, - "lat": 59.626447, - "depTime": "06:12:00", - "depDate": "2019-05-03", - "arrTime": "06:12:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Skogsvägen (Märsta) (Sigtuna)@X=17843129@Y=59626474@U=74@L=300105037@", - "mainMastExtId": "300105037" - }, - { - "name": "Monumentvägen", - "id": "A=1@O=Monumentvägen@X=17834832@Y=59626924@U=74@L=400151975@", - "extId": "400151975", - "routeIdx": 3, - "lon": 17.834832, - "lat": 59.626924, - "depTime": "06:13:00", - "depDate": "2019-05-03", - "arrTime": "06:13:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Monumentvägen (Sigtuna)@X=17835983@Y=59626906@U=74@L=300105038@", - "mainMastExtId": "300105038" - }, - { - "name": "Ekilla gård norra", - "id": "A=1@O=Ekilla gård norra@X=17824782@Y=59629611@U=74@L=400151977@", - "extId": "400151977", - "routeIdx": 4, - "lon": 17.824782, - "lat": 59.629611, - "depTime": "06:15:00", - "depDate": "2019-05-03", - "arrTime": "06:15:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Ekilla gård norra (Sigtuna)@X=17824836@Y=59629611@U=74@L=300105072@", - "mainMastExtId": "300105072" - }, - { - "name": "Sundvedatorp", - "id": "A=1@O=Sundvedatorp@X=17814984@Y=59630367@U=74@L=400151979@", - "extId": "400151979", - "routeIdx": 5, - "lon": 17.814984, - "lat": 59.630367, - "depTime": "06:15:00", - "depDate": "2019-05-03", - "arrTime": "06:15:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Sundvedatorp (Sigtuna)@X=17815362@Y=59630394@U=74@L=300105081@", - "mainMastExtId": "300105081" - }, - { - "name": "Ölsta", - "id": "A=1@O=Ölsta@X=17794201@Y=59626447@U=74@L=400151983@", - "extId": "400151983", - "routeIdx": 6, - "lon": 17.794201, - "lat": 59.626447, - "depTime": "06:18:00", - "depDate": "2019-05-03", - "arrTime": "06:18:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Ölsta (Sigtuna)@X=17793671@Y=59626429@U=74@L=300105083@", - "mainMastExtId": "300105083" - }, - { - "name": "Rävsta gård", - "id": "A=1@O=Rävsta gård@X=17775746@Y=59627517@U=74@L=400151987@", - "extId": "400151987", - "routeIdx": 7, - "lon": 17.775746, - "lat": 59.627517, - "depTime": "06:19:00", - "depDate": "2019-05-03", - "arrTime": "06:19:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Rävsta gård (Sigtuna)@X=17774685@Y=59627607@U=74@L=300105085@", - "mainMastExtId": "300105085" - }, - { - "name": "Svalängen", - "id": "A=1@O=Svalängen@X=17765534@Y=59628793@U=74@L=400151989@", - "extId": "400151989", - "routeIdx": 8, - "lon": 17.765534, - "lat": 59.628793, - "depTime": "06:20:00", - "depDate": "2019-05-03", - "arrTime": "06:20:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Svalängen (Sigtuna)@X=17765678@Y=59628775@U=74@L=300105086@", - "mainMastExtId": "300105086" - }, - { - "name": "Nyponvägen", - "id": "A=1@O=Nyponvägen@X=17723078@Y=59626070@U=74@L=400157945@", - "extId": "400157945", - "routeIdx": 9, - "lon": 17.723078, - "lat": 59.62607, - "depTime": "06:25:00", - "depDate": "2019-05-03", - "arrTime": "06:25:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Nyponvägen (Sigtuna)@X=17722943@Y=59626061@U=74@L=300105123@", - "mainMastExtId": "300105123" - }, - { - "name": "Haraldsborgsvägen", - "id": "A=1@O=Haraldsborgsvägen@X=17725910@Y=59623490@U=74@L=400157947@", - "extId": "400157947", - "routeIdx": 10, - "lon": 17.72591, - "lat": 59.62349, - "depTime": "06:26:00", - "depDate": "2019-05-03", - "arrTime": "06:26:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Haraldsborgsvägen (Sigtuna)@X=17726090@Y=59623517@U=74@L=300105124@", - "mainMastExtId": "300105124" - }, - { - "name": "Sigtuna busstation", - "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", - "extId": "400152003", - "routeIdx": 11, - "lon": 17.723618, - "lat": 59.617323, - "arrTime": "06:29:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" - } - ] - }, - "idx": "4", - "name": "buss 575", - "number": "15117", - "category": "BUS", - "type": "JNY", - "reachable": true, - "direction": "Sigtuna (Hällsboskolan)" - }, - { - "Origin": { - "name": "Sigtuna busstation", - "type": "ST", - "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", - "extId": "400152003", - "lon": 17.723618, - "lat": 59.617323, - "time": "06:30:00", - "date": "2019-05-03", + { + "name": "Monumentvägen", + "id": "A=1@O=Monumentvägen@X=17834832@Y=59626924@U=74@L=400151975@", + "extId": "400151975", + "routeIdx": 3, + "lon": 17.834832, + "lat": 59.626924, + "depTime": "06:13:00", + "depDate": "2019-05-03", + "arrTime": "06:13:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" + "mainMastId": "A=1@O=Monumentvägen (Sigtuna)@X=17835983@Y=59626906@U=74@L=300105038@", + "mainMastExtId": "300105038" }, - "Destination": { - "name": "Sigtuna busstation", - "type": "ST", - "id": "A=1@O=Sigtuna busstation@X=17722566@Y=59617494@U=74@L=400152126@", - "extId": "400152126", - "lon": 17.722566, - "lat": 59.617494, - "time": "06:31:00", - "date": "2019-05-03", + { + "name": "Ekilla gård norra", + "id": "A=1@O=Ekilla gård norra@X=17824782@Y=59629611@U=74@L=400151977@", + "extId": "400151977", + "routeIdx": 4, + "lon": 17.824782, + "lat": 59.629611, + "depTime": "06:15:00", + "depDate": "2019-05-03", + "arrTime": "06:15:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" + "mainMastId": "A=1@O=Ekilla gård norra (Sigtuna)@X=17824836@Y=59629611@U=74@L=300105072@", + "mainMastExtId": "300105072" }, - "idx": "5", - "name": "", - "type": "WALK", - "duration": "PT1M", - "dist": 62, - "hide": true - }, - { - "Origin": { - "name": "Sigtuna busstation", - "type": "ST", - "id": "A=1@O=Sigtuna busstation@X=17722566@Y=59617494@U=74@L=400152126@", - "extId": "400152126", - "lon": 17.722566, - "lat": 59.617494, - "time": "06:31:00", - "date": "2019-05-03", + { + "name": "Sundvedatorp", + "id": "A=1@O=Sundvedatorp@X=17814984@Y=59630367@U=74@L=400151979@", + "extId": "400151979", + "routeIdx": 5, + "lon": 17.814984, + "lat": 59.630367, + "depTime": "06:15:00", + "depDate": "2019-05-03", + "arrTime": "06:15:00", + "arrDate": "2019-05-03", "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" + "mainMastId": "A=1@O=Sundvedatorp (Sigtuna)@X=17815362@Y=59630394@U=74@L=300105081@", + "mainMastExtId": "300105081" }, - "Destination": { + { + "name": "Ölsta", + "id": "A=1@O=Ölsta@X=17794201@Y=59626447@U=74@L=400151983@", + "extId": "400151983", + "routeIdx": 6, + "lon": 17.794201, + "lat": 59.626447, + "depTime": "06:18:00", + "depDate": "2019-05-03", + "arrTime": "06:18:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Ölsta (Sigtuna)@X=17793671@Y=59626429@U=74@L=300105083@", + "mainMastExtId": "300105083" + }, + { + "name": "Rävsta gård", + "id": "A=1@O=Rävsta gård@X=17775746@Y=59627517@U=74@L=400151987@", + "extId": "400151987", + "routeIdx": 7, + "lon": 17.775746, + "lat": 59.627517, + "depTime": "06:19:00", + "depDate": "2019-05-03", + "arrTime": "06:19:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Rävsta gård (Sigtuna)@X=17774685@Y=59627607@U=74@L=300105085@", + "mainMastExtId": "300105085" + }, + { + "name": "Svalängen", + "id": "A=1@O=Svalängen@X=17765534@Y=59628793@U=74@L=400151989@", + "extId": "400151989", + "routeIdx": 8, + "lon": 17.765534, + "lat": 59.628793, + "depTime": "06:20:00", + "depDate": "2019-05-03", + "arrTime": "06:20:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Svalängen (Sigtuna)@X=17765678@Y=59628775@U=74@L=300105086@", + "mainMastExtId": "300105086" + }, + { + "name": "Nyponvägen", + "id": "A=1@O=Nyponvägen@X=17723078@Y=59626070@U=74@L=400157945@", + "extId": "400157945", + "routeIdx": 9, + "lon": 17.723078, + "lat": 59.62607, + "depTime": "06:25:00", + "depDate": "2019-05-03", + "arrTime": "06:25:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Nyponvägen (Sigtuna)@X=17722943@Y=59626061@U=74@L=300105123@", + "mainMastExtId": "300105123" + }, + { + "name": "Haraldsborgsvägen", + "id": "A=1@O=Haraldsborgsvägen@X=17725910@Y=59623490@U=74@L=400157947@", + "extId": "400157947", + "routeIdx": 10, + "lon": 17.72591, + "lat": 59.62349, + "depTime": "06:26:00", + "depDate": "2019-05-03", + "arrTime": "06:26:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Haraldsborgsvägen (Sigtuna)@X=17726090@Y=59623517@U=74@L=300105124@", + "mainMastExtId": "300105124" + }, + { "name": "Sigtuna busstation", - "type": "ST", - "id": "A=1@O=Sigtuna busstation@X=17723690@Y=59617197@U=74@L=400152004@", - "extId": "400152004", - "lon": 17.72369, - "lat": 59.617197, - "time": "06:32:00", - "date": "2019-05-03", + "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", + "extId": "400152003", + "routeIdx": 11, + "lon": 17.723618, + "lat": 59.617323, + "arrTime": "06:29:00", + "arrDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", "mainMastExtId": "300105100" - }, - "idx": "6", - "name": "", - "type": "WALK", - "duration": "PT1M", - "dist": 71, - "hide": true - }, - { - "Origin": { + } + ] + }, + "idx": "4", + "name": "buss 575", + "number": "15117", + "category": "BUS", + "type": "JNY", + "reachable": true, + "direction": "Sigtuna (Hällsboskolan)" + }, + { + "Origin": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17723618@Y=59617323@U=74@L=400152003@", + "extId": "400152003", + "lon": 17.723618, + "lat": 59.617323, + "time": "06:30:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "Destination": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17722566@Y=59617494@U=74@L=400152126@", + "extId": "400152126", + "lon": 17.722566, + "lat": 59.617494, + "time": "06:31:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "idx": "5", + "name": "", + "type": "WALK", + "duration": "PT1M", + "dist": 62, + "hide": true + }, + { + "Origin": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17722566@Y=59617494@U=74@L=400152126@", + "extId": "400152126", + "lon": 17.722566, + "lat": 59.617494, + "time": "06:31:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "Destination": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17723690@Y=59617197@U=74@L=400152004@", + "extId": "400152004", + "lon": 17.72369, + "lat": 59.617197, + "time": "06:32:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "idx": "6", + "name": "", + "type": "WALK", + "duration": "PT1M", + "dist": 71, + "hide": true + }, + { + "Origin": { + "name": "Sigtuna busstation", + "type": "ST", + "id": "A=1@O=Sigtuna busstation@X=17723690@Y=59617197@U=74@L=400152004@", + "extId": "400152004", + "lon": 17.72369, + "lat": 59.617197, + "prognosisType": "PROGNOSED", + "time": "06:41:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", + "mainMastExtId": "300105100" + }, + "Destination": { + "name": "Märsta centrum östra", + "type": "ST", + "id": "A=1@O=Märsta centrum östra@X=17858006@Y=59619660@U=74@L=400157428@", + "extId": "400157428", + "lon": 17.858006, + "lat": 59.61966, + "prognosisType": "PROGNOSED", + "time": "06:54:00", + "date": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Märsta centrum östra (Sigtuna)@X=17857413@Y=59619094@U=74@L=300105000@", + "mainMastExtId": "300105000" + }, + "JourneyDetailRef": { + "ref": "1|27755|0|74|3052019" + }, + "JourneyStatus": "P", + "Product": { + "name": "buss 572", + "num": "15173", + "line": "572", + "catOut": "BUS ", + "catIn": "BUS", + "catCode": "3", + "catOutS": "BUS", + "catOutL": "BUSS ", + "operatorCode": "SL", + "operator": "Storstockholms Lokaltrafik", + "admin": "100572" + }, + "Stops": { + "Stop": [ + { "name": "Sigtuna busstation", - "type": "ST", "id": "A=1@O=Sigtuna busstation@X=17723690@Y=59617197@U=74@L=400152004@", "extId": "400152004", + "routeIdx": 5, "lon": 17.72369, "lat": 59.617197, - "prognosisType": "PROGNOSED", - "time": "06:41:00", - "date": "2019-05-03", + "depTime": "06:41:00", + "depDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", "mainMastExtId": "300105100" }, - "Destination": { + { + "name": "Pilsbo", + "id": "A=1@O=Pilsbo@X=17721568@Y=59623724@U=74@L=400157960@", + "extId": "400157960", + "routeIdx": 6, + "lon": 17.721568, + "lat": 59.623724, + "depTime": "06:42:00", + "depDate": "2019-05-03", + "arrTime": "06:42:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Pilsbo (Sigtuna)@X=17721694@Y=59624658@U=74@L=300105739@", + "mainMastExtId": "300105739" + }, + { + "name": "Svalängen", + "id": "A=1@O=Svalängen@X=17765813@Y=59628757@U=74@L=400151990@", + "extId": "400151990", + "routeIdx": 7, + "lon": 17.765813, + "lat": 59.628757, + "depTime": "06:46:00", + "depDate": "2019-05-03", + "arrTime": "06:46:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Svalängen (Sigtuna)@X=17765678@Y=59628775@U=74@L=300105086@", + "mainMastExtId": "300105086" + }, + { + "name": "Rävsta gård", + "id": "A=1@O=Rävsta gård@X=17773661@Y=59627679@U=74@L=400151988@", + "extId": "400151988", + "routeIdx": 8, + "lon": 17.773661, + "lat": 59.627679, + "depTime": "06:46:00", + "depDate": "2019-05-03", + "arrTime": "06:46:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Rävsta gård (Sigtuna)@X=17774685@Y=59627607@U=74@L=300105085@", + "mainMastExtId": "300105085" + }, + { + "name": "Ölsta", + "id": "A=1@O=Ölsta@X=17793140@Y=59626411@U=74@L=400151984@", + "extId": "400151984", + "routeIdx": 9, + "lon": 17.79314, + "lat": 59.626411, + "depTime": "06:48:00", + "depDate": "2019-05-03", + "arrTime": "06:48:00", + "arrDate": "2019-05-03", + "hasMainMast": true, + "mainMastId": "A=1@O=Ölsta (Sigtuna)@X=17793671@Y=59626429@U=74@L=300105083@", + "mainMastExtId": "300105083" + }, + { "name": "Märsta centrum östra", - "type": "ST", "id": "A=1@O=Märsta centrum östra@X=17858006@Y=59619660@U=74@L=400157428@", "extId": "400157428", + "routeIdx": 10, "lon": 17.858006, "lat": 59.61966, - "prognosisType": "PROGNOSED", - "time": "06:54:00", - "date": "2019-05-03", + "arrTime": "06:54:00", + "arrDate": "2019-05-03", "hasMainMast": true, "mainMastId": "A=1@O=Märsta centrum östra (Sigtuna)@X=17857413@Y=59619094@U=74@L=300105000@", "mainMastExtId": "300105000" - }, - "JourneyDetailRef": { - "ref": "1|27755|0|74|3052019" - }, - "JourneyStatus": "P", - "Product": { - "name": "buss 572", - "num": "15173", - "line": "572", - "catOut": "BUS ", - "catIn": "BUS", - "catCode": "3", - "catOutS": "BUS", - "catOutL": "BUSS ", - "operatorCode": "SL", - "operator": "Storstockholms Lokaltrafik", - "admin": "100572" - }, - "Stops": { - "Stop": [ - { - "name": "Sigtuna busstation", - "id": "A=1@O=Sigtuna busstation@X=17723690@Y=59617197@U=74@L=400152004@", - "extId": "400152004", - "routeIdx": 5, - "lon": 17.72369, - "lat": 59.617197, - "depTime": "06:41:00", - "depDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Sigtuna busstation (Sigtuna)@X=17723375@Y=59617305@U=74@L=300105100@", - "mainMastExtId": "300105100" - }, - { - "name": "Pilsbo", - "id": "A=1@O=Pilsbo@X=17721568@Y=59623724@U=74@L=400157960@", - "extId": "400157960", - "routeIdx": 6, - "lon": 17.721568, - "lat": 59.623724, - "depTime": "06:42:00", - "depDate": "2019-05-03", - "arrTime": "06:42:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Pilsbo (Sigtuna)@X=17721694@Y=59624658@U=74@L=300105739@", - "mainMastExtId": "300105739" - }, - { - "name": "Svalängen", - "id": "A=1@O=Svalängen@X=17765813@Y=59628757@U=74@L=400151990@", - "extId": "400151990", - "routeIdx": 7, - "lon": 17.765813, - "lat": 59.628757, - "depTime": "06:46:00", - "depDate": "2019-05-03", - "arrTime": "06:46:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Svalängen (Sigtuna)@X=17765678@Y=59628775@U=74@L=300105086@", - "mainMastExtId": "300105086" - }, - { - "name": "Rävsta gård", - "id": "A=1@O=Rävsta gård@X=17773661@Y=59627679@U=74@L=400151988@", - "extId": "400151988", - "routeIdx": 8, - "lon": 17.773661, - "lat": 59.627679, - "depTime": "06:46:00", - "depDate": "2019-05-03", - "arrTime": "06:46:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Rävsta gård (Sigtuna)@X=17774685@Y=59627607@U=74@L=300105085@", - "mainMastExtId": "300105085" - }, - { - "name": "Ölsta", - "id": "A=1@O=Ölsta@X=17793140@Y=59626411@U=74@L=400151984@", - "extId": "400151984", - "routeIdx": 9, - "lon": 17.79314, - "lat": 59.626411, - "depTime": "06:48:00", - "depDate": "2019-05-03", - "arrTime": "06:48:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Ölsta (Sigtuna)@X=17793671@Y=59626429@U=74@L=300105083@", - "mainMastExtId": "300105083" - }, - { - "name": "Märsta centrum östra", - "id": "A=1@O=Märsta centrum östra@X=17858006@Y=59619660@U=74@L=400157428@", - "extId": "400157428", - "routeIdx": 10, - "lon": 17.858006, - "lat": 59.61966, - "arrTime": "06:54:00", - "arrDate": "2019-05-03", - "hasMainMast": true, - "mainMastId": "A=1@O=Märsta centrum östra (Sigtuna)@X=17857413@Y=59619094@U=74@L=300105000@", - "mainMastExtId": "300105000" - } - ] - }, - "idx": "7", - "name": "buss 572", - "number": "15173", - "category": "BUS", - "type": "JNY", - "reachable": true, - "direction": "Märsta station" - } - ] - }, - "idx": 0, - "tripId": "C-0", - "ctxRecon": "T$A=1@O=Sergels torg@L=400111505@a=128@$A=1@O=Södra station (på Swedenborgsgatan)@L=400110763@a=128@$201905030021$201905030034$ $§W$A=1@O=Södra station (på Swedenborgsgatan)@L=400110763@a=128@$A=1@O=Stockholms södra@L=400105132@a=128@$201905030035$201905030039$$§T$A=1@O=Stockholms södra@L=400105132@a=128@$A=1@O=Märsta@L=400105122@a=128@$201905030522$201905030604$ $§W$A=1@O=Märsta@L=400105122@a=128@$A=1@O=Märsta station@L=400157033@a=128@$201905030605$201905030608$$§T$A=1@O=Märsta station@L=400157033@a=128@$A=1@O=Sigtuna busstation@L=400152003@a=128@$201905030611$201905030629$ $§W$A=1@O=Sigtuna busstation@L=400152003@a=128@$A=1@O=Sigtuna busstation@L=400152126@a=128@$201905030630$201905030631$$§W$A=1@O=Sigtuna busstation@L=400152126@a=128@$A=1@O=Sigtuna busstation@L=400152004@a=128@$201905030631$201905030632$$§T$A=1@O=Sigtuna busstation@L=400152004@a=128@$A=1@O=Märsta centrum östra@L=400157428@a=128@$201905030641$201905030654$ $", - "duration": "PT6H33M", - "checksum": "577F5C64_4" - } \ No newline at end of file + } + ] + }, + "idx": "7", + "name": "buss 572", + "number": "15173", + "category": "BUS", + "type": "JNY", + "reachable": true, + "direction": "Märsta station" + } + ] + }, + "idx": 0, + "tripId": "C-0", + "ctxRecon": "T$A=1@O=Sergels torg@L=400111505@a=128@$A=1@O=Södra station (på Swedenborgsgatan)@L=400110763@a=128@$201905030021$201905030034$ $§W$A=1@O=Södra station (på Swedenborgsgatan)@L=400110763@a=128@$A=1@O=Stockholms södra@L=400105132@a=128@$201905030035$201905030039$$§T$A=1@O=Stockholms södra@L=400105132@a=128@$A=1@O=Märsta@L=400105122@a=128@$201905030522$201905030604$ $§W$A=1@O=Märsta@L=400105122@a=128@$A=1@O=Märsta station@L=400157033@a=128@$201905030605$201905030608$$§T$A=1@O=Märsta station@L=400157033@a=128@$A=1@O=Sigtuna busstation@L=400152003@a=128@$201905030611$201905030629$ $§W$A=1@O=Sigtuna busstation@L=400152003@a=128@$A=1@O=Sigtuna busstation@L=400152126@a=128@$201905030630$201905030631$$§W$A=1@O=Sigtuna busstation@L=400152126@a=128@$A=1@O=Sigtuna busstation@L=400152004@a=128@$201905030631$201905030632$$§T$A=1@O=Sigtuna busstation@L=400152004@a=128@$A=1@O=Märsta centrum östra@L=400157428@a=128@$201905030641$201905030654$ $", + "duration": "PT6H33M", + "checksum": "577F5C64_4" +} \ No newline at end of file diff --git a/tests/Trafiklab/Sl/Model/SlRoutePlanningLegTest.php b/tests/Trafiklab/Sl/Model/SlRoutePlanningLegTest.php index 656fd53..f7fcd54 100644 --- a/tests/Trafiklab/Sl/Model/SlRoutePlanningLegTest.php +++ b/tests/Trafiklab/Sl/Model/SlRoutePlanningLegTest.php @@ -14,13 +14,14 @@ function testConstructor_validDepartureBoardJson_shouldReturnCorrectObjectRepres $jsonArray = json_decode(file_get_contents("./tests/Resources/Sl/validRoutePlanningLeg.json"), true); $leg = new SlLeg($jsonArray); - self::assertEquals("Sergels torg", $leg->getOrigin()->getStopName()); - self::assertEquals(1000, $leg->getOrigin()->getStopId()); - self::assertEquals("O", $leg->getOrigin()->getPlatform()); - self::assertEquals(null, $leg->getDestination()->getPlatform()); - self::assertEquals(new DateTime("2019-05-03 00:21:00"), $leg->getOrigin()->getScheduledDepartureTime()); - self::assertNull($leg->getOrigin()->getScheduledArrivalTime()); - self::assertEquals("Södra station (på Swedenborgsgatan)", $leg->getDestination()->getStopName()); + self::assertEquals("Sergels torg", $leg->getDeparture()->getStopName()); + self::assertEquals(1000, $leg->getDeparture()->getStopId()); + self::assertEquals(780, $leg->getDuration()); + self::assertEquals("O", $leg->getDeparture()->getPlatform()); + self::assertEquals(null, $leg->getArrival()->getPlatform()); + self::assertEquals(new DateTime("2019-05-03 00:21:00"), $leg->getDeparture()->getScheduledDepartureTime()); + self::assertNull($leg->getDeparture()->getScheduledArrivalTime()); + self::assertEquals("Södra station (på Swedenborgsgatan)", $leg->getArrival()->getStopName()); self::assertEquals(0, count($leg->getNotes())); self::assertEquals("buss 57", $leg->getVehicle()->getName()); self::assertEquals("Sofia", $leg->getDirection()); diff --git a/tests/Trafiklab/Sl/Model/SlRoutePlanningRequestTest.php b/tests/Trafiklab/Sl/Model/SlRoutePlanningRequestTest.php new file mode 100644 index 0000000..a5a995a --- /dev/null +++ b/tests/Trafiklab/Sl/Model/SlRoutePlanningRequestTest.php @@ -0,0 +1,41 @@ +setOriginStopId("123"); + $request->setDestinationStopId("456"); + + self::assertEquals("123", $request->getOriginStopId()); + self::assertEquals("456", $request->getDestinationStopId()); + + // Test defaults + self::assertEquals("sv", $request->getLanguage()); + self::assertEquals(null, $request->getViaStopId()); + self::assertEquals(RoutePlanningSearchType::DEPART_AT_SPECIFIED_TIME, $request->getRoutePlanningSearchType()); + + $request->setLanguage("en"); + $request->setViaStopId("1234"); + $request->setRoutePlanningSearchType(RoutePlanningSearchType::ARRIVE_AT_SPECIFIED_TIME); + + self::assertEquals("1234", $request->getViaStopId()); + self::assertEquals("en", $request->getLanguage()); + self::assertEquals(RoutePlanningSearchType::ARRIVE_AT_SPECIFIED_TIME, $request->getRoutePlanningSearchType()); + + $now = new DateTime(); + self::assertEquals($now->getTimestamp(), $request->getDateTime()->getTimestamp()); + + $now->setTime(01,23,45); + $request->setDateTime($now); + self::assertEquals($now->getTimestamp(), $request->getDateTime()->getTimestamp()); + + } +} \ No newline at end of file diff --git a/tests/Trafiklab/Sl/Model/SlRoutePlanningResponseTest.php b/tests/Trafiklab/Sl/Model/SlRoutePlanningResponseTest.php new file mode 100644 index 0000000..169be7d --- /dev/null +++ b/tests/Trafiklab/Sl/Model/SlRoutePlanningResponseTest.php @@ -0,0 +1,22 @@ +getOriginalApiResponse()); + self::assertEquals(6, count($response->getTrips())); + } + +} \ No newline at end of file diff --git a/tests/Trafiklab/Sl/Model/SlRoutePlanningTripTest.php b/tests/Trafiklab/Sl/Model/SlRoutePlanningTripTest.php index 171a986..364721c 100644 --- a/tests/Trafiklab/Sl/Model/SlRoutePlanningTripTest.php +++ b/tests/Trafiklab/Sl/Model/SlRoutePlanningTripTest.php @@ -14,6 +14,9 @@ function testConstructor_validDepartureBoardJson_shouldReturnCorrectObjectRepres $trip = new SlTrip($jsonArray); self::assertNotNull($trip->getLegs()); self::assertEquals(8, count($trip->getLegs())); + self::assertEquals(23580, $trip->getDuration()); + self::assertEquals(1000, $trip->getDeparture()->getStopId()); + self::assertEquals(5000, $trip->getArrival()->getStopId()); } } \ No newline at end of file diff --git a/tests/Trafiklab/Sl/SlWrapperIntegrationTest.php b/tests/Trafiklab/Sl/SlWrapperIntegrationTest.php index e12ab89..5f0b161 100644 --- a/tests/Trafiklab/Sl/SlWrapperIntegrationTest.php +++ b/tests/Trafiklab/Sl/SlWrapperIntegrationTest.php @@ -162,8 +162,8 @@ public function testGetRoutePlanning_validParameters_shouldReturnResponse() self::assertTrue(count($response->getTrips()) > 0); $firstTripLegs = $response->getTrips()[0]->getLegs(); - self::assertEquals("9192", $firstTripLegs[0]->getOrigin()->getStopId()); - self::assertEquals("1002", end($firstTripLegs)->getDestination()->getStopId()); + self::assertEquals("9192", $firstTripLegs[0]->getDeparture()->getStopId()); + self::assertEquals("1002", end($firstTripLegs)->getArrival()->getStopId()); } /** @@ -192,12 +192,12 @@ public function testGetRoutePlanning_WithVia_shouldReturnResponse() self::assertTrue(count($response->getTrips()) > 0); $firstTripLegs = $response->getTrips()[0]->getLegs(); - self::assertEquals("1002", $firstTripLegs[0]->getOrigin()->getStopId()); - self::assertEquals("9192", end($firstTripLegs)->getDestination()->getStopId()); + self::assertEquals("1002", $firstTripLegs[0]->getDeparture()->getStopId()); + self::assertEquals("9192", end($firstTripLegs)->getArrival()->getStopId()); $foundViaStation = false; foreach ($response->getTrips()[0]->getLegs() as $leg) { - if ($leg->getDestination()->getStopId() == "9180") { + if ($leg->getArrival()->getStopId() == "9180") { $foundViaStation = true; } }