Till senaste kommentaren
Detta inlägg är gammalt och kan innehålla inaktuell information.

SL Travel Planner 3.1: wrong trip duration (too short)

Hi,

The trip duration in planner results appears to be too short.
This is an example that I get from the server:

  "Trip": [
{

"Leg": [
{
"type": "WALK",
"duration": "PT5M",
"dist": 351
},
{
"category": "BUS",
// duration data missing; this appears to be normal for HAFAS
},
{
"type": "WALK",
"duration": "PT6M",
"dist": 426
},
]
"duration": "PT7M",
}
]

In plain English:
1. a walking leg with 5 minutes duration
2. a bus leg with missing duration variable
3. a walking leg with 6 minutes duration
duration for the whole trip, all 3 legs together: 7 minutes

I can handle the missing duration for the bus leg but I have a problem with the wrong value "duration": "PT7M" of the Trip.

I use a few other HAFAS instances, VÄSTTRAFIK Göteborg, VBB Berlin, RMV Frankfurt, where this variable appears to be correct.

Is this a bug?

Thanks and best regards from Stuttgart Germany
Gerd

Kommentarer

  • Hi Gerd,

    Can you specify the origin and destination station you used to get this result? We'll try to reproduce it and report it to SLs developers.

    Regards,
    Bert
    Bert på Trafiklab
  • Hi Bert,
    This is an example request url without key:

    https://api.sl.se/api2/TravelplannerV3_1/trip?poly=1&originCar=0&originBike=0&originCoordLong=18.068565473809027&destCar=0&format=json&destBike=0&passlist=1&key=*********&numB=0&destCoordLong=18.104814291000366&numF=4&destCoordLat=59.32579569823352&originCoordLat=59.3293397111886&totalWalk=1,0,3000

    Origin and destination appear not to be important, it happened with any examples I tested.

    I also can attach the response if you want.

    Below is the rendered response. The "11 min" comes from trip.duration

    Best regards
    Gerd


  • Hej Gerd,

    Vi felanmäler detta hos SL.

    Kan du prova med ResRobot? ResRobot är också en Hafas implementation, så det borde vara relativt enkelt att byta ut de två.

    Hälsningar,
    Bert
    Bert på Trafiklab
  • Hi Bert,

    I tried ResRobot and doesn't have this bug.

    But I can't just replace SL with ResRobot since ResRobot has more severe problems for my application:
    At least in my tests, ResRobot did not return a Polygon or a PolygonGroup or a gisRef that contains the route coordinates that I draw (see screenshot). It only returns the coordinates of the intermediate stop points and that is ugly when I draw it on the map. (see Screenshot below - it gets uglier when the distance between stops is longer but I chose to use the same route as above)

    As a workaround for SL, I calculate (arrival time of destination of last leg - departure time of departure of first leg). That workaround for SL appears to be good in the few tests I made.

    Do you have an idea how I can persuade ResRobot to return a Polygon for the Route that does not only consist of the coordinates of the stop points? 

    https://api.resrobot.se/v2/trip?numF=4&poly=1&destCoordLat=59.32579569823352&destCoordLong=18.104814291000366&format=json&key=******&originBike=0&destCar=0&numB=0&destBike=0&originCoordLat=59.3293397111886&totalWalk=1,0,3000&passlist=1&originCoordLong=18.068565473809027&originCar=0

    Best regards
    Gerd

  • Do you have an idea how I can persuade ResRobot to return a Polygon for the Route that does not only consist of the coordinates of the stop points? 
    Unfortunately detailed shapes are not availble in ResRobot.

    Regards,
    Bert
    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.