João's app shows where Carris buses and streetcars go

It is called GeoBus and is an iPhone application that shows the location of Carris buses and streetcars in real time. It also has an algorithm that learns the city's traffic patterns to offer possibly more accurate waiting estimates.

João de Vasconcelos is the author of GeoBus (photo by Lisboa Para Pessoas)

A bus may take longer than advertised by Carris at certain times of the day, due to traffic. But using the technology at our disposal and data from Carris, a young programmer is trying to close this gap. When João de Vasconcelos, 27, an environmental engineer and programmer, developed the GeoBus in 2020, its goal was one: to show the location of buses in real time, on a map, allowing people to know where they are and make better decisions. "I wanted to try my hand at making an iPhone app using the Swift language"tells Lisboa Para Pessoas. João was at home like the rest of us, due to the Covid-19 pandemic. GeoBus was born as a personal challenge, at a time when telecommuting was prevalent and commuting should be avoided; as time has passed, the app - which is only available for iOS - has proven its usefulness and potential.

GeoBus

"I had discovered the Carris API I don't know how, maybe on Twitter," and with that João got his hands on developing the app. It was ready in June and available for everyone with an iPhone. At the time, he promoted it among his friends and acquaintances and received half a dozen downloads. The first version of GeoBus allowed him to enter a bus route number to see, on a map of the city, its route and where each vehicle assigned to that route was in real time. You could click on the bus icon or on a particular stop to get real-time estimates from Carris."Then, during the summer, Carris closed API and I was very sad and also worried, not knowing if it was because of me." With no API, GeoBus temporarily stopped working.

To regain access to the API, João sent e-mails to the operator, to which he never got a reply. And a conversation with an official, at the end of a conference in late 2020, left him even more discouraged: "I was told to forget it, that I was never going to get access to what I wanted." What is certain is that the young programmer did not give up, and in early 2021 he managed to recover the API and with it reactivated the app. "I never felt like making money from this"he clarified, adding that GeoBus does not and never will have advertising. "I just want to help people use public transportation. Most stops don't have information boards, and when they do, that information isn't always reliable."

GeoBus (Lisbon For People photo)

João says he doesn't know how Carris calculates these estimates, but he suspects it's by the GPS position of the bus in relation to the stop - that is, if the bus is 500 meters away from a stop, Carris estimates that these 500 meters take X minutes to travel, even if there is traffic on that stretch. This is why we often see buses one minute away when, in fact, they take longer than that. By showing the location of buses on the map, GeoBus allows people to know exactly where the vehicle is and to make rough estimates, taking into account their knowledge of the area or what they are observing around them. In other words, a passenger at a bus stop can see that there is traffic on that street and therefore estimate how long it should take to get there.

The GeoBus interface is very simple: a map and a field to indicate the route number are the elements that appear when we open it. We can add routes to favorites so that we always have them at hand, and one of the most recent updates also allows us to search for stops by their number. If we choose a route, we can see the route, how many buses or streetcars are running and the different stops. Despite the simplicity of the interface, it may not be easy to understand at first; the trick is to navigate and experiment by clicking on the various elements to discover the features. If we click on a vehicle we can also find out how long it should take the vehicle to get to each of the stops it will pass through.

A proprietary algorithm

GeoBus receives real time estimates from Carris, but has recently started to count on a machine-learning algorithm that updates these estimates based on the city's traffic patterns. Using this algorithm and analyzing patterns, segment by segment, of a given route, GeoBus can indicate how long a bus usually takes to get to the stop where we are - the values do not always match the real-time estimates that are shown on public information panels, for example, and can complement the information provided by Carris.

João is an environmental engineer and passionate about programming (Lisbon For People photography)

The algorithm was not created by John but by a person he met in Lisbon For People Discord Communityand who prefers not to be identified. For this article, however, he explained the system he developed. The algorithm collects the real-time GPS location of the various buses and streetcars that Carris has in circulation per day and stores a 15-day historyWith this information, it learns the typical patterns of each route to return intelligent estimates of the schedules that are actually practiced. This algorithm can be used for analysis on which areas are most often delayed by buses or how long bus routes generally take compared to what Carris originally predicted in the construction of the timetable. For now, the algorithm is helping GeoBus users to have alternative time estimates to the Carris ones - João called these estimates "Community Data".

"The way we calculate these community estimates is completely independent of the times indicated by Carris. Basically, it just uses the GPS position of the bus."explains the author of the algorithm. "We use a very basic form of machine learning that consists of comparing the position on the same line, at the same location, on the same day of the week, and at the same time-of-day interval." The developer of the algorithm says that it is sensitive not only to the typical conditions on a route, but that since it has information from the day itself, it responds to changes that happen on that day alone, within certain limits. "I think the goal is as much as possible not to assume whatever, we don't assume schedules, we don't assume as much as possible. We try to extract everything from the position of the bus and empirically determine the estimates."

Both the people who created the algorithm and João want to contribute to a city where more people take the bus and, in particular, help improve the experience of those who take the bus. João looks at those who are waiting too long at a bus stop, often without any foresight, as "victims" of an inefficient public information system and believes that GeoBus can help improve the experience. "A bus operation is very difficult, there are many buses running and many factors external to Carris disrupting the service"recognizes the 27-year-old programmer. "Overall, we have a good service and what we lack most is to communicate, to pass the information about the service out to the people. Carris' job is not to drive buses but to transport people." John and his friend fear that the API could be restricted again, hindering those who are simply trying to provide an alternative public service, and believe in a city with open data.

You can learn more about GeoBus here and download it here.

Gostaste deste artigo? Foi-te útil de alguma forma?

Considera fazer-nos um donativo pontual.

IBAN: PT50 0010 0000 5341 9550 0011 3

MB Way: 933 140 217 (indicar “LPP”)

Ou clica aqui.

Podes escrever-nos para [email protected].

PUB

Join the LPP Community

The newsletter is the meeting place for almost 3,000 people.