A dynamic, WebGL-powered historical chronology of Lancashire's railway network.
RailGraph is an interactive visualisation that maps the existence of railway infrastructure. Built to render complex graphs of active, disused, and dismantled lines, this project allows users to scrub through time and watch the network construct, operate, and deconstruct itself dynamically over a 200-year timeline.
While the history of the railways in Britain is somewhat well-documented (though definitely sometimes patchy) in text and static archives, a comprehensive, fluid, and temporal geographical resource was missing.
The goal of this map is to provide an intuitive "time-machine" interface, allowing you to select any year between 1830 and 2026 to visualise exactly how the railways of Britain grew, merged, and in many cases, disappeared.
- Purify data so that line drawing animations are as smooth and accurate as possible
- Add other counties
- Add different colours for passenger, freight only and heritage lines
- Frontend Framework: React, Vite
- Spatial Rendering: deck.gl (
TripsLayerfor WebGL time-series animation) - Base Map: MapLibre GL JS
- Data Processing: Node.js (Custom graph-stitching and compression algorithms)
Because OpenStreetMap is a crowdsourced database primarily designed for mapping modern physical infrastructure, historical tags (opened=*, closed=*, start_date=*) are frequently omitted by contributors, especially for razed or dismantled heritage lines.
- To ensure smooth WebGL rendering, this application utilises algorithmic fallbacks alongside manually patched historical dictionary overrides.
- Missing historical tags may result in temporal anomalies. Do not use this visualiser as an authoritative historical reference. It is a programmatic representation of available, often incomplete, crowdsourced data.
OSM data represents railways as highly fragmented line segments (ways) that are often unlinked or drawn in arbitrary directions. To achieve smooth, point-to-point construction and dismantling animations, this project utilises custom data-engineering scripts to:
- Geometrically sort, reverse, and stitch unlinked coordinate arrays into continuous graph paths based on spatial proximity.
- Detect and snip "teleportation gaps" (unnaturally straight lines caused by missing localised coordinate nodes).
- Normalise deeply nested, multi-dimensional GeoJSON arrays into strict 3D array structures compatible with deck.gl.
- Mathematically interpolate path arrays to allow smooth, decimal-based spatial shrinking during the "dismantling" phase of the animation.
While highly accurate, artificial gaps in OSM tagging or untraced dismantled routes may result in visual fragmentation.
This project relies heavily on open-source geospatial data.
OpenStreetMap Map data is sourced from OpenStreetMap.
- Data is strictly © OpenStreetMap contributors and is available under the Open Database License (ODbL).
- The map tiles used as the visual basemap are rendered by OpenStreetMap.
Overpass API Raw infrastructural data was extracted using the Overpass API. This project respects the Overpass API fair use policy by pre-fetching, compressing, and serving the data locally as static JSON assets, ensuring no live load is placed on public Overpass servers during runtime.
Distributed under the MIT License. See LICENSE for more information.
Note: The underlying map data and output JSON coordinate files remain subject to the OpenStreetMap ODbL.