danielthepope / trntxt

:steam_locomotive::train::train: A data-friendly UK train times site
https://trntxt.uk
MIT License
36 stars 9 forks source link

"has not provided an arrival time." #53

Closed edent closed 5 years ago

edent commented 5 years ago

Is it possible to remove the "has not provided an arrival time" trains?

Looking at https://trntxt.uk/lbg/dep - about half of the results are for trains which don't actually stop at Deptford.

These phantom trains do show up on https://ojp.nationalrail.co.uk/service/ldbboard/dep/LBG/DEP/To - but I find it pretty confusing when I'm scanning for a platform.

danielthepope commented 5 years ago

Looks like you've found an edge case! For that specific journey, it really doesn't make any sense to show those routes because the train is going the wrong direction.

I decided to show phantom trains because of this situation https://trntxt.uk/did/pad. The trains that say they go to Ealing Broadway do eventually make it into Paddington, but the API call I was making didn't show the arrival time. I've looked at the GWR app and it appears to know the arrival time now, so perhaps it's worth looking into the data I can get back with calls to the newer version of the API.

I could also work out if that train is actually overtaken and indicate that more clearly.

Or, as your PR does, I could just remove that information. It's not useful to you and I've never gone on one of those slower trains, so perhaps it's worth removing it.

edent commented 5 years ago

Looks like you've found an edge case!

I'm special!

When the trains are delayed, it is occasionally useful to see a slower train. But I suspect if there's no arrival time, it shouldn't be displayed.

danielthepope commented 5 years ago

Reopening because the PR didn't fully remove the trains. The arrival times were removed along with the message saying "it's likely that this will be overtaken", but there's still a bit to do.

Somewhere in the TypeScript code is some logic that limits the number of results to 10. This limit includes phantom trains, even if they're removed from the front end, so this will show a smaller number of trains than it should be.

Somewhere else in the logic is some code that sets a variable called correctStation. If it's false, it's a "phantom train", and shouldn't be included in the search results.