Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra trains do not have a timetable #481

Open
koeleboe opened this issue May 8, 2023 · 9 comments
Open

Extra trains do not have a timetable #481

koeleboe opened this issue May 8, 2023 · 9 comments
Labels
Confirmed This behaviour has been reproduced Enhancement

Comments

@koeleboe
Copy link

koeleboe commented May 8, 2023

An extra train (a replacement train for a service which is partially cancelled) doesn't show up in the vehicle call. For example:

{"version":"1.2","timestamp":"1683558630","station":"Ghent-Sint-Pieters","stationinfo":{"locationX":"3.710675","locationY":"51.035896","id":"BE.NMBS.008892007","name":"Ghent-Sint-Pieters","@id":"http:\/\/irail.be\/stations\/NMBS\/008892007","standardname":"Gent-Sint-Pieters"},"departures":{"number":"35","departure":[{"id":"0","delay":"1500","station":"Ronse / Renaix","stationinfo":{"locationX":"3.602552","locationY":"50.742506","id":"BE.NMBS.008892908","name":"Ronse \/ Renaix","@id":"http:\/\/irail.be\/stations\/NMBS\/008892908","standardname":"Ronse"},"time":"1683557820","vehicle":"BE.NMBS.L17204","vehicleinfo":{"name":"BE.NMBS.L17204","shortname":"L17204","number":"17204","type":"L","locationX":"0","locationY":"0","@id":"http:\/\/irail.be\/vehicle\/L17204"},"platform":"3","platforminfo":{"name":"3","normal":"1"},"canceled":"0","left":"0","isExtra":"0","departureConnection":"http:\/\/irail.be\/connections\/8892007\/20230508\/L17204"}

Here is the result of the departureboard of Ghent. We see a train with destination to Ronse, with number 17204 (which is an extra train). However, calling this extra train results in an error:

https://api.irail.be/vehicle/?id=12704&date=080523&format=json&lang=nl; {"error":404,"message":"Vehicle not found in GTFS data"}

This data is available in the original planner of the NMBS.

@jncn
Copy link
Contributor

jncn commented May 8, 2023

I got some people complaining about missing trains, but could never reproduce (a few days after complaint). This makes a lot of sense!

@jncn
Copy link
Contributor

jncn commented May 8, 2023

Same error btw for international trains: Eurostar, Thalys, TGV,... Here's me hoping that fixing this issue would fix that one too 😇

@Bertware Bertware added Confirmed This behaviour has been reproduced Enhancement labels May 10, 2023
@Bertware
Copy link
Member

Hmmm, the vehicle is only present in the GTFS feed starting today, and only has one departure (on the 8th of may). This means that the GTFS file cannot be used to determine the journey id needed to make the api call and get the vehicle journey on the day itself.

The associated trip in todays file:
269,000178,88____:046::8892007:8892908:8:1746:20230508,Renaix,17204,,10004,,1

A solution would be to see if this train shows up in the realtime data, in which case we could get the data from there IF it has the same id in the realtime data as it later gets in the static data, since that id has the correct formatting and data to make the vehicle journey API call. Right now I cannot see any added trips in the GTFS Realtime feed though.

@Muspah
Copy link

Muspah commented May 11, 2023

GTFS-RT doesn't contain added trips. Or at least I haven't seen them in 1.5 years of logging.

https://logs.ovdata.nl/csv/Vlaanderen/NMBS/

@koeleboe
Copy link
Author

Hmm that's weird, but I was thinking it would be possible because the data was in real time available in the official NMBS app (and it was possible to open the vehicle). I thought both use the same data?

@jncn
Copy link
Contributor

jncn commented May 11, 2023

A solution would be to see if this train shows up in the realtime data

I guess that makes a lot of sense. The situation is leading to confusion now. People see trains are running (panels in the station, or NMBS app), but they don't see it in iRail (Railer in my case). This makes the service/app perceived to be unreliable.

@Muspah
Copy link

Muspah commented May 11, 2023

GTFS is generated by the HAFAS-instance running for SNCB indeed, but don't expect the GTFS(-RT) to be fairly useful at all. It's not compliant, lacking useful information (added trains, platform changes, ...), et cetera.

@Bertware
Copy link
Member

These trains show up in the timetable view and route-planner, but not in the vehicle endpoint, right? Or are other endpoints affected as well?

Hmm that's weird, but I was thinking it would be possible because the data was in real time available in the official NMBS app (and it was possible to open the vehicle). I thought both use the same data?

The (new) NMBS app doesn't fetch route details for a specific train by its number (ICxxx) but using an internal journey identifier or by making a search between two stations and filtering on train number. This became a challenge for iRail, where you can search trains by only their number, since we now need to "translate" these numbers into the correct identifiers, something we do using the schedule data (GTFS). However, since these extra trains were never scheduled, they are not included in the GTFS data, and we cannot obtain their journey identifier. Therefore we cannot fetch the route for that extra train. The NMBS does have a realtime feed as well, were these extra trains should be included, but unfortunately the NMBS does not communicate the existence of these trains at all outside of their own (closed) platforms.

@jncn This is also the reason vehicle details for Thalys etc are unavailable in most cases, since these trains are operated by another operator and are therefore not included in the NMBS' static GTFS data.

@jncn
Copy link
Contributor

jncn commented May 13, 2023

These trains show up in the timetable view and route-planner, but not in the vehicle endpoint, right?

True, for the trains operated by other operators. Not sure about the extra trains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed This behaviour has been reproduced Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants