Skip to content

OpenRailwayMap-vector integration#132

Open
hiddewie wants to merge 748 commits into
OpenRailwayMap:masterfrom
hiddewie:master
Open

OpenRailwayMap-vector integration#132
hiddewie wants to merge 748 commits into
OpenRailwayMap:masterfrom
hiddewie:master

Conversation

@hiddewie
Copy link
Copy Markdown
Contributor

@hiddewie hiddewie commented Jun 7, 2025

Hi!

Over the past years I have been working on a fork of the OpenRailwayMap.

The announcement can be found on the OpenRailwayMap mailing list and on the OpenStreetMap community forum.

The fork has several features, and is actively being developed by me and several more contributors:

  • Vector-based data: the map is interactive with e.g. hover and popup showing data details.
  • Map style improvements: station size, state of lines and statons, signal support for many new countries.
  • Visual UI improvements like: configurable background map, map settings and dark mode.
  • Additional layers: loading gauge and track class.
  • Daily data updates for the entire planet.
  • OpenHistoricalMap integration for historical railway infrastructure.

At the moment the fork is hosted on https://openrailwaymap.app using Fly.io. This is purely practical, it could be hosted anywhere else.

This pull request is a starter to discuss:

  • Can we integrate the fork into the Github OpenRailwayMap organization
  • Can we publish the fork on the domain openrailwaymap.org?

These are open questions, any response is appreciated!

hiddewie and others added 29 commits October 11, 2025 11:24
Fixes #599 

Current implementation uses the AWS Terrarium open data set from
https://registry.opendata.aws/terrain-tiles/.

Hillshading is used until zoom 15, after that will become a bit more
blurry.

Default disabled.

TODO:
- [x] Add layers
- [x] Tune parameters for a good look (light and shadow and highlight)
- [x] Check attribution and licencing
- [x] Test with both raster and vector tiles
- [x] Make usage of hillshading optional
- [x] Test with terrain mode (3D) -- will not be added
Corrected description and tagging of distant stop icons

---------

Co-authored-by: Hidde Wieringa <hidde@hiddewieringa.nl>
This PR adds all light-rail signals
([osmwiki](https://osm.wiki/Australian_Tagging_Guidelines/Railway_Signals)),
except speed signs and switch signals – I'll add those in a different PR
after there's a conclusion to this thread:
#595 (comment)

<img width="84" height="97" alt="image"
src="https://github.com/user-attachments/assets/3814eddd-0142-4b80-9166-b50f595a7e82"
/>

<img width="138" height="103" alt="image"
src="https://github.com/user-attachments/assets/23b61d10-365e-48fb-9302-5610c1323f50"
/>
<img width="248" height="226" alt="image"
src="https://github.com/user-attachments/assets/55b9e9c0-8873-4b57-9ee9-9ddf30e0597d"
/>
<img width="111" height="297" alt="image"
src="https://github.com/user-attachments/assets/6a68688c-3dbd-4d2d-a31d-0a4c2c621d4b"
/>
<img width="147" height="293" alt="image"
src="https://github.com/user-attachments/assets/54abcd08-941f-4b18-bbfd-353e3cf7c571"
/>
<img width="270" height="311" alt="image"
src="https://github.com/user-attachments/assets/20161d68-4296-4d43-88e7-59daa42ab9ba"
/>
<img width="201" height="286" alt="image"
src="https://github.com/user-attachments/assets/1559ba83-92de-43a7-b168-33dcc26ca27f"
/>
<img width="218" height="330" alt="image"
src="https://github.com/user-attachments/assets/25e5b1b7-d847-4389-8acf-718a6a7159a9"
/>
<img width="1" height="1" alt="image"
src="https://github.com/user-attachments/assets/62423241-3987-4ad5-8cd7-dedef3236ced"
/>

tested
[here](http://localhost:8000/#view=14.89/-33.87949/151.20546&style=signals)
and
[here](http://localhost:8000/#view=13.94/-33.80815/150.99553&style=signals)

the signals look a bit weird, but they are actually oblong-shaped
([photo](https://github.com/user-attachments/assets/62423241-3987-4ad5-8cd7-dedef3236ced))
Fixes #611

During #580 the deactivated got lost for these zoom levels.

(http://localhost:8000/#view=14.73/49.29694/10.58621&style=signals):
<img width="731" height="425" alt="image"
src="https://github.com/user-attachments/assets/f52588c0-f1a9-43f0-b081-e5a179f9a6a5"
/>
Fixes #499

Part of #498 

Import tags of the form `railway:position:exact:LINE`, for example
`railway:position:exact:L124 = 7.721` and `railway:position:exact:L26/5
= 1.489`.

Additionally, the API can search for milestones with a position specific
to a line.

Documentation:
https://wiki.openstreetmap.org/wiki/Key:railway:position:exact

Taginfo:
https://taginfo.openstreetmap.org/search?q=railway%3Aposition%3Aexact.
This is used in China and Belgium (and possibly other countries that I
did not find).

Overpass query of nodes in Belgium using exact positions for lines:
https://overpass-turbo.eu/s/2dSo

Brussels (http://localhost:8000/#view=12.99/50.89768/4.42738):
<img width="1038" height="684" alt="image"
src="https://github.com/user-attachments/assets/20fd60c1-23aa-4a95-a1e5-56d511202ebe"
/>
Fixes #466

Currently only the infrastructure and electrification layers show
disused railway lines.

The other styles do not show them at all.

### Testing

Bielefeld (http://localhost:8000/#view=12.53/52.02747/8.56201)

Infrastructure
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/3f9f3f9c-cfa8-4c3e-b857-cda559b98fbb"
/>

Speed
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/ce156431-30fe-4d99-9674-4255fa3f7af3"
/>

Train protection
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/fd3541ae-69eb-4279-9709-b0c3c3de8278"
/>

Electrification
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/0ea9bb2a-3465-45cd-a467-0b71b7fe169e"
/>

Gauge
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/6bed66a7-a146-4658-8d18-7b64528e01e2"
/>

Loading gauge
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/9eb28c82-a890-4191-996e-a0653b38c2ec"
/>

Track class
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/a199d867-0547-463f-a684-3ebf80e6e7ba"
/>

Operator
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/856e716a-e55b-4484-92f1-6a731b74da75"
/>
Fixes #615

(http://localhost:8000/#view=18.11/50.893004/4.314001):

Before:
<img width="1433" height="852" alt="Image"
src="https://github.com/user-attachments/assets/bbc1dc07-8e57-4a72-a9df-1956f6e5f353"
/>

After:
<img width="1433" height="852" alt="image"
src="https://github.com/user-attachments/assets/aa6148e2-d074-4bad-a410-9386fe1a7407"
/>
Allow configuring whether station references or names should be shown on
zoom levels 5 to 10. For the infrastructure and operator layers.

The default will remain unchanged, showing references which shows many
more labels on the map because the references are only a few characters.

Names will show for the large stations first, then for the smaller
stations. So on low zooms only a few station names of the largest
stations of a country will show.

The station circles will always show (and overlap), and remain
clickable.

Fixes #598 

(http://localhost:8000/#view=5.81/50.671/6.58):
<img width="573" height="490" alt="image"
src="https://github.com/user-attachments/assets/d7eca4b8-c7fd-4f2e-bbe9-e6d4591d2524"
/>

(http://localhost:8000/#view=7.54/50.833/4.928):
<img width="1195" height="880" alt="image"
src="https://github.com/user-attachments/assets/b80e58c4-abbb-44f2-9ba2-1ae36b299a64"
/>

Configuration:
<img width="990" height="397" alt="image"
src="https://github.com/user-attachments/assets/3200fe95-98ad-4b67-8ca4-60f2ddc72147"
/>
Fixes the dwarf version not showing up

<img width="1678" height="673" alt="image"
src="https://github.com/user-attachments/assets/43977e49-3887-4ca0-a7c6-67632a07f877"
/>
<img width="339" height="868" alt="image"
src="https://github.com/user-attachments/assets/6d2f8489-66f8-4b08-a047-3773ee1ebd82"
/>
<img width="339" height="868" alt="image"
src="https://github.com/user-attachments/assets/876a98b1-6d84-4518-ab22-0f7ade2e3248"
/>

Only very few of these still exist on the line between Augsburg and
Donauwörth, so I didn't give them much effort. They are in some sense
very similar to the Ks system, so I used the same logic here.
Fixes #484

Postgres 18 is released:
https://www.postgresql.org/about/news/postgresql-18-released-3142/

PostGIS 3.6 is released:
https://gitea.osgeo.org/postgis/postgis/raw/tag/3.6.0/NEWS

https://hub.docker.com/r/imresamu/postgis/tags

Using the base image `imresamu/postgis:18beta1-3.6.0alpha1-alpine`, the
signal feature generation time goes from >2 minutes to 17 seconds 🎉

~The current tag is a beta (Postgres) + alpha (PostGIS) release, but so
far it looks good.~
see the
[osmwiki](https://osm.wiki/Australian_Tagging_Guidelines/Railway_Signals#NSW_Other_Signs)
page.

Unfortunately many signs have tiny text (the New South Wales system is
dumb...). Because of this, I've used a simplified icon with less text in
a few cases (for example:
[original](https://osm.wiki/File:NSW_Railway_Sign_End_Signalled_Authority.svg)
vs
[icon](https://github.com/k-yle/OpenRailwayMap-vector/blob/922505/symbols/au/nsw/signs/end_signalled_authority.svg))

<img width="136" height="113" alt="Image"
src="https://github.com/user-attachments/assets/d8458273-0c25-4c45-afab-7d7362b71e91"
/>
<img width="96" height="115" alt="Image"
src="https://github.com/user-attachments/assets/a819f1da-da3a-4853-b06b-1d06605031e1"
/>
<img width="141" height="142" alt="Image"
src="https://github.com/user-attachments/assets/2d318b05-ebea-4651-92eb-31fd7e178817"
/>
<img width="117" height="135" alt="Image"
src="https://github.com/user-attachments/assets/a5b83ee5-da82-4b73-940e-476b4bc59ad1"
/>
<br />

<img width="67" height="68" alt="Image"
src="https://github.com/user-attachments/assets/627cd7d8-9c1e-47de-a3e4-dc33edd992c7"
/>

<img width="52" height="64" alt="Image"
src="https://github.com/user-attachments/assets/0214beca-45df-434e-9dc6-49faa38c3316"
/>

<img width="71" height="71" alt="Image"
src="https://github.com/user-attachments/assets/b32cf353-8d27-4726-b6e7-326d2825a070"
/>

<img width="56" height="55" alt="Image"
src="https://github.com/user-attachments/assets/5ac1cd8f-931d-4f42-9af0-350e17733f34"
/>

<img width="53" height="45" alt="Image"
src="https://github.com/user-attachments/assets/76dd72b9-6f84-4cf7-9cd5-1f44c199f2fd"
/>

<img width="75" height="70" alt="Image"
src="https://github.com/user-attachments/assets/2b38b989-7c5c-4ad7-b9c5-5dc6e699e475"
/>

<img width="40" height="26" alt="Image"
src="https://github.com/user-attachments/assets/ac057f44-3e11-410d-86e7-f9ec2ae8969f"
/>

<img width="57" height="49" alt="Image"
src="https://github.com/user-attachments/assets/0f16bbd8-b224-4f1c-9999-6f9ca6418c5f"
/>

<img width="49" height="49" alt="Image"
src="https://github.com/user-attachments/assets/54d56d9c-950c-4c16-9448-c3c9e4d6243f"
/>

<img width="44" height="40" alt="Image"
src="https://github.com/user-attachments/assets/5590c552-eb63-4ca2-bf00-287be7da3420"
/>

<img width="93" height="77" alt="Image"
src="https://github.com/user-attachments/assets/116fcdd0-c05b-4ddf-bfdb-06ec514afec7"
/>

<img width="51" height="53" alt="Image"
src="https://github.com/user-attachments/assets/003af980-837f-4ad2-a515-8a6c02e89a82"
/>

<img width="57" height="62" alt="Image"
src="https://github.com/user-attachments/assets/ea96ee0f-03bb-4694-ad68-66d5bbdefe4e"
/>

Co-authored-by: Hidde Wieringa <hidde@hiddewieringa.nl>
Closes #498

Add tests for the OpenRailwayMap Lua Osm2psql import script.

Some tests verify the importing logic, giving meaning to OpenStreetMap
tags.

Some tests verify the importing logic, providing a node/way/relation
with certain tags, and verifying the expected rows with values in the
Postgres tables.
This reduces the context which needs to be sent to the Docker daemon for
individual image builds, which speeds up the builds.
Part of #555 

## Approach

Consider the zoom levels 0 up to and including 6.

These zoom levels only show the main and present lines, no historical or
future, nor branch/service lines.

For every layer, the railway lines are grouped in their geometries,
making a single line with the same properties for that layer.

For example, in the infrastructure layer, the lines with the same
reference and high-speed indication are grouped together to form a
single line. That geometry is easier to simplify (remove points close
together).

Layers:
- infrastructure: group by reference, name, highspeed
- speed: group by reference, name, highspeed, speed
- electrification: group by reference, name, electrification state,
voltage, frequency
- gauge: group by reference, name, gauge (only the first if the line has
multiple)
- loading gauge: group by reference, name, loading gauge
- track class: group by reference, name, track class
- operator, group by reference, name, owner, operator

In particular this means that every layer can have slightly different
geometries, and will have different properties. In particular, railway
lines grouped by e.g. speed cannot have a property with e.g. gauge,
because that property is not grouped on. The popup will not show the
properties of the other layers for the low zooms. Also the aggregated
railway lines will not show the OSM links to view/edit a railway line,
because the line can consist of **many** OSM lines. Every layer will
have its own source for the low zoom railway line data because of this.

Technical note: ouputting repeated properties, such as `state:
'present'` and `usage: 'main'` which every low zoom tile has, is no
problem. The tiles are compressed, so repeated values of the same
property consume almost no space.


## Testing

The map view has some small differences because of the grouping of the
railway lines. The lines are smoother and less "thick" where many small
line segments are in OSM data. This improves the map clarity.

In screenshots below: ignore transfered data, only look at loaded data.
On localhost, caching is not enabled.

### Zoom 5

Before (https://openrailwaymap.app/#view=5.9/50.984/6.043):
<img width="1433" height="139" alt="image"
src="https://github.com/user-attachments/assets/ea8a940d-59bd-4f48-a313-772566a1d9a4"
/>
<img width="882" height="491" alt="image"
src="https://github.com/user-attachments/assets/b012bd8d-36e5-4e89-91ef-0b5df1554fb4"
/>
<img width="1433" height="755" alt="image"
src="https://github.com/user-attachments/assets/65dd6ab9-163d-4b54-8e22-c21b4d5eac09"
/>
<img width="1433" height="357" alt="image"
src="https://github.com/user-attachments/assets/0da62783-22ee-4083-8088-0bad4499dcfb"
/>

28 MB of data loaded





After (http://localhost:8000/#view=5.9/50.984/6.043):

<img width="1430" height="122" alt="image"
src="https://github.com/user-attachments/assets/7b86ec54-41f7-40d0-849a-e4afc016dfe2"
/>
<img width="784" height="400" alt="image"
src="https://github.com/user-attachments/assets/7a1f3f36-f0bc-4bed-9024-3a192af2cfe3"
/>
<img width="1433" height="755" alt="image"
src="https://github.com/user-attachments/assets/2c958e64-1df1-4138-8bb4-91a077a69ba2"
/>
<img width="1433" height="357" alt="image"
src="https://github.com/user-attachments/assets/0349be3c-4c9f-4420-92de-7166fb475c4d"
/>


9 MB of data loaded

## Zoom 2

Before (https://openrailwaymap.app/#view=2/54.55/42.19):
<img width="1433" height="753" alt="image"
src="https://github.com/user-attachments/assets/515432cb-0cbb-4637-a9a4-4e7845c6a701"
/>
<img width="1432" height="359" alt="image"
src="https://github.com/user-attachments/assets/a54385d9-a1cb-48ef-b40a-5029c7d53b34"
/>

30 MB of data loaded

After (http://localhost:8000/#view=2/54.55/42.19):
<img width="1433" height="753" alt="image"
src="https://github.com/user-attachments/assets/09cf29b2-b48f-4142-8d17-a18cc3915f65"
/>
<img width="1432" height="359" alt="image"
src="https://github.com/user-attachments/assets/335c363e-ea80-4fed-9022-2cbc2513d7f4"
/>

10.5 MB of data loaded

### Funny detail

Many lines in Russia, middle east, and Asia do not have a reference nor
name. They will all be grouped together and highlighted as a single
(huge) line.
<img width="790" height="619" alt="image"
src="https://github.com/user-attachments/assets/74568672-0ef5-4e70-9b6d-b92940477f77"
/>


## Followups

- Booleans, do not send `false` but only `null` or `true`
Docs in
https://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging_in_France#Cab_signalling

Changes:
- Cab signalling signs
- TVM and ETCS stop marker signs
- Shunting marker
- Wrong route
- Distant route indicator and route indicator
- Distant stop and stop signals
- Shunting signals
Changes:
- correct detecting block markers with the arrow shape
- add support for the tagging of block markers with lights for shunting
movements (227a and 227c)
- simplify icons a bit


Docs in
https://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging_in_Netherlands#ETCS_stop_marker

(http://localhost:8000/#view=19.1/51.8958495/5.8106961&style=signals):
<img width="893" height="622" alt="image"
src="https://github.com/user-attachments/assets/fbf3f428-2621-493c-b337-442b81c8d1a2"
/>
This keeps the tile sources consistent (currently it is a mix of views
and functions), and allows using the 'id' column of a layer as ID,
without promoting it client-side.

Changing the fields of a single tile view is also possible by redefining
the tile function (and comment), without further changing the Martin
configuration or even restarting the Martin container.
Fixes #605 

Implements:

- ETCS block markers
- TVM/CBTC block markers
- Cab Shunt Entry block markers
- Entry, Exit, and Warning of entry into cab signalling
    - Directional arrows for the above (left and right only)
- Block marker absolute/passable plates

Drawn from the relevant RSSB standards.

---

- [x] Tagging on map
- [x] Description on the [UK Rail Signal Tagging
page](https://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging_in_the_United_Kingdom)

---

## Potential testing locations

| Location | What's there |
| --------- | -------------- |
| Aberystwyth | ETCS block markers, cab signalling entry (2) |
| Dovey Junction | ETCS block markers |
| Tywyn | ETCS block markers, shunt entry block markers, cab signalling
entry |
| Barmouth | ETCS block markers, shunt entry block markers, cab
signalling entry |
| Harlech | ETCS block markers, shunt entry block markers |

Note: At Barmouth the crossing signal (white/red flashing light) should
be above the ETCS block marker at the UP end of the platforms.

---------

Co-authored-by: Hidde Wieringa <hidde@hiddewieringa.nl>
TMACS is another australian system
([enwiki](https://en.wikipedia.org/wiki/Train_Management_and_Control_System)
| [osmwiki](https://osm.wiki/Key:railway:tmacs)). Just like ATMS (#546),
it uses GPS instead of Balises.


To avoid a colour clash, i've used `#ffcc00`. This is a list of every
colour used in Australia:

* `#006eff` ETCS
* `#cc0052` CBTC
* `#43b54d` ATMS
* `#884400` TWC
* `#ffc0cb` TPWS
* `#ffcc00` TMACS 🆕

<img width="1165" height="687" alt="image"
src="https://github.com/user-attachments/assets/0e135eda-fa9d-42fd-9028-f60d9d48b6e7"
/>
<img width="1290" height="516" alt="image"
src="https://github.com/user-attachments/assets/4595c1f8-1125-4451-9b0d-0827bdf23a27"
/>
~~Partially reverts
#636

The background map does not load entirely through the changes in
maplibre/maplibre-gl-js#6469, see comment
maplibre/maplibre-gl-js#6469 (comment).

Fixed in maplibre/maplibre-gl-js#6650, released
in https://github.com/maplibre/maplibre-gl-js/releases/tag/v5.11.0.

Closes #644

I also removed all unused javascript assets.
Fixes #645 

If the platforms are included in a `stop_area` relation, they will be
included in the station bubble as well.

http://localhost:8000/#view=15.8/51.887194/4.552073:
<img width="972" height="684" alt="image"
src="https://github.com/user-attachments/assets/09539276-8e26-407b-b6b4-9f03afa83bf1"
/>

<img width="972" height="684" alt="image"
src="https://github.com/user-attachments/assets/104491d6-99f7-4cf8-be71-c8241507419c"
/>

<img width="1160" height="825" alt="image"
src="https://github.com/user-attachments/assets/27083aa9-263e-4f72-a073-ff51d1fa2506"
/>

http://localhost:8000/#view=17.41/52.283907/6.419948:
<img width="1160" height="825" alt="image"
src="https://github.com/user-attachments/assets/3a76f178-004d-483b-a1ad-7717ef8f1394"
/>
hiddewie and others added 30 commits May 3, 2026 20:19
For #796 

Clean up and add test for railway positions.
For #796

Includes localized popup content

<img width="1156" height="886" alt="image"
src="https://github.com/user-attachments/assets/c4afa063-97b0-4a01-8e43-f06da53a79c4"
/>
<img width="1495" height="761" alt="image"
src="https://github.com/user-attachments/assets/867ea75a-031d-4b4a-a182-802d7161fcaa"
/>
Closes #811.

This adds the tram signals G 3a, G 5, So 5a, So 11 and So 25 of the city
of Dresden. It further replaces the signals So 11/12 of the city of
Rostock by the more general signals St 23/24 applicable to all of East
Germany, according to a
[change](https://wiki.openstreetmap.org/wiki/DE_talk:OpenRailwayMap/Tagging_Trams_in_Germany#Vorfahrt_(gew%C3%A4hren))
of the wiki documentation.

Thanks to @jonaes for the documentation and preparation!

Signal documentation: [Dresden
signals](https://wiki.openstreetmap.org/wiki/DE:OpenRailwayMap/Tagging_Trams_in_Germany#Dresden),
[St
23/24](https://wiki.openstreetmap.org/wiki/DE:OpenRailwayMap/Tagging_Trams_in_Germany#St_23)

There are still open questions in the issue regarding So 11 and So 25
which should be answered before merging.

### Examples
#### G 3a
[10062241384](https://www.openstreetmap.org/node/10062241384)
<img width="220" height="168" alt="Screenshot 2026-03-02 215942"
src="https://github.com/user-attachments/assets/7a43a4d9-1032-463d-b4ba-9a16379ea408"
/>

#### G 5
[13604032234](https://www.openstreetmap.org/node/13604032234)
<img width="212" height="148" alt="Screenshot 2026-03-02 220145"
src="https://github.com/user-attachments/assets/aede1c4b-169d-49f2-9e07-29cabe957295"
/>

#### So 5a
[1703088767](https://www.openstreetmap.org/node/1703088767)
<img width="200" height="175" alt="Screenshot 2026-03-02 220449"
src="https://github.com/user-attachments/assets/22ea1e40-a1f9-4df5-98a1-1a234739e457"
/>

#### So 11
[13604032252](https://www.openstreetmap.org/node/13604032252)
<img width="236" height="208" alt="Screenshot 2026-03-02 223425"
src="https://github.com/user-attachments/assets/b9d536cf-a4d2-46bd-8297-c8314e0751eb"
/>

#### So 25
[9288948889](https://www.openstreetmap.org/node/9288948889)
<img width="318" height="387" alt="Screenshot 2026-03-09 220637"
src="https://github.com/user-attachments/assets/810df7d9-ce10-4fd0-9775-e8d514e912f7"
/>

#### St 23/24
[13604032264](https://www.openstreetmap.org/node/13604032264) (St 23),
[12514198727](https://www.openstreetmap.org/node/12514198727) (St 24)
<img width="244" height="236" alt="Screenshot 2026-03-02 221819"
src="https://github.com/user-attachments/assets/3669c273-a054-4e72-a245-c7bd6bf87768"
/>

[13612313997](https://www.openstreetmap.org/node/13612313997) (St 24
with tram icon),
<img width="165" height="153" alt="Screenshot 2026-03-03 180755"
src="https://github.com/user-attachments/assets/241150a1-8377-422d-93b7-b98edfa2a2ad"
/>

---------

Co-authored-by: Hidde Wieringa <hidde@hiddewieringa.nl>
For #796 

When #865 is implemented, the three signal layer views can be merged
into one.

Here is one incredible signal
(https://www.openstreetmap.org/node/5747403095):
<img width="1431" height="1113" alt="image"
src="https://github.com/user-attachments/assets/e82f44d0-d887-4060-8752-0d5fbd0be5e3"
/>

<img width="1033" height="481" alt="image"
src="https://github.com/user-attachments/assets/657e86bc-2b87-4f0e-a161-d99f78a843ec"
/>

<img width="1033" height="481" alt="image"
src="https://github.com/user-attachments/assets/4df91293-58ff-4c35-9687-afc121bc521a"
/>
For #796 

This is the last source to be migrated.

<img width="942" height="608" alt="image"
src="https://github.com/user-attachments/assets/439b20c7-7f3e-4e1a-811c-254e427610fd"
/>
Closes #796 

Some cleanup after all sources have been migrated from tile data to API
for full feature information.
Eisenbahnen und Verkehrsbetriebe Elbe-Weser GmbH
<img width="850" height="693" alt="image"
src="https://github.com/user-attachments/assets/ac51bc57-7c74-413e-8555-425d0cc7abe3"
/>

SWEG Schienenwege (dark blue)
<img width="1248" height="858" alt="image"
src="https://github.com/user-attachments/assets/67f3c924-e3a3-44db-9eb9-4f328f68e100"
/>

Rennsteigbahn GmbH & Co. KG (Note: some of the ways need re-tagging so
it won't immediately exactly look like that)
<img width="677" height="737" alt="image"
src="https://github.com/user-attachments/assets/e8ce4e81-dbee-4797-851f-5117280dd1f8"
/>

BayernBahn Infra
<img width="604" height="792" alt="image"
src="https://github.com/user-attachments/assets/a9d1cb08-77b5-4423-a7f3-255973171cc6"
/>
Related to #945

The OpenHistoricalMap features catalog do not have a view defined, but
should still show the popup from the available properties data.

<img width="951" height="443" alt="image"
src="https://github.com/user-attachments/assets/3d17cc7e-7853-42e7-900f-e1a74ffefab3"
/>
Extracted from work in
#674 by
@MatisseBE

When the map is pitched, 30 degrees or more, directional features such
as signals are shown only for the faced direction.

In the pitched view, signals within 75 degrees of the faced direction
are shown.

The signal direction icon will be hidden in the pitched view, as only
the facing signals are visible on the map.

First render: 
<img width="1433" height="992" alt="image"
src="https://github.com/user-attachments/assets/c6d8f424-2eaa-4b03-8f44-656765d922dd"
/>

Codewise there is quite some duplication in the style, because of the
different layers. using the same kind of data. With #865 that can be
reduced.

TODO:
- [x] signals with both directions
- [x] icons above track when in pitched mode
- [x] direction for buffer stop signals
- [x] legend
This fixes a bug in
#946 (comment)

The pitched style was always rendered not checking if the pitch is
actually > 30 degrees.



## Without pitch (`pitch <= 30`)
**This is fixed by this PR**


http://localhost:8000/#view=17.72/49.987131/14.365661/-137.6&style=signals
This PR | Previously
--- |---
<img width="338" height="855" alt="image"
src="https://github.com/user-attachments/assets/ac623a1b-2340-4001-a71f-8fd836782e6f"
/> | <img width="338" height="855" alt="image"
src="https://github.com/user-attachments/assets/d9b49e3e-9120-49f5-a755-b8d99b9ce432"
/>

Similar changes are also in the other layers with pitching implemented,
e.g. *Electricity* and *Speed*

### With pitch (`pitch > 30`)

**This is not changed by this PR**


http://localhost:8000/#view=17.72/49.987131/14.365661/-139.6/52&style=signals
This PR | Previously
--- |---
<img width="338" height="855" alt="image"
src="https://github.com/user-attachments/assets/324468d4-e093-4904-a084-b4ae05a5c517"
/> | <img width="338" height="855" alt="image"
src="https://github.com/user-attachments/assets/2408fba8-3747-49a0-bb03-4c62a683c3e2"
/>
Solves issue #956 
Fix for a bug in #939

Rendering of non-signal POIs (`power_supply` and
`isolated_track_section`) in the electrification layer was broken in
#939. This PR fixes that.

That PR was partially a preparation for #865 (Merging of signal layers).
Rendering of POIs inside signal layers might need to be reworked again
for #865.



https://localhost:8000/#view=19.19/50.0866823/19.9330909&style=electrification
| Before this fix | After this fix |
| --- | --- |
| <img width="840" height="697" alt="Image"
src="https://github.com/user-attachments/assets/79c5968c-bf6a-4305-82f9-678213085ac7"
/> | <img width="840" height="697" alt="Image"
src="https://github.com/user-attachments/assets/27d75d03-36e0-4fc5-b4af-6669b137e724"
/> |
This indicator is rare, and probably the only blue signal in Germany...
:smile: It tells the driver about the state of the technical blockage
(i.e. Indusi 2000hz magnet) to enter a line with simplified ruleset
(Zugleitbetrieb aka. ZLB). It can either be blue (blockage on) or be
flashing blue (blockage off). It does not indicate a driving permission!
The permission to enter the line is gained via radio.

It looks like this:
<img width="426" height="329" alt="image"
src="https://github.com/user-attachments/assets/9851b857-46ab-4729-9871-abf26e51e691"
/>
(cred: https://youtu.be/aEpg9_NU4Ak?t=1026)

<img width="510" height="476" alt="image"
src="https://github.com/user-attachments/assets/01c36332-daaa-4e01-b5a4-b871cfd1f106"
/>

(cred: https://youtu.be/kwirJdvKAH0?t=2852)

btw: TUZ = technically assisted ZLB
Huge list of functional changes between January and May 2026.

<img width="1430" height="1114" alt="image"
src="https://github.com/user-attachments/assets/45ff1e88-ce19-4457-a1c1-c2927ab54245"
/>
Closes #869 

This pull request adds support for stations without names, in the zooms
where all stations are shown on the map.

Stations without a name will show only a dot.

http://localhost:8000/#view=12.47/34.36065/-3.01361:
<img width="780" height="528" alt="image"
src="https://github.com/user-attachments/assets/f62b9425-85c3-4534-85d1-06960b2f35ec"
/>

http://localhost:8000/#view=15.84/34.351932/-3.040193:
<img width="780" height="528" alt="image"
src="https://github.com/user-attachments/assets/85de77e7-f99e-4b3e-af14-d171268f9105"
/>
Followup from #960 which put the argument of the station name for high
zooms in the operator layer in the wrong place.
Simplify the style expressions for rendering the guage coloring with the
`interpolate-hcl` expression.

<img width="1419" height="798" alt="image"
src="https://github.com/user-attachments/assets/95efcd96-5d77-4ba4-935c-07d3cacca291"
/>
Move the generation of railway line labels for the infrastructure,
electrification and gauge layers to the map style instead of the
database.

The speed label is an exception, it is generated with complex logic
during data import.

Additionally, the reference and name are not output in the low zoom
tiles anymore, because there is no use for it in the tile rendering.


http://localhost:8000/#view=16.33/55.565637/12.903312&style=electrification
<img width="1229" height="384" alt="image"
src="https://github.com/user-attachments/assets/6e2e5593-9541-4fe2-8267-6578a6c655f0"
/>

http://localhost:8000/#view=12.95/39.6525/-0.24478&style=track
<img width="1431" height="780" alt="image"
src="https://github.com/user-attachments/assets/93ad19b6-d013-4b51-8aaf-d3c376441670"
/>

http://localhost:8000/#view=15.42/55.565678/12.897913
<img width="1229" height="384" alt="image"
src="https://github.com/user-attachments/assets/140ce289-d6b1-4e3d-a61b-25004baaba38"
/>
Fixes #951

In the Bordeaux-Saint-Jean station,
http://localhost:8000/#view=17.57/44.825551/-0.555097:
<img width="1009" height="627" alt="image"
src="https://github.com/user-attachments/assets/f764099b-0536-445f-98bc-4415254e963a"
/>
The unit was correct, but the spherical projection was not taken into
account.

Fixes #974

Followup on #971 

On http://localhost:8000/#view=17.74/44.825825/-0.555384,
Bordeaux-Saint-Jean.

Before:
<img width="1019" height="448" alt="image"
src="https://github.com/user-attachments/assets/525c3ba2-df5d-402f-92b0-5392c60e85a8"
/>

After:
<img width="1019" height="448" alt="image"
src="https://github.com/user-attachments/assets/6d34698a-bf1a-4ba9-a81f-bd4c2d18642d"
/>
This saves tile data for stations between zooms 8 and 13, and speed
signals between 13 and 16, where not every feature is shown on the map.

Magdeburg, speed layer:

Zoom 12 http://localhost:8000/#view=12/52.1314/11.6568&style=speed
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/28d3ce4e-8cd1-4b28-a6c3-ae519121837d"
/>

Zoom 13 http://localhost:8000/#view=12/52.1314/11.6568&style=speed
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/4ab53498-3290-4f4c-a974-d5f3723499be"
/>

Zoom 14 http://localhost:8000/#view=14/52.12747/11.62723&style=speed
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/e791d937-ee7c-46a1-815e-6517ce1c1a04"
/>

Zoom 16 http://localhost:8000/#view=16/52.122952/11.625045&style=speed
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/a54f0ec1-c7b9-44cc-8c80-81a899c76822"
/>

Magdeburg, infrastructure layer:

Zoom 8 http://localhost:8000/#view=8/52.131/11.657
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/6bbb922a-08da-4d11-a7d2-044ed9d3e11e"
/>

Zoom 9 http://localhost:8000/#view=9/52.131/11.657
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/2c315281-27db-4ac0-8db8-432a8718e431"
/>

Zoom 10 http://localhost:8000/#view=10/52.131/11.657
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/c7896dce-d25b-4164-9e02-7ff90acc5ed5"
/>

Zoom 11 http://localhost:8000/#view=11/52.131/11.657
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/e48ab783-d4a5-4166-8993-0b1e17ab557e"
/>

Zoom 12 http://localhost:8000/#view=12/52.131/11.657
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/f3027bfa-3ea6-4390-978d-0872d9c85479"
/>

Zoom 13 http://localhost:8000/#view=13/52.12989/11.63333
<img width="1028" height="778" alt="image"
src="https://github.com/user-attachments/assets/1d4124a5-7b53-4b14-b720-f9ece987314d"
/>
This adds most railway signals of Luxembourg.

The documentation can be found at
https://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging_in_Luxembourg

- This includes every signal in Luxembourg currently tagged in OSM
except for tram and foreign signals.
- Signals RF6 and RF13 are included as symbols, but not yet implemented
as signal features, as I want to wait for a new suitable signal category
(#972).
- Some other signals not yet tagged in OSM are still missing which I
will add when encountering them in person.
- The only previously implemented signals of Luxembourg were the
catenary ones. I have replaced these to better match their actual design
(as opposed to the French one).
- This probably doesn't matter to anyone but me, but the SVGs are
(except for letters and numbers) entirely written in a text editor which
makes the source code compact and me happy. :)

Due to the large number of signals, I will just show some screenshots
for demonstration. Please ask if you have any questions regarding
specific signals. Most of them can be seen around Luxembourg,
Bettembourg, Ettelbruck and Dudelange-Ville station.
<img width="401" height="553" alt="Screenshot 2026-05-26 193642"
src="https://github.com/user-attachments/assets/ab431718-ec3b-436b-aead-2fadff6a483b"
/><img width="355" height="319" alt="Screenshot 2026-05-26 193744"
src="https://github.com/user-attachments/assets/fad21d46-7284-42ea-aa92-7358e94be847"
/><img width="275" height="303" alt="Screenshot 2026-05-26 193819"
src="https://github.com/user-attachments/assets/c703988d-4dcf-49d8-a9be-ba779ef3bf56"
/><img width="289" height="536" alt="Screenshot 2026-05-26 193837"
src="https://github.com/user-attachments/assets/1abc3ce5-4437-4f4e-bffd-1f66231f944d"
/><img width="366" height="277" alt="Screenshot 2026-05-26 193852"
src="https://github.com/user-attachments/assets/7252b76d-143b-4901-86db-d24e6d041453"
/><img width="298" height="345" alt="Screenshot 2026-05-26 193912"
src="https://github.com/user-attachments/assets/94b701bd-433f-497d-9dae-899cbe1fa25c"
/><img width="169" height="148" alt="Screenshot 2026-05-26 193657"
src="https://github.com/user-attachments/assets/e34d5a21-1d2a-4ff7-af15-cb053a29a467"
/><img width="333" height="643" alt="Screenshot 2026-05-26 193728"
src="https://github.com/user-attachments/assets/3bdae543-abf8-4189-b870-ab2e94ff5a11"
/><img width="204" height="164" alt="Screenshot 2026-05-26 193753"
src="https://github.com/user-attachments/assets/9f753f58-9a5a-4f71-8035-3f4ebcdecb58"
/><img width="136" height="123" alt="Screenshot 2026-05-26 194048"
src="https://github.com/user-attachments/assets/a0918b54-ac2c-4e91-98a3-eff0386c0c87"
/><img width="763" height="284" alt="Screenshot 2026-05-26 193936"
src="https://github.com/user-attachments/assets/914acddd-3b51-422d-b17a-3933b667ae4a"
/><img width="283" height="463" alt="Screenshot 2026-05-26 193953"
src="https://github.com/user-attachments/assets/a3e6ba69-4855-4553-b602-e605eed4abaf"
/><img width="152" height="148" alt="Screenshot 2026-05-26 194013"
src="https://github.com/user-attachments/assets/c56c9f3d-062f-4547-8af8-c55a3848960a"
/><img width="264" height="243" alt="Screenshot 2026-05-26 194137"
src="https://github.com/user-attachments/assets/b3afd038-377f-4dbe-ba26-1499785e4ae3"
/><img width="239" height="257" alt="Screenshot 2026-05-26 194214"
src="https://github.com/user-attachments/assets/91072645-6f7a-4560-8d8b-653f91da1c06"
/><img width="188" height="169" alt="Screenshot 2026-05-26 194150"
src="https://github.com/user-attachments/assets/60fe966d-f7cc-4eee-9458-90bbe5c7f9ba"
/><img width="198" height="154" alt="Screenshot 2026-05-26 194120"
src="https://github.com/user-attachments/assets/c6bde99d-85e5-4685-ace9-e71a5c94b75f"
/><img width="115" height="104" alt="Screenshot 2026-05-26 194109"
src="https://github.com/user-attachments/assets/6dc0b133-e4e7-4bf6-9901-d8cef172a9e0"
/><img width="480" height="576" alt="Screenshot 2026-05-26 194939"
src="https://github.com/user-attachments/assets/9f03d19d-450d-40cb-b262-d015ebf37fae"
/><img width="507" height="577" alt="Screenshot 2026-05-26 194951"
src="https://github.com/user-attachments/assets/dddead8f-3901-4788-9824-c2013fa8a4d6"
/><img width="377" height="77" alt="Screenshot 2026-05-26 195000"
src="https://github.com/user-attachments/assets/09e37a3d-464e-4adf-9938-09e0a58fa998"
/><img width="479" height="264" alt="Screenshot 2026-05-26 194903"
src="https://github.com/user-attachments/assets/8e1fb304-d9f0-464a-a728-740fc9285f17"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.