Skip to content

Commit

Permalink
Do not render railway (level) crossings when only tramways are involv…
Browse files Browse the repository at this point in the history
  • Loading branch information
johsin18 committed Jun 27, 2022
1 parent 6fd66c9 commit a1acf05
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
25 changes: 24 additions & 1 deletion project.mml
Expand Up @@ -2220,7 +2220,6 @@ Layer:
way,
name,
COALESCE(
'railway_' || CASE WHEN railway IN ('level_crossing', 'crossing') AND way_area IS NULL THEN railway END,
'amenity_' || CASE WHEN amenity IN ('bench', 'waste_basket', 'waste_disposal') AND way_area IS NULL THEN amenity END,
'historic_' || CASE WHEN historic IN ('wayside_cross', 'wayside_shrine') AND way_area IS NULL THEN historic END,
'man_made_' || CASE WHEN man_made IN ('cross') AND way_area IS NULL THEN man_made END,
Expand Down Expand Up @@ -2278,6 +2277,30 @@ Layer:
properties:
cache-features: true
minzoom: 14
# Render railway crossings except if they concern tramways only
- id: railway-crossings
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: &railway-crossing_sql |-
(SELECT DISTINCT ON (crossing.way)
'railway_' || crossing.railway AS feature,
crossing.way AS way,
crossing.access AS access,
crossing.railway AS type,
crossing.railway AS railway,
track.railway AS int_lc_type
FROM planet_osm_point crossing
JOIN planet_osm_line track
ON ST_DWithin(crossing.way, track.way, 0.1) -- Assumes Mercator
WHERE crossing.railway IN ('crossing', 'level_crossing')
AND track.railway IS NOT NULL AND track.railway <> 'tram'
ORDER BY crossing.way
) AS railway_crossing_sql
properties:
cache-features: true
minzoom: 14
- id: text-low-priority
geometry: point
<<: *extents
Expand Down
3 changes: 2 additions & 1 deletion style/amenity-points.mss
Expand Up @@ -1471,7 +1471,8 @@
}
}

#amenity-low-priority {
#amenity-low-priority,
#railway-crossings {
[feature = 'man_made_cross'][zoom >= 16],
[feature = 'historic_wayside_cross'][zoom >= 16] {
marker-file: url('symbols/man_made/cross.svg');
Expand Down

0 comments on commit a1acf05

Please sign in to comment.