Challenges in adding fare information to OSM?

by multimob — written on 2023-07-07


Imagine this: every public transport stop in OSM would have a zone tag. This information could be used by various apps to compute the fare when going from A to B, even suggesting alternative—and cheaper—trips.

For a start, we might want to know how fares work in Belgium public transport and whether data is easily available.

Fare zones

NMBS/SNCB has a distance-based fare, but large conurbations are considered to be a single zone. The list of stations in each urban zone is available on their website. There is an extra charge for trips starting or ending at Brussels Airport.

De Lijn applies a flat-fare system. Most stops in OSM already have a zone:De_Lijn tag, and the zone number is printed on stop signs, but it does not seem to serve any real purpose nowadays.

STIB/MIVB applies a flat-fare system except for bus 12 when boarding at Brussels Airport, which requires a special ticket. Whereas the fare used to be higher for trips to and from the airport until recently, STIB/MIVB changed the rule and only increases the price from the airport. There is only one stop number for Brussels Airport; apps typically use the zone information for both stops in a trip; for this line they should handle an exception and only consider the fare zone of the stop for the start of the trip.

TEC applies a zone system, with basically two prices (low for 1 or 2 zones, high for 3 zones or more). Easy to obtain through GTFS, adding to OSM is trivial. Travelling on Express routes requires a special ticket; those routes are easy to identify since they start with the letter E.

The Brussels-Vilvoorde Waterbus has two fares but some stops in the middle of the line are on both fare zones. That can be artificially coded as having 3 zones: A-B-C, where a low fare applies for A-A, A-B or B-C trips and high fare for A-C trips.

Brupass fares have a special regime, adding them to OSM is to be considered. The unnamed central zone ("Brupass zone") has one fare, then the first ring around the Brussels Region ("Brupass XL zone") has a higher fare that gives access to both zones. Brussels Airport is included in the "XL" zone for De Lijn, whereas NMBS/SNCB and STIB/MIVB ignore it and apply their own fare.

Possibility to build a price calculator

Information about which stop belong to which zone is confirmed for the 5 operators listed above.

NMBS/SNCB does not communicate the formula or the distance table used to compute the fare. We found out that multiplying the distance in a straight line between each pair of station by €4 gives a fairly good estimate of the price (second class). However, there were differences on many test cases. Also, for city zones, it seems like they chose the major station of the zone as the reference for distances. For instance, all trips to and from Brussels will be calculated with the distance to reach Bruxelles Midi - Brussel Zuid station.

NMBS/SNCB has a dual pricing system. All trains are expected to include first-class and second-class cars. First-class tickets are more expensive.

International trains that function like Belgian IC trains are offered at standard—and predictable—price. For instance, trains to Amsterdam, Luxembourg or Maastricht or the night trains to Vienna. On the other hands, Eurostar high-speed trains are not predictable: prices vary every day and every hour, as part of their policy to charge higher for the most popular trains, or to get people to use trains that still have some seats left. It is virtually impossible to build an offline calculator for those trains.

Fare information for all the other operators is public.

The main problem is that fare lists are extremely sophisticated when it comes to discounted fares for special target groups. In particular, every operator has different criteria about who is entitled to lower fares. This is a consequence of Belgium being a federal state. This complicates the general algorithm for people who need to know the price if they belong to one of those categories (people with disabilities, children, senior citizens, travelling with a dog, travelling with a bicycle…).

How can OpenStreetMap be used to achieve this?

The two possible uses for OSM with regards to fare calculation are:

  1. Store information about zones as zone:* on every stop or station.
  2. Calculate the distance between railway stations along a railway line.

We believe that building an efficient fare calculator for any given trip represents a significant effort. This is typically data that must be pre-computed (at least once a day), because queries will not be on one single trip from A to B but possibly on thousands of possible combinations between the surroundings of A and the surroundings of B. Users will typically want to assess the differences in price, time and reliability for various options.

Producing a geographical visualisation of fare accessibility by public transport can be a side-benefit of this. Think about this: If you live in one area, how much will it cost you over a year to get around by public transport in that direction, and in that direction, in particular near regional borders where you must purchase different season tickets. We are happy to assist students or researchers who would like to explore this.


Permalink: https://blog.multimob.be/zztseff3qa.htm

Back to the index

Screenshots with maps are © OpenStreetMap contributors