For the GTFS-project we (@timtijssens and @brechtvdv) have to make Open Data from the Belgian railway company NMBS. In this blog post we’ll explain some technical issues we had and how we solved those.
For those who don’t know what GTFS is about, you can read our first blog post.
On which days does a certain train ride? That’s one of the main questions we had to solve. The GTFS-reference says you have to make a calendar-file where you specify which weekdays (Monday, Tuesday …) the train rides. You also have to specify the start- and enddates on which this pattern occurs.
Ok, this doesn’t sound so difficult, does it?
The part of getting the right data, that is the real snag. We were able to scrape text that describes these calendars from the NMBS website (see picture previous blog post). The only thing we had to do was writing a parser that converts this text into useful data.
After writing a lot of code in PHP, the parser started to handle most use cases pretty well, but everytime we thought we had the solution, a new use case arose. Later on, we found out that the website info isn’t consistent: exceptions prove the rule, right?
Beta coming this week!
We will open a beta-version of the GTFS-files and GTFS-RealTime feed this week, so stay tuned for our next blog post!