LDBWS GetArrivalBoardRequest timeOffset with timeWindow inconsistent behaviour

95 views
Skip to first unread message

Tuire Holappa

unread,
Jan 16, 2019, 8:47:30 AM1/16/19
to A gathering place for the Open Rail Data community
Hi,

Using Darwin LDBWS I'm trying to find a long distance train from the destination arrival board when it is on route.

I noticed that there is inconsistent behaviour with the GetArrivalBoardRequest timeOffset with timeWindow parameters

When providing values 
<ldb:timeOffset>60</ldb:timeOffset>
<ldb:timeWindow>120</ldb:timeWindow>

API returns services from 1 hour on and the time window seems to be 1 hour

When using 
 <ldb:timeOffset>119</ldb:timeOffset>
 <ldb:timeWindow>120</ldb:timeWindow>

API returns services from 2 hours on and the time window seems to be 2 hours


I was expecting for both the queries to get the 2 hour window from the time defined by the timeOffset 

Best regards,
Tuire

Tuire Holappa

unread,
Jan 17, 2019, 3:03:38 AM1/17/19
to A gathering place for the Open Rail Data community
 I think I need to take the advice of Rail Ale Fan and change to use the staff version of the API to get the data using time parameter
https://groups.google.com/d/msg/openraildata-talk/0D1KcOSoo8I/nzvfZQNCDQAJ

Michael Flynn

unread,
Jan 17, 2019, 3:33:40 AM1/17/19
to A gathering place for the Open Rail Data community
Not to answer the original query but is there any advantage to using the non-staff version?  There are so many versions; public, staff, open, lite, historical.  I guess the 'staff version' is named so for legacy reason but none-the-less is still all a bit confusing.  Backward-compatibility might be an issue but can't we have just one version?  Surely this would be easier for everyone?

Mike

Rail Ale Fan

unread,
Jan 17, 2019, 3:41:11 AM1/17/19
to A gathering place for the Open Rail Data community
Hi Tuire,

Yes, Staff Version is what you need but it looks like you have stumbled upon a "quirk" in OpenLDBWS!

As I understand it, OpenLDBWS is intended to provide access to a sliding 4 hour window from (now-2) hours to (now+2) hours.

An exception only occurs if no part of timeOffset + timeWindow is within that period, so although the documentation states that timeOffset is valid for -120 to 120, you can actually specify a timeOffset of -239 and a timeWindow of 120 which just falls within the first minute of the valid period.

However the edge case parameters you identified of timeOffset=119 and timeWindow=120 do indeed provide 2 hours from (now+2) hours which I don't believe is intended.  A test using timeOffset=118 and timeWindow=120 behaves as expected, with only a short response right at the end of the 4 hour window as expected.

Cheers!
- https://twitter.com/RailAleFan -

Tuire Holappa

unread,
Jan 17, 2019, 7:45:30 AM1/17/19
to A gathering place for the Open Rail Data community
Thanks for your valuable inputs. I'll change to use the Staff Version.
Reply all
Reply to author
Forward
0 new messages