Skip to content

Commit

Permalink
Rendering seasonal waterways as intermittent
Browse files Browse the repository at this point in the history
  • Loading branch information
kocio-pl committed Dec 23, 2017
1 parent ac7d4fb commit 49e332b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
25 changes: 20 additions & 5 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ Layer:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway, tags->'intermittent' as intermittent,
way,
waterway,
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') THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
WHERE waterway IN ('stream', 'drain', 'ditch')
Expand All @@ -193,7 +197,9 @@ Layer:
(SELECT
way,
waterway,
tags->'intermittent' as intermittent
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
FROM planet_osm_line
WHERE waterway = 'river'
) AS water_lines_low_zoom
Expand Down Expand Up @@ -276,7 +282,12 @@ Layer:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway, name, tags->'intermittent' as intermittent,
way,
waterway,
name,
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') THEN 'yes' ELSE 'no' END AS int_tunnel,
'no' AS bridge
FROM planet_osm_line
Expand Down Expand Up @@ -945,7 +956,9 @@ Layer:
way,
waterway,
name,
tags->'intermittent' as intermittent,
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') THEN 'yes' ELSE 'no' END AS int_tunnel,
'yes' AS bridge
FROM planet_osm_line
Expand Down Expand Up @@ -2205,7 +2218,9 @@ Layer:
waterway,
lock,
name,
tags->'intermittent' as intermittent,
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') THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')
Expand Down
8 changes: 4 additions & 4 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
[waterway = 'stream'][zoom >= 15] {
line-width: 3.5;
}
[intermittent = 'yes'] {
[int_intermittent = 'yes'] {
line-dasharray: 4,3;
line-cap: butt;
line-join: round;
Expand All @@ -82,7 +82,7 @@

#water-lines-low-zoom {
[waterway = 'river'][zoom >= 8][zoom < 12] {
[intermittent = 'yes'] {
[int_intermittent = 'yes'] {
line-dasharray: 8,4;
line-cap: butt;
line-join: round;
Expand Down Expand Up @@ -123,7 +123,7 @@
water/line-cap: round;
water/line-join: round;

[intermittent = 'yes'],
[int_intermittent = 'yes'],
[waterway = 'wadi'] {
[bridge = 'yes'][zoom >= 14] {
bridgefill/line-color: white;
Expand Down Expand Up @@ -191,7 +191,7 @@
}
}

[intermittent = 'yes'] {
[int_intermittent = 'yes'] {
water/line-dasharray: 4,3;
water/line-cap: butt;
water/line-join: round;
Expand Down

0 comments on commit 49e332b

Please sign in to comment.