Transport · Public data

Rail network of Europe

Every railway, tram, metro and funicular line in Europe, as segments.

Overture Maps Foundation, transportation theme (rail segments; OpenStreetMap-derived) · ODbL 1.0 · commons_pubdata.transport.rail_segments

Read Markdown
752,032 rail segments; orange: tram, metro and light rail.
752,032 rail segments; orange: tram, metro and light rail.

Query it with DuckDB.

Bash
lhbox duckdb --catalog commons/pubdata
SQL · Kilometres of line by class
SELECT class, round(sum(length_m) / 1000) AS km
FROM commons_pubdata.transport.rail_segments GROUP BY 1 ORDER BY 2 DESC;

Read it where you work.

Public, read-only data. With an account, lhbox duckdb attaches the catalog as commons_pubdata; an agent with the LakehouseBox connector opens it with open_public_catalog("commons/pubdata"). Without one, DuckDB reads the public files directly.

Example queries

  • Kilometres of line by class
    SELECT class, round(sum(length_m) / 1000) AS km
    FROM commons_pubdata.transport.rail_segments GROUP BY 1 ORDER BY 2 DESC;
  • Tram network per region, with the regions of places.admin_areas (`&&` on the bounding boxes first, exact second)
    INSTALL spatial; LOAD spatial;
    SELECT a.region_code, a.name, round(sum(r.length_m) / 1000, 1) AS tram_km
    FROM commons_pubdata.transport.rail_segments AS r JOIN commons_pubdata.places.admin_areas AS a
      ON a.subtype = 'region' AND a.class = 'land'
     AND a.geometry && r.geometry AND ST_Intersects(a.geometry, r.geometry)
    WHERE r.class = 'tram'
    GROUP BY 1, 2 ORDER BY tram_km DESC LIMIT 20;

Know your columns.

ColumnTypeMeaning
segment_idstringOverture GERS id of the segment
classstringstandard_gauge, narrow_gauge, tram, subway, light_rail, funicular, monorail or unknown
subclassstringOverture's finer class when set
namestringthe line's name when it has one
flagsstringcomma-separated rail flags when set: is_passenger, is_freight, is_disused, is_abandoned, is_bridge, is_tunnel, …
length_mdoublespheroidal length in metres
View all 12 columns
bbox_xmindoublebounding box west (longitude)
bbox_ymindoublebounding box south (latitude)
bbox_xmaxdoublebounding box east
bbox_ymaxdoublebounding box north
geometrygeometrythe line (WGS84, longitude/latitude)
overture_releasestringthe release this row came from

Join keys: segment_id.

Before you query.

  1. A segment is a piece of track between junctions, not a whole line: sum length_m for lengths and group by name only where names are set.
  2. flags carries OpenStreetMap's tags; exclude is_disused and is_abandoned for the working network.
  3. The box includes the edges of North Africa and Anatolia; join places.admin_areas for countries.
  4. geometry is an Iceberg v3 geometry column (DuckDB 1.5.6 or newer; PyIceberg 0.12 cannot load v3 geometry tables yet): filter with geometry && <shape> AND ST_Intersects(geometry, <shape>), which skips files and row groups.
  5. Attribution to OpenStreetMap contributors (ODbL) is required wherever the data is shown.

Source & licence.

Source
Overture Maps Foundation, transportation theme (rail segments; OpenStreetMap-derived)
Licence
ODbL 1.0 (OpenStreetMap-derived); this table, a derived database, is published under ODbL 1.0 too
Attribution
© OpenStreetMap contributors (ODbL 1.0), via the Overture Maps Foundation transportation theme.
Coverage
a box around Europe (25°W to 45°E, 34°N to 72°N); the latest Overture release
Refresh
monthly, the whole table replaced; source version overture 2026-09-23.1
Table
commons/pubdata · transport.rail_segments · Iceberg v3 · browse the catalog
Recipe
pubdata/recipes/rail_network.py, registry entry pubdata/registry/rail_network.yaml

Source: Overture Maps Foundation, transportation theme (rail segments; OpenStreetMap-derived) · ODbL 1.0 · Snapshot shown: 10 Oct 2026HTML for people. Markdown for agents.