Skip to content

hiddewie/OpenRailwayMap-vector

 
 

Repository files navigation

OpenRailwayMap Vector Map Styles

This repository contains the visualization of railway infrastructure, speed limits, train protection, electrification and railway gauges using vector-based tiles and a web-based user interface.

Documentation can be found on the OpenStreetMap Wiki.

Architecture

This repository aims to contain all code, configuration and tooling for the OpenRailwayMap.

Changes from the CartoCSS style

A number of changes have been made from the upstream OpenRailwayMap-CartoCSS project:

  • The raster tiles have been replaced with vector tiles.
  • MapCSS and Mapnik have been replaced with the MapLibre Style Specification and Martin.
  • Database views have been collapsed into single views to minimize data transfer.
  • Lua code is used to minimize imported data, while retaining the ability to change the database views for adding new features.
  • Visualization of additional signalling has been added.
  • Direction of railway signals has been added.
  • Fixes have been made for non-functional visualization rules.
  • The API runs from a Docker container from static PostgreSQL data optimized for searching.

Upstream changes will be merged into this project.

API

The API has been adapted from the OpenRailwayMap API. The API powers the search in the OpenRailwayMap UI, and provides facility (stations, halts, tram stops, yards, sidings, crossovers, including disused, abandoned, razed, proposed and under construction) searches by name and reference and milestone searches by combination of line number and mileage. The searches are full text, based on PostgreSQL's full text search functionalities.

The API documentation can be found at https://openrailwaymap.fly.dev/api. You can also view the raw OpenAPI specification.

Contributing

Contributions are welcome!

There are multiple ways to contribute to this project:

  • Improving the code and/or tooling.
  • Providing more details for visualization on the map, for the infrastructure, speed limit, train protection, electrification or gauge layer.
  • Providing icons for visualizing features on the map.
  • Providing user interface improvements.
  • Providing technical or user documentation.

View the contribution documentation for details.

Local development and deployment

To run the OpenRailwayMap locally, you can import OpenStreetMap data and run the tile and web server locally.

View the setup documentation for details.

License

Copyright © 2024 Hidde Wieringa

The original map style (CartoCSS) is copyright © 2017–2019 Michael Reichert

The original map style (MapCSS) is Copyright © 2012 Alexander Matheisen

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Languages

  • JavaScript 99.1%
  • Lua 0.3%
  • Python 0.1%
  • HTML 0.1%
  • CSS 0.1%
  • Shell 0.1%
  • Other 0.2%