Category Archives: iRail

Always have a seat in the train

With our API’s query logs, with a ground truth by train specialists in Belgium, and with user feedback, we can show you how busy your train is. The only thing lacking to realizing this feature that the Dutch already have for years, is your support! Go to spitsgids.be and get a seat on your next journey.

NMBS/SNCB announces data sharing

Today, the Belgian railway company announces a data sharing program for third party developers. They will start sharing the planned schedules (“static data”). We are cautiously excited that this is the first step towards a real open data policy.

You can request your own 1-on-1 contract via http://www.belgianrail.be/nl/klantendienst/infodiensten-reistools/public-data.aspx. We hope to make our own version, linked to our identifiers, available through http://gtfs.irail.be soon!

[More updates later today]

What does this mean for the end-users?

Companies like Google, Nokia, Microsoft and others can now start reusing the data if they negotiate a one on one contract. Starting today, you will see route planners from third parties work with NMBS/SNCB! Android and Google Maps users will be very excited as they now will also see trains suggested to their destination instead of only buses when selecting public transit.

Why isn’t this open data yet?

Open Data means that there’s no discrimination in who can reuse that data and that there’s no restrictions in in what way it can be used and redistributed. For now, you can access the data after signing a 1 on 1 contract. We think it’s a good thing NMBS/SNCB is testing the water before the law that will oblige NMBS/SNCB to do real open data comes into action in 2016. We look forward working together and iRail is as well in the process of requesting a license. We however want to be able to republish the data once we added our data to the dataset, which now isn’t allowed by default.

Why is iRail (cautiously) happy?

We once were forced to stop building applications using the data of NMBS. The original posts from 2010 can still be found in our archives. Today, the first steps towards Open Data have been taken and we are sure they will not regret it. We will slowly migrate our servers to make use of this official dataset. We look forward to seeing you build awesome new things with this high quality data!

Contact Pieter: +32 486 74 71 22

– The iRail Team

April updates

Railtime is gone! It was an app which was perceived by many users as an app which offered a better user experience than the official NMBS/SNCB app (an app bought from a German service provider which was adapted for Belgium). The app got shut down in an effort of NMBS/SNCB to streamline its communication channels: “it would be ridiculous to have to maintain 2 apps”.

Best alternatives for RailTime: 2 iRail based apps are mentioned: BeTrains and RailerApp

Best alternatives for RailTime: 2 iRail based apps are mentioned: BeTrains and RailerApp

On this occasion, De Morgen wrote an article. In that article it is not only mentioning the efforts we have been doing, but it also advises its readers two alternatives for RailTime: one being BeTrains (an android app built on top of the iRail API) and the other being RailerApp (an iphone app built on top the iRail API). Couldn’t be more proud! In each case, it caused Railer installs to skyrocket:

Railer app installs skyrocketing after RailTime disappearing

Railer app installs skyrocketing after RailTime disappearing (installs per day)

De Morgen concluded that we need to strive for Open Data. Something we have been asking since 2010. With the press agreeing, minister Galant agreeing (cfr. her policy note 2015 in which she mentions open data) and our API which now handles an est. average of 300.000 requests per day, we hope that the NMBS/SNCB will take steps into opening up the data we value. In each case, we will be keeping a close eye on our mailbox.

With RailTime disappearing, we got a lot of questions whether the API would keep working. We answered these questions with a clear and sound “yes”. Yet, we didn’t take into account that the API endpoint providing information about specific trains used to work on top of the railtime mobile website instead of the NMBS/SNCB’s one (it used not to be able to give this kind of information). Luckily, @brechtvdv saved the day and wrote a new scraper into our code that was left unchanged since 2010. Thank you Brecht!

And fixing the Vehicle info bug wasn’t the only thing @brechtvdv did. He also started working on a The DataTank plug-in for automatically adding GTFS files. This will help start-ups and developers to get started with their own private API on top of data of De Lijn, MIVB/STIB and TEC. The code isn’t perfect yet, so we hope to receive feedback, issues and pull requests from everyone!

One day server load on http://irail.be - monitored on the new servers by SkyScrapers

One day server load on http://irail.be – monitored on the new servers by SkyScrapers

In the meantime, we have also done a server migration together with SkyScrapers (they are part of our community for 3 years now and have ever since provided managed hosting). We are now running the last version of ubuntu, which gives us PHP5.4+! This is a huge relief for a lot of our coders: PHP5.4 introduces nicer syntax which was previously unsupported. Furthermore, a lot of composer packages dropped support for PHP5.3 a while ago. With our shiny new servers in place, I have defined a couple of issues which will make contributing to the API a lot easier and painless.

Gitter

Gitter.im is now a service we use for our real-time collaborations on the entire iRail project

 

In order to be able to work together as a community more efficiently, we’re now on Gitter. It’s an instant messaging tool which integrates with Github. We hope to talk to you there! Oh, and if you really want to use IRC instead, there is a IRC bridge available at https://irc.gitter.im/

In order to fix all these issues, we’re looking for funding to pay for a team during open Summer of code 2015. Summer of code started out as iRail Summer of code back in 2011. It’s where we provide students with the training to take on open source and/or open data projects. This year we would like to have an iRail team. A team costs €6000. Anyone an idea how to raise such funds? If you’re willing to co-fund these students, please do contact me! pieter@iRail.be

 

iRail at ISWC2014

ISWC is the international conference on the Semantic Web where I’m presenting the recent development of iRail.be towards a hypermedia API. I’m hoping to gather feedback on our way of working and hope it can set an example for development of Linked Data interfaces in route planning. You can find the slides below:

You can test iRail as a linked data interface by running some command line commands:

#List all stations the Belgian railway company (NMBS) is operating on:
curl -H "accept: application/json" https://irail.be/stations/NMBS
#show all departures for a certain stop
curl -H "accept: application/json" https://irail.be/stations/NMBS/008896412

Finally Open Data, for one day

It goes without saying, the NMBS/SNCB (don’t mix them up with Infrabel or NMBS/SNCB Holding) and iRail haven’t been the best friends over the past 4 years. But we do not really worry about it: they are even fighting with Infrabel, the railway operator, over who owns the data*, and even the biggest organizations and research groups in Belgium scrape the data from their website.

Bad news! The 3d of October, the railway people are on strike. As usual with these strikes no one understands exactly why, and if we dare to ask why, the commuters are too selfish.

But, we have good news as well. Thanks to the fact of the strike, we can now publish a dataset of 1 full day. We have created a GTFS (General Transit Feed Specification) which contains all the schedules for October the third. We are accepted through all the tests and we got published at the official GTFS Data Exchange website.

And we have a call for participation! If you are a developer, a graphic designer, an artist, a producer, an author, basically anything, wouldn’t you like to participate in our 3d of October take-over iRail.be contest? Make a website, send us the code, get published on iRail.be on the 3d of October!

* For your interest, transport data is not copyrightable. Therefore, there is no such thing as a transport data owner. The railway companies should realize that they are responsible for getting people from one place to another and the other way around. This includes providing people with the correct data, something SNCB/NMBS has always refused to do.

Oooh Lambert

I remember the sixth of December 1997 as the day I got to know how to read a map. A holy man came into my house, or that’s what I believed according to the legend of Saint Nicholas, and dropped an atlas and a globe on the couch. That day, I learned the capitals of some countries you wouldn’t have heard of in a million years (probably you have now, thank you Geo Challenge) and most importantly, I learned how to interpret coordinates! I spun the globe around and where it stopped I had to look up the details in the atlas. What a joyful way to spend time without social media around, just yet.

We’re 10 years later. Google has just released Google Earth and to my great pleasure I had a much better globe and atlas in one single program. For old times’ sake I flung my globe, that was after all these years still standing next to me on my desk, and chose a random coordinate, put it in Google Earth and… guess what… it worked!

Today, 2011, I’m an open data enthusiast and so much more. I’m working on the iRail project. The project aims at creating a general webservice for public transport in Europe. At this moment it works for the Belgian railway company and we’re working on support for the Dutch railway company and Belgian bus- and subwaycompanies. It’s the latter that made me feel very insecure.

The result of 100 lines of code (maps.irail.be)

This site let’s you convert an address into coordinates. An incredible tool for location-based open data! In the end an end-user doesn’t want to query on coordinates, but on an address. Let’s turn this tool into a webservice right? We scraped the NMBS (Belgian railwaycompany) before so this will be easy! At least, that’s what I though this morning. Today, in my breaks from studying of course, I have spent my time figuring out what these X/Y-coordinates meant:

X: 65591.206
Y: 171629.285

As this site is hardly documented I started googling what they could mean. On a very Belgian-looking (this is not a compliment) website I’ve found documentation: check it out for yourself. Apparently for some reason, please someone tell me why, Belgium started to use its own “Lambert projection” which uses the Hayford1924 ellipsoid. Too complicated? Well, not yet… It seems that this Lambert 1972 projection didn’t do the trick anymore and everyone was in need for a better, Lambert 2005 projection. Which was a lot better because in 2008 they decided to change this projection into Lambert 2008, which was not that bad because if you wanted to use 2008 instead of 2005 you only had to add 499 000m to each coordinate. This is a good thing because now the Lambert 2008 projection uses the GRS80 ellipsoid. Get it? Me neither. In fact, it feels like filling out my tax bill for the first time all over again.

Of course this had some implications since software that supported this projection became confused. They didn’t know what kind of Lambert they implemented and as a result showed wrong locations (typically exactly 1km off: the 1972 – 2005 problem). In fact I’ve had a hard time today writing a function, because there were no ready-made functions out there and because apparently the math is not that easy. If anyone would stumble upon this problem, the PHP code for the Lambert 1972 projection can be found HERE. You hereby get my permission to steal this “tools” class and reuse it elsewhere (WTFPL).

Is there someone who can tell me more about why Belgium is so keen on the Lambert projection? It is used by a lot of Belgian instances and I figured there most be some benefits over the WGS84 standard, which we have all learned as a kid: longitude & latitude… Any comment welcome

– Pieter

Killing dead time

Social media is not about losing a lot of time by being social instead. It’s about being productive in the dead-time-continuum. Let me explain…

If I were to become an autobiographist, «killing dead time» certainly would rank high in a list to qualify for a good title. Not that my life is that interesting – although describing the life of the people in it would be an interesting perspective – but it is true however that my life is filled with time that politely asks to be killed.

I used to love walking. I live in Ghent and walking from one side of town to the other is something I preferred rather than riding a bike. Why? If you would have asked some weeks ago I would have answered: “because I’m too lazy to maintain a bike”. But the main reason lies elsewhere. Being on the road gives you the great opportunity to overthink things. For instance if I go to a meeting on foot I know that when I enter the room I will be better prepared. Taking thought-consuming types of transport, such as a bike or a car, will make you lose your X minutes of thinking-time.

It turns out that I’m not the only one who has dead time – dead time being the time you are not doing your maintask -. A good friend of mine told me he always uses the toilet for approximately 16 minutes. That’s exactly the time he needs to finish this mobile phone game, extending his visit but making it a lot more fun. Of course we can recite an endless list – such as queuing at the grocerystore, waiting for a bus or plane or train, sitting on a bus or plane or train… – but that’s something every person can fill out for him- or herself.

When I discussed this idea with my father, people having too much dead time, we were thinking this could actually have a positive side-effect: people may actually do productive things. As he works as a researching in computer assisted language learning at the university of Antwerp he figured this might be exactly why language learning apps are very important. When are you going to learn a language? Not when you’re at your computer working for that customer whose product should have been ready yesterday, but when you’re at the airport waiting for the plane, or even on the plane, on your way to the next customer.


Seems like we weren’t the first to come up with this idea. Although our idea will get better implementations 😉

I think this is the reason for the success of social media. If you would look up the geolocation of your friends’ tweets (twitter messages) I bet you would be able to find out the exact location of the bathroom in their building. This is also the reason why I like the iRail project a lot: apart from planning your trip, iRail will also try to make your commuting as fun and interesting as possible: providing real-time social media updates from your train, letting your friends know you’re on this train or playing augmented reality games such as http://www.chromaroma.com/.

It may be interesting to know that I just got of my bus, which I prefer taking over walking home now. During the trip I’ve catched up on twitter, I have read my email and wrote this blogpost.

-Pieter