Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Berlin public transport in real time (vbb.de)
367 points by fdellavedova on Nov 19, 2015 | hide | past | favorite | 139 comments


Looks like they are just interpolating the location between two stations using the expected arrival times. If no expected arrival times are available, they simply simulate the location to match the planned arrival times. So this is not really "live".

> VBB-Livekarte zeigt berechnete Positionen der Fahrzeuge zwischen zwei Stationen; falls kein Live-Fahrplan vorhanden, dann Position gemäß geplanten Fahrzeiten


Good catch. I live in Berlin and use this sometimes, and I hadn't actually noticed that disclaimer before. (For future reference, it's under "Position der Fahrten" on [1].)

Munich's live S-Bahn map[1] takes a slightly different approach:

Um die Position der S-Bahnen auf der Karte anzuzeigen, werden die Positionsmeldungen der Züge an ausgewählten Signalstandorten erfasst und dazwischen hochgerechnet. Es handelt sich somit derzeit um keine GPS-Ortung.

(from "So funktioniert's" on [2])

So they don't actually use GPS positioning either, but they do interpolate from data that comes from their rail signalling system, which I imagine is a bit more precise than using realtime departures and arrivals in hh:mm.

[1] http://www.vbb.de/de/article/fahrplanauskunft/vbb-livekarte/...

[2] http://s-bahn-muenchen.hafas.de/bin/540/help.exe/dn?tpl=live...

[3] http://www.s-bahn-muenchen.de/s_muenchen/view/fahrplan/echtz...


Agreed, it's not really live, but still cool. There's a similar project for Swiss trains here: http://maps.vasile.ch/transit-sbb/

Source is available on Github (not my project).


The same thing exists for Austria as well: http://zugradar.oebb.at/


That shouldn't be a problem if the trains are on time.


That was either the best joke ever, or you haven't used German S-Bahn yet. (The "S" is supposed to be short for the German word for "city" but we jokingly refer to them as "standing still-train" instead of "city-train")


'Stand-Bahn'? Never heard that, although haven't lived in Berlin since before the 'meltdown' in 2008. Traditionally the S-Bahn is Berlin's favorite transit system (you can look out the window!), the most far-reaching, and the most interesting historically.


Although it has so many problems it's still my favourite method to get from A to B. Yes, windows, Internet, well spread out network. That's nice.


Actually I don't think it is 100% known what the "S" stands for. I think "Stadtschnellbahn" is most likely. The "Stadtbahn" only refers to the east-west route.


Good to know, because many towns have that I thought it's really Stadt-Bahn. Didn't know S5/7/75 have that special name.


maybe its like SOS and stands for nothing, at least at the beginning. It was used because it was easy to morse and not used ;)


You should travel more. You would never complain again. Berlin public transport is amazingly consistent compared to anywhere else I have lived (bar Singapore).


At least when I was in Berlin this September the U-Bahn worked perfectly.


even if they're running late it should be fairly accurate; there are no express trains here in Berlin so it's never very long since a train has been in a station for a positional fix.


Thats funny because I feel like I waited less time for trains to arrive in Berlin than I do in NYC (including express trains...)


Trains run every five minutes during normal business hours. It's great. Ten minutes at night, weekends, etc.


Real time public transport in Vilnius: http://stops.lt/vilnius/#vilnius/map/en

Select this icon: http://stops.lt/vilnius/_images/vehicles.gif, on the right, to show vehicles as bubbles.

It is real time from GPS transmitters inside the vehicles.




Busses update their location only every 1 minute and website just sends a get request every 5 seconds.

Not what I would call realtime.


What would be real time for you? Every second? Millisecond? Or should we make hard constraints on the maximum latency (< 5 ms). Does the original site show the unavailability of data (within the original update frequency?).

Furthermore, if it takes 3 minutes to communicate a delayed train, and your screen is still trying to create a make-believe of updating your screen every 50 milliseconds, is it real-time?

I would even say that the 1 minute update is more real-time than the make-believe 50 millisecond updates.


There is a similar tool for the whole world created by a german student a few years ago - http://tracker.geops.de - albeit without RT data for berlin because apparently they dont have access to it. But they do have RT data for the netherlands.


Creator here - since 2014, development is being done at geOps where I am currently working at. geOps is also providing the entire infrastructure. We are constantly looking for more static or real time feeds.

We are using the same method as the VBB - interpolated timetable data augmented with station-based delay-information where available.


Wow that is very cool, not super accurate where i live but cool.

BTW the map cant handle unicode stuff properly there is a boat line called "Sjövägen" where is live and on the map it is named "Sj?"


It would really help if people would stop calling this 'real-time', just because it creates the illusion.

Real-time means: physical train slows down, communicates with all interested parties within a limited amount of time (for example: 20 milliseconds). Because of CAP, interested parties either show real-time update within 20 milliseconds, or display 'missing data', or sth. Generally, the latter situation is a failure condition (fails the RT condition).


This appears to use the theoretical schedule, rather than real-time information. I live next to a busy tram line, and what I see through the window does not match what the site shows.


Not true:

"VBB-Livekarte zeigt berechnete Positionen der Fahrzeuge zwischen zwei Stationen; falls kein Live-Fahrplan vorhanden, dann Position gemäß geplanten Fahrzeiten"

Translation:

It shows the calculated position of the vehicles between two stations. If there currently is no live data it shows according to schedule.

http://www.vbb.de/de/article/fahrplanauskunft/vbb-livekarte/...


Totally, buses never seem to stop at traffic lights.


In my city, Eindhoven in the Netherlands, traffic lights are often calibrated to make sure that buses don't have to stop at a red light.


It goes beyond that in the Netherlands. A lot of bus lanes have their own traffic light system -- they have very small lights to show when they can go or stop. :)


This also exists in Germany

https://de.wikipedia.org/wiki/%C3%96PNV-Bevorrechtigung

(Sorry, no english version available)


These exist in Britain, but are only used for trams.

http://www.ukmotorists.com/tram_signs.asp

For buses, there would be a normal traffic light controlling only a bus lane, usually labelled with the blue buses only sign. It's not very common, but I know a couple of cases in London.


God, how I wish I lived in the Netherlands...


We need engineers in the Netherlands, so you could move if you really wanted to.


Any need for Computer Scientists either? The U.S. is a crazy place to live for someone not from here. : (


Definitely. Many specialist companies are having a hard time hiring. Also, we have some really nice visas for foreign knowledge workers.

Depending on your specialization/experience I could give you some tips if you'd like.


I can confirm that. As a US software developer, I have pondered going to live and work in the Netherlands, and I've done some research. Their visa for knowledge migrants (kennismigrant visa) seems to be very easy to apply for and would pretty much apply to anyone who reads this site. You do have to find an employer willing to sponsor you though.

The Netherlands is vastly more friendlier to skilled migrants than the UK, which seems particularly xenophobic at the moment, and I think it provides a much friendlier experience than Germany. They have expat centers (http://www.hollandexpatcenter.com/ and http://www.iamsterdam.com/en/expatcenter) that were establish to help immigrants get established and figure out the rules, cultures, and customs of the Netherlands. I've been impressed.

They also incentivise skilled migration by providing a 30% tax scheme for anyone moving there from outside the Netherlands, where 30% of gross income is tax free for a longer period (I think it's 8 years).

I've even spent a couple months learning Dutch (gemakkelijk, maar de uitspraak is moeilijk), although that probably isn't necessary. I hear that English is almost universally spoken in the Netherlands.

I'd certainly be interested in hearing any tips you have. I have over 10 years of web development experience. No mobile app development experience yet, although I'd like to get into that.


I've spent some there and can confirm a few things:

- English is spoken by a lot of the Dutch (esp. in bigger cities it's almost everyone)

- The Dutch are friendly people and are generally happy to help a stranger

- 30% tax ruling is a boon in a place where the cost of living is high. Please do your calculations carefully before you consider moving to The Netherlands and ensure you have some clarity from your potential employer about the 30% tax ruling. Also remember that if you lose the 30% tax ruling, you (almost always) lose it for good.

- unlike the usa where the visa process treats you like a potential (or a convicted) criminal, the Dutch treat their guests well. I only have good things to say about the process of moving to The Netherlands.

- no amount of reading or watching videos will help you understand how the Dutch are, unless you live among them. They are straightforward, down to earth and a relaxed people.

If you have made up your mind to move to The Netherlands (please do your calculations on earnings vs cost of living before that!), let me know how I can contact you and I'll refer you to the employer who got me to move to Holland (if this prospect interests you).

EDIT: formatting


I have researched the issue lightly, and am told that EU rules are particularly ...bothersome. Is it true that an EU company has to advertise for/and keep open a position for 3 months and show that none of the applicants met the requirements as compared to the non-EU applicant to be able to hire them?


I've worked for a lot of IT companies that hired people straight from outside of the EU. Even for junior roles. It's not that strict.


You're probably complaining about the reliability of this map but it is actually often the case. In my district the buses frequently run the red lights.


Well, they don't actually follow streets. Looks like it's just the shortest distance between two stops, even if that goes right through a building or over water.

Works surprisingly well though, I only realized after a while.


Public transport is often prioritized and they got green light using some kind of detectors or remote control.



There is also the Trafi app which has live data (and route planning) across all the Baltic countries and a few others.

http://www.trafi.com/


Helsinki has one for their trams, subway and ferries: http://live.mattersoft.fi/hsl/Default.aspx?lang=en

I really wish there was this service for buses. Quite often the digital displays saying when the bus will arrive are inaccurate, as are the actual timetables printed on the bus stop (when there is traffic etc.)


And this one for the trains in Finland: http://188.117.35.14/vrviewer/VrViewer.html?locale=fi_FI

Click 'x' on the popup and zoom in to Helsinki to see the city trains. The site says the data is GPS location data.


Depending on the city, some actually do have live(ish) bus location information available through public APIs.

Los Angeles County was one such I think. I used theirs for some information visualization art projects a couple years ago.


Here's one for Brno (Czech Republic) and surrounding areas (South Moravia region): http://iris.bmhd.cz/

You can enable/disable different types of vehicles: trams, trolleybuses, city buses, regional buses, regional trains, ships (in that order).

No ships today, as the season ended last month).


I'm glad they use OpenStreetMap instead of Google Maps. Well done.


Agree, though I think this particular map style isn't meant for end-user applications. It shows absolutely everything, and is quite cluttered for this reason. They would be better off choosing one of the more minimal styles.


In Russia same thing works in real-time (interpolating anything based on schedule will not be the best idea for busses / trams I believe) Mobile app from Yandex (works in Moscow & Saint-Petersburg): https://itunes.apple.com/ru/app/andeks.transport/id826358136... Web version in Saint-Petersburg: http://transport.orgp.spb.ru/Portal/transport/main;jsessioni...


Open-source platform that provide real-time info for Atlanta, Puget Sound, Tampa, York, or New York City. http://onebusaway.org/


Last day in Atlanta, I wish I had known that page a month ago.


A keynote worth watching regarding transport visualisation: http://www.architecture.io/talks/till-nagel-unfolding-the-ci...


Was glad to see them using OpenStreetMap.


A live map that loads in 2 seconds on my machine is Internet done right. Well done.


Neat. In Pittsburgh, I think all the buses now have GPS and report their location. There's an app that displays the locations of buses on the routes you select.

Alas, I've seen several cases in which the bus's labeling is in error, with the driver calling out the correct route to people at bus stops. Sadly that doesn't affect the reported route or correct what the app displays.


Am I missing something, or these updates are just estimates? I could see any periodical http requests, long running call or web sockets open.


Here is one for SF: https://www.sflivebus.com/


The same thing exists for regional and inter city trains in germany that the Deutsche Bahn is responsible for: http://www.apps-bahn.de/bin/livemap/query-livemap.exe/dn?L=v...


Also public transport in Saint Petersburg http://transport.orgp.spb.ru/Portal/transport/main;jsessioni...


Cool idea for the hackers out there:

Use public transport data from all the sources below, overlap them on Google aerial view, change the dots to 'top view' images of buses, and let the users follow buses in 'real time' across 'real life' map. It'll be like a real-time satellite imagery!

Also: keep the directions in mind. This one (posted downthread) shows where the buses are pointed too. http://traintimes.org.uk/map/london-buses/#41

Link me if someone decides/has done this. I might be able to contribute


Vilnius, Lithuania: http://stops.lt/vilnius/#vilnius/map/en (click "Show vehicles").


I wrote a client-side library for this: http://onloop.net/transit http://onloop.net/chennairailmap

All the transport maps at that time I knew about, like Swisstrains (http://maps.vasile.ch/transit-sbb/), worked off webservers, so that was the motivation behind writing a purely client-side app.


Amtrak (USA) has a static visualization of its active trains.

Unfortunately you can't click to it, so here's a screenshot: http://imgur.com/TJwTBAY

To get to it, go to http://www.amtrak.com/find-train-bus-stations-train-routes

then click on the "Check Train Status" image near the top right of the page.

The difference in train presence between USA and elsewhere is staggering (and embarrassing).


To be fair, you're comparing the Berlin metro system with a national rail system. http://www.livetrain.nyc is an example of live tracking on the NYC subway (though not on all lines).


I've been wondering whether you can use accelerometer data, which does not require user permission (on websites and mobile apps), to precisely determine geolocation for some users, which does require permission. This page makes Berlin commuters seem like a plausible target. A few more details here: http://andrewbadr.tumblr.com/post/132618372956/projects-im-n...


Obligatory "my city has one too!"-post for Helsinki: http://live.mattersoft.fi/hsl/


And Toronto's bus and streetcar network...not quite as fancy, but Toronto's Open Data system makes this possible.

Live tracking: http://totransit.ca

Open Data: http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=9e56...


The URL:

> http://fahrinfo.vbb.de/bin/help.exe

Who would run this on a webserver?


RewriteRule /bin/help.exe /node/whatever.js [L,QSA] # where's your CGI now?

I have seen such rewrites in place to keep old CGI URLs from breaking, as their consumers were scattered all over time and space, and it was easier to internally remap the old URLs (which have over the years essentially become a public API) than have them stop working.


Yea, had a colleague many years ago who worked on a very large web site where all the php files ended in .asp


CGI lives.

> Who would run this on a webserver?

Who wouldn't? It's an executable. Just like your favourite language runtime. Just like 90% of the web.


It's quite easy to make this particular *.exe path return an "Internal Error" by fuzzing the GET parameters, which may or may not be due to someone having written something that parses user-supplied data in C that then segfaults :)


Well, what else would you return? A `400 Bad Request` error might be more appropriate, but a `500 Internal Server Error` is "A generic error message, given when an unexpected condition was encountered and no more specific message is suitable." - you don't want to leak internal state, obviously, so just log the problem and respond with a 500.

TL;DR: Might be a segfault, but it's 2015 - it probably isn't.


5xx to me suggests that retrying is worthwhile. Any "deterministic" error (as a function of the parameters I submitted) should be a 4xx.


Definitely.


Assuming that they're even using C. It may as well be a dumped executable Lisp image.


The company behind that software, HAFAS (which is used almost everywhere in the German-speaking countries) constantly advertises for C++ and Java positions. As far as I'm aware the main part of the software, including the web facing portions, is written in C++.

The software has a long history, the first webserver with it was started in 1995 and even that most likely reused logic from their first version of 1989. So the language choice is not too surprising.


Small correction: the company is HaCon (http://www.hacon.de/), HaFas is their software.


A paths meaning is what they mean to the webserver, not to you.

(That said, I'd be concerned if this is actually CGI..)


Ebay has .dll in its urls, or at least it used to.

It's just code.


It's HaCon software, "exe" extensions are kept for historical reasons. These are not Windows binary for a long time already.


I created a real time map for Boston: http://bostontraintrack.com .

It uses live data but it doesn't interpolate position. It updates about every 15-20s or so. Source is available (and FOSS) [1].

[1] https://github.com/abetusk/bostontraintrack



http://www.map.gortransperm.ru/ - Perm, Russia. You need to select a route and click "show vehicles" button to see it. ( annotated screenshot http://i.imgur.com/g0OGJsG.png )


I was watching 2 S-Bahn approaching each other towards the centre of where the map loads. Creeping ever closer, then BAM! only one visible and stationary for the past minute. Should I call the emergency services? ;)

Looks awesome by the way, I wish this were more common. In the UK, many similar projects were shut down over IP issues.


São Paulo: http://tracker.geops.ch/?z=13&s=1&x=-5192138.9629&y=-2699539...

Small blue points are buses, larger circles are on rails (subway and trains).


Real time London Transport Visualization. Available on GitHub too.

vizicities.com

ViziCities is the first project to visualise the entire London Underground network in 3D using accurate station depths. Not only that, we also visualise real, live trains moving along the 3D network.


See also "Zugradar" of the Deutsche Bahn:

http://www.bahn.de/zugradar

Also made by HaCon (http://www.hacon.de).


Curiously, when you zoom out, you can scroll as far east as the Polish/Byelorussian border, but in west/south direction you can barely see all of former East Germany.


Now I'm even more glad I moved to Berlin from NYC..!


It's awesome. The good side of data collecting :).



The NS Reisplanner Android app has recently gotten an official map (called Treinradar).


does anyone know the Tokyo one? pretty impressive how many trains are going through some stations there...


Not bad, but I just two trains collide into a building. A bit frightening at first.


Given the interest here, I feel like we should talk about transit more often on HN


Try check all checkboxes and zoom out 2 steps. It's a huge number of buses.


this could be used to make the most incredible 'scotland yard' mmowiw


Bay Area transit is horrible at providing GPS positional data in APIs.


We so need this in the UK


London did, 5 years ago, for the London Underground: http://traintimes.org.uk/map/tube/

More recently, one London bus at a time: http://traintimes.org.uk/map/london-buses/#73

There's a decent amount of open rail data, and a website listing usages: http://www.openraildata.info/


This is cooler than the Berlin one tbh


why can't NYCT/MTA have something like this?


Becaus software is eating the world and US governmental organizations are really, really bad at not overpaying 40x for software.

http://www.theatlantic.com/technology/archive/2015/11/why-do...


That was my first question too. If they ever published live train positions I'd build something like this immediately.


This is awesome


Isn't this a security concern?


What? In my country every single station has a timetable saying which metro/train/bus stops there at exactly which minute. Are you suggesting we should randomize public transport schedules?


Randomise the destinations as well. Will play havoc with the terrorists.


Dark City comes to mind...

  John Murdoch: Excuse me. How do I get to the end of the line?
  Train Passenger: You want the Express.
  John Murdoch: [after train blows by him] Hey, how come that 
  train didn't stop?
  Station Master: That's the Express.


That sounds like the switchman by Juan Jose Arreola.

Full text: http://www.jstor.org/stable/25293822


Metro roulette! =D


In what way? You know, there are printed time tables hanging in all stations. They are even online, accessible from the middle east!


Timetables can change, 'live' data does not. But, if it's 'calculated' then you're right, and it's pretty much a visual timetable.

Also, I know you were joking, but let's not generalise and say middle east shall we? :)


Maybe I inferred too much from gp's comment and replied very tongue-in-cheek. Obviously I could have also said "accessible from Saxony (for the neo-nazis there), Cologne (for remnants of the red army faction) or Uganda (in case Josef Kony ever decides to turn up in Berlin)". Hope I now covered all major political and religious extremes.

Back to the topic: Munich had something for the S-Bahn, the commuter train system, in their app for several years already. I really doubt that it's a security risk and find it sad that this is the first reaction something as nice as this gets.


Haha, are you sure you covered all extremism there?

I didn't mean it to come off so paranoid actually, I was just interested in starting a discussion about it, hence the "Isn't this" vs "THIS IS DEFINITELY"! I agree it's awesome tech, especially as it loads instantly on coffee shop internet, but all the comments here already reflect that.


I thought the same. But I can't actually come up with a good reason. Maybe German trains are so punctual that you can infer their position anyway. Can someone in Berlin measure the lag? Next time I'm back there I might test it.


I can only speak for Berlin and will say punctuality is not the strong point of S or U-bahn here.


It's pretty good for underground U-Bahns and Stadtbahn. Ringbahn, Nord-Süd Bahn and overground U-Bahns are less reliable.


> Maybe German trains are so punctual that you can infer their position anyway.

That's what the map is doing, anyway (plus delays).


Would that make https://www.flightradar24.com/ a much bigger concern?


The typical security concerns with rail networks don't really apply to aviation: it's much, much harder to stop a plane in flight (esp. at cruising altitude) than it is to stop a train.


According to the website, the location information isn't exact, but "calculated" (whatever that means).


It most likely means that there is no exact GPS data, but the company knows when trains arrive at a certain station and can calculate when the trains arrive at the next station (thus, they show us if a train or bus is late in minute-resolution). So it's easy to tell when a train is just departing, or when a train should be approximately 100 meters from the last station away, etc.


Ah. So no use in real-time if there is an unplanned delay as the map will show that the train just went past you when in fact it didn't. Shame.


Not really.

As far as I understand the technologies (and I assume that Berlin does the same thing as every other city-user), a precise ("physical") GPS position is usually not reported (although newer systems do that as well), but a position at a "logical" map is. In case of buses, this usually means "left the previous stop at $xx:$yy, with $zz seconds of delay; reported average speed is normal for this area, so expected arrival is at $aa:$bb." In case of trains, the usual reported data is "has left section of track $AA, is now at $BB, delay $x seconds, expected at $CC in $yy:$zz".

Not millisecond-perfect, but fairly precise to about a minute or two; the biggest guesstimate is the exact position (you'll see that all the trains seem to be using a single track, where in reality they would be on different ones).

So, while delays are reported near-realtime (and thus the scenario you describe doesn't happen), the map might be inaccurate if the route needs to be changed (e.g. there's an accident blocking the road and a bus needs to take the next street instead). Again, with the rollout of GPS-equipment across fleets, this becomes less of an issue. Btw, most delays are unplanned ;)


My understanding is that with newer CBTC signalling systems--not sure if Berlin is using that--the trains know pretty much exactly where they are on the track, along with the positions of all other trains, speeds, braking distance, etc. This allows the trains to run closer together than they could using fixed block signalling technology. It's not required for full automation, but it makes full automation relatively simple.

The L train in New York is an example of where this is installed. My understanding is this means the two staff on the train are redundant; the driver pretty much just provides acknowledgement to the train to keep doing its thing, and the conductor only opens and closes doors and makes announcements (if that). They would run with only a single staff member except for union rules.


Oh, sure, there's all sorts of useful telemetry coming from the trains and the tracks, even with fixed-block signalling (unless you have a 100-year-old signalling infrastructure ;)). That's pretty much the case of most modern train systems: the driver is there essentially to (re)boot the train computers, push the "doors close" button, and for emergencies. Apart from that, the trains pretty much drive themselves (except when they don't, oh the joys of software).

However, even when the position of the train is known precisely (no need for fancy CTBC, just start counting wheel revolutions from a known starting point and reset any measuring error at the next known-good point, usually a station - which is the basic way the Parisians do it with their driverless metro lines), not every transport agency exposes this sort of raw data to the general public; usually it's watered down to "it's between Station A and Station B, with X seconds of delay."


As far as I'm aware, all the Berlin S-Bahn and U-Bahn lines use absolute block signalling.

FWIW, automation is actually mostly tangential to absolute v. moving block signalling. As far as I'm aware, most automated systems still use absolute block signalling.


It seems that often the signalling system and the real time location reporting system aren't integrated. In NYC on many lines you get reports like 'there's a Brooklyn-bound train 2 stops away' that they make over the loud-speakers. Makes me wonder whether they have a separate device that just picks up when trains pass by a track segment, rather than using the information available via the signalling.


In New York the signalling system on most lines is ancient. The L train has a CBTC signalling system and it has real time arrival information. The 1/2/3/ and 4/5/6 have had upgrades, though not to CBTC, to provide similar countdown clock functionality. The 7 train is undergoing work to install CBTC.

On other lines, my understanding is that the signalling system doesn't know which train occupies a block, just that a train occupies the block. Which block is occupied isn't sent to a central control center either.

So "there's a Brooklyn-bound train 2 stops away" is the best it can do, since it can know based on which side of the tracks the train is on where the train is going. It can't know the letter or number.


Well, that's one of the most archaic systems out there: http://gothamist.com/2015/07/28/subway_steampunk_video.php (Not the oldest, but using the oldest technology). If I understand it correctly, the only information available from the signalling system there is the rudimentary "there's something on this track segment now; it's up to the human controller to figure out what it is, where it came from and where it's headed."


Yeah, that is a shame. Live data would be so much more useful!


If you're standing on the street, I'm sure you can see where the bus/trams etc are.


This is crazy interesting


beautiful




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: