Skip to content

Commit

Permalink
Ensure railways with railway:preserved=yes render as preserved railways
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed May 5, 2024
1 parent 91f11ec commit 38bd0dc
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Layer:
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert')
CASE WHEN tunnel IN ('yes', 'culvert')
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel,
'no' AS bridge
Expand Down Expand Up @@ -487,7 +487,8 @@ Layer:
UNION ALL
SELECT
way,
'railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
'railway_' || (CASE WHEN (railway = 'preserved' OR tags->'railway:preserved' = 'yes') AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
WHEN tags->'railway:preserved' = 'yes' THEN 'preserved'
WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service'
ELSE railway END) AS feature,
Expand Down Expand Up @@ -727,7 +728,8 @@ Layer:
UNION ALL
SELECT
way,
('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
('railway_' || (CASE WHEN (railway = 'preserved' OR tags->'railway:preserved' = 'yes') AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
WHEN tags->'railway:preserved' = 'yes' THEN 'preserved'
WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service'
ELSE railway END)) AS feature,
Expand Down Expand Up @@ -893,7 +895,7 @@ Layer:
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert')
CASE WHEN tunnel IN ('yes', 'culvert')
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel,
'yes' AS bridge
Expand Down Expand Up @@ -956,7 +958,8 @@ Layer:
UNION ALL
SELECT
way,
'railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
'railway_' || (CASE WHEN (railway = 'preserved' OR tags->'railway:preserved' = 'yes') AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
WHEN tags->'railway:preserved' = 'yes' THEN 'preserved'
WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service'
ELSE railway END) AS feature,
Expand Down Expand Up @@ -1623,7 +1626,7 @@ Layer:
) AS feature,
CASE WHEN access IN ('private', 'no', 'customers', 'permit', 'delivery') THEN 'restricted' ELSE 'yes' END AS int_access,
CASE
WHEN "natural" IN ('peak', 'volcano', 'saddle')
WHEN "natural" IN ('peak', 'volcano', 'saddle')
OR tags->'mountain_pass' = 'yes' THEN
CASE
WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC
Expand Down Expand Up @@ -1975,7 +1978,8 @@ Layer:
table: |-
(SELECT
way,
CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
CASE WHEN (railway = 'preserved' OR tags->'railway:preserved' = 'yes') AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text
WHEN tags->'railway:preserved' = 'yes' THEN 'preserved'
WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END AS railway,
CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel,
Expand Down Expand Up @@ -2204,7 +2208,7 @@ Layer:
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent,
CASE WHEN tunnel IN ('yes', 'culvert')
CASE WHEN tunnel IN ('yes', 'culvert')
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
Expand Down

0 comments on commit 38bd0dc

Please sign in to comment.