Revealing past railway networks from OSM data

Many "way" elements in OSM are tagged "railway." OpenRailwayMap builds upon them, adding numerous details. However, the lack of "relation", between "ways" no longer used as railways, hinders the analysis of abandoned lines. Knowledge from the realm of Volunteer Geographic Information can bring the missing link, while leveraging the accuracy of OSM data. This article aims to add nodes of thousands forgotten stations, and to fill hundreds gaps between scattered OSM elements, which are unaware of their former railway line affiliation. The experiment covers almost entire old railway networks of France and Belgium.


The present work deals with collecting and representing data over two centuries of railway in Western Europe. So far: France, Belgium and parts of Germany and Luxembourg (project WERMA). The goal is to gather all stations and stops along any railway that has been built, including rural tramways, industrial, mining and military lines. Wikipedia and OpenStreetMap are two reliable and perennial sources. A lot of “volunteer geographic information” (VGI) is also available, but unfortunately also disappearing from the Internet. Helping to save a part of this endangered “patrimonial” information by transferring it onto Wikidata, Wikipedia or OSM, is of great importance. This paper examines some solutions with respect to how OSM can inform about past railway lines and stops, and how WERMA data can be used to improve OSM data with the external knowledge of VGI.

Using OSM information about railways and train stations.
The OpenRailwayMap(ORM) contribution provides a comprehensive mapping of the railway features of OSM. Since the launch of WERMA project (2022), we use ORM as a second background map, just on top of OSM, and in many places it has been invaluable visual help to fulfill our basic goal: to localize and geo-code stations that are not recorded in official sources (Railway companies), nor Wikipedia.For instance, today, about 3000 stations are active in France, 3500 are recorded as OSM-node tagged [railway=stop], and up to 5800 mentioned on Wikipedia “Liste de gares en France”, including many disused ones. When counting simple stops on secondary lines, urban or rural tramways, the total amounts to 17000, spreading across more than 12000 “communes” in France. Landmark places such as tunnels and bridges have been collected too. Building upon this geo-coding work, the new project purpose is to confront the locations of the WERMA features (files by country)with the OSM elements, and a few hundred misalignments have been visually detected and corrected in our datasets : the discrepancy is rarely above 200 meters, but a few dozens “true” errors have been detected during that process. Also, a few way-elements, tagged as ‘railway’, are not corresponding to any line in WERMA and should be added(e.g. “industrial lines” to mines, quarries).

Improving precision and completeness.
An automated process is being developed for checking the whole dataset on France and Belgium, the two countries where our work is 95% completed (as far as the 100% is checkable). The process relies primarily on geographic closeness of OSM nodes tagged railway=stop | station, with features of the WERMA geojson file of stations. OSM data will improve the WERMA dataset in precision (position) and in number (detailed platforms in Central stations, or new lines). The process cannot be purely geometric, because mismatches augment with the local density of OSM-elements and WERMA-stops. Also, not all OSM-ways have names, or names related to railways. See Figure 1, near Angoulême, France, which displays OSM, ORM and WERMA data altogether.
In order to avoid frequent direct queries to OSM, we have archived an excerpt way(bbox)["railway"] to work locally, during the experiment for this paper. Results could be updated through time.

Connecting dots with lines, connecting lines into a network.
We have noticed that hundreds of stops are belonging to lines that have no counterpart on OSM data. In some cases, way-elements could fit, intertwined with gaps, still missing in order to restore continuity along disused, abandoned or totally erased old railway lines.
WERMA data are structured such that any stop is related to one or several lines, and all lines are forming a graph. That graph enables to compute “paths” between destinations in the global railway network (excepting a few isolated lines in mountains or islands).
Description of Figure 1: station Angoulême-Grelet (just west of Angoulême, France).
This is the screen copy of WERMA display, after a “click” on the map, providing information that lists all the properties of all features collected by this event:

  • Longitude, Latitude: 0.13108,45.64072
  • [WERMA] Angoulême-Grelet station on line 16EC1 at kilometer:5 and line 579306 at km:64
  • [WERMA] Line 16EC1 = _Chemins de Fer Economiques des Charentes #1, alias : « Le_petit_Mairat » from Angoulême to Barbezieux (48 km), closed:1939.
  • [WERMA] Line 579306 = Shunt Angoulème-Etat to Line 579000, km:63.7 to km:69, closed: 1950
  • [OSM] way #996695821: abandoned
  • [OSM] way#996695821: razed
  • Location on territory of Angoulême, code INSEE:16015 : from public data IGN 
    The popup box (Fig. 1) prints only a part of the availableVGI detailed above. The two OSM-way elements have no ‘name’ and their association to either 16EC1 or 579306, not possible directly, needs another query to disambiguate them. It can be coded if another stop exists on one of these lines.
    Do it yourself: https://bigbugdata.com/werma/v3.5/?france&center=0.13108,45.64072&zoom=17
    (be patient: loading may take60 seconds)

Improving both OSM and WERMA data through data reconciliation.
The external knowledge is a compilation of VGI sources, which allows to build a railway graph by linking line pieces as railway lines, and to attach stops in correctorder along these lines. Just as it is the case for railway lines recorded as relations in OSM. These relations exist for exploited, or recently disused rail lines. The ambition is to extend these relations to older lines.
The illustration (Fig. 2) shows an example, around the city of Chateaubriand (West of France), of what can be done by using VGI knowledge and adding new relational knowledge to pairs or lists of way elements.
Description of Figure 2: Combining OSM and VGI data for reciprocal improvement
Background data are OSM elements displayed by the OpenRailwayMap (lines, names of stations and ways). Additional data — the red dots —are VGI geocoded stations from WERMA dataset, and red dotted vertices connecting red dots of a same line in correct order, which approximates that rail line, also allowing to compute paths, for instance.
Rectangular numbers and associated arrows are added to point out a few situations:

  • Rectangle 1: shows gaps in OSM data on the railway heading South-West from Chateaubriand
  • Rectangle 2: shows that some way names identify them as railway lines (466000 going North, and 519000 going South), or relate to “departmental roads” (D163 and D40, both going South-East)
  • Rectangle 3: indicates a railway line known by VGI, unknown in OSM
  • Rectangle 4: the geocoding of some VGI dots can be improved.
    While most VGI red dots are close to OSM ways, at the scale of Fig. 2, positioning can be improved by “snapping” their coordinates to the closest coordinates of the geometry of the way to which they will be associated. A win-win combination that improves both data sources.

In order to provide a more global approach to this work, the combination and preservation of VGI is being done via Wikidata, where all identifiers can be associated: namely OSM, Wikipedia and other VGI sources either brought to Wikidata, or extracted directly from other VGI sources (history club, ...).

Robert Jeansoulin

PhD computer science (Univ Toulouse), Doctor Ingeneer (ENSEEIHT INP-Toulouse), Professor (Univ. Orsay, Paris Saclay, Univ. Laval Quebec), Directeur de Recherche CNRS, Emeritus.

Philippe Gambette

Philippe Gambette is a professor of Computer Science at Université Gustave Eiffel, in the Gaspard-Monge Computer Science Laboratory (LIGM). His research in digital humanities focuses on developing methods and tools —sometimes inspired by bioinformatics— for computer-assisted text analysis. In particular, he has worked on tools for visualization and digital mapping of texts, as well as automatic modernization of 17th-century texts in French.