Improved search function and new API

Michael Reichert
Wed, 25 Oct 2023 21:40:00 +0200

OpenRailwayMap has got an improved search function based on a new API.

The search function of OpenRailwayMap uses from now on a new implementation.

When searching for stations, previously only the name=* tag of OpenStreetMap was taken into account. From now on, all variants of the name=* tag, i.e. shortened, official and foreign-language names are used.

In the past, the string entered in the search field had to match the beginning of the name of the object. Instead, the new search uses a full-text index. Skipping the prefix of a station name (suburban stations without the name of the city, e.g. Nomentana instead of Roma Nomentana) will not prevent the station from appearing in the search results.

Sort order of results is now based on the estimated relevance of the train station which is calculated from the number of public transport route relations using the station. It is based on the assumption that more important stations are served by more public transport route relations in OpenStreetMap.

The search for milestones on railway lines was reimplemented as well. Both search functions use pre-processed database tables and additional indexes in order to be more efficient and provide faster search responses.

The documentation and the source code of the API the search function is based on can be found on GitHub.