Skip to content

Combine railway line layers with dashes#1000

Open
hiddewie wants to merge 12 commits into
masterfrom
combine-dasharrays
Open

Combine railway line layers with dashes#1000
hiddewie wants to merge 12 commits into
masterfrom
combine-dasharrays

Conversation

@hiddewie

@hiddewie hiddewie commented Jun 14, 2026

Copy link
Copy Markdown
Owner

PR number 1000 🎉

Fixes #979

Enabled by maplibre/maplibre-gl-js#1235 and maplibre/maplibre-gl-js#5812. Supported since Maplibre GL JS version 5.8.0.

See https://maplibre.org/maplibre-style-spec/layers/#line-dasharray

We can combine duplicated map layers that use different dashes. The line-dasharray supports a data-driven style.

We still have to duplicate dashed lines and non-dashed lines, because line-cap is not data-driven. For lines with a dasharray, the line cap should be butt while for non-dashed lines the line cap should be round.

Deduplicating railway lines with dashes will cause the map style to contain less layers, causing the map to load quicker. Less layers will also cause the map to show tiles quicker, because less layers have to be evaluated for each feature on the map.

Layer differences:

  • infrastructure: from 586 to 464
  • speed: from 78 to 58
  • train protection: from 144 to 166 (because of a correctness split of dual/multi train protection system lines with/without dashes)
  • electrification: from 134 to 74
  • track: from 117 to 82
  • operator: from 80 to 60
  • routes: from 72 to 52

View diff with whitespace disabled: https://github.com/hiddewie/OpenRailwayMap-vector/pull/1000/changes?w=1

hiddewie added 12 commits June 14, 2026 13:54
Fixes #979

Enabled by maplibre/maplibre-gl-js#1235 and maplibre/maplibre-gl-js#5812. Supported since Maplibre GL JS version 5.8.0.

See https://maplibre.org/maplibre-style-spec/layers/#line-dasharray

We can combine duplicated map layers that use different dashes. The `line-dasharray` supports a data-driven style.

We still have to duplicate dashed lines and non-dashed lines, because `line-cap` is not data-driven. For lines with a dasharray, the line cap should be `butt` while for non-dashed lines the line cap should be `round`.
…to combine-dasharrays

# Conflicts:
#	proxy/js/styles.mjs
@hiddewie hiddewie marked this pull request as ready for review June 14, 2026 13:58
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.

Combine similar map layers with dasharrays

1 participant