Skip to content

Commit

Permalink
Add rendering for straits on linear ways
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisenbe committed Mar 27, 2019
1 parent b5938d6 commit 54bfec6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
23 changes: 22 additions & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2510,8 +2510,27 @@ Layer:
) AS addresses
properties:
minzoom: 17
- id: water-lines-text-lowzoom
geometry: linestring
class: water-lines-text
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
name,
"natural"
FROM planet_osm_line
WHERE "natural" = 'strait'
AND name IS NOT NULL
) AS water_lines_text_lowzoom
properties:
minzoom: 5
maxzoom: 12
- id: water-lines-text
geometry: linestring
class: water-lines-text
<<: *extents
Datasource:
<<: *osm2pgsql
Expand All @@ -2521,13 +2540,15 @@ Layer:
waterway,
lock,
name,
"natural",
tags-> 'lock_name' AS lock_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
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi')
WHERE (waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi')
OR "natural" = 'strait')
AND (tunnel IS NULL or tunnel != 'culvert')
AND name IS NOT NULL
ORDER BY COALESCE(layer,0)
Expand Down
17 changes: 17 additions & 0 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,23 @@
}
}

.water-lines-text {
[natural = 'strait'][zoom >= 5] {
text-name: "[name]";
text-size: 12;
text-face-name: @oblique-fonts;
text-fill: @water-text;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-spacing: 800;
text-placement: line;
text-repeat-distance: 400;
text-min-path-length: 100;
text-margin: 5;
[zoom >= 14] { text-size: 15; }
}
}

.text-low-zoom[zoom < 10],
.text[zoom >= 10] {
[feature = 'natural_water'],
Expand Down

0 comments on commit 54bfec6

Please sign in to comment.