Skip to content

Commit

Permalink
Merge pull request #4107 from jeisenbe/aerialways-text
Browse files Browse the repository at this point in the history
Move aerialways and amenity-line layers text labels to text-line layer
  • Loading branch information
pnorman authored Apr 30, 2020
2 parents b65ae26 + 0c73864 commit 597d138
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 99 deletions.
13 changes: 8 additions & 5 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,7 @@ Layer:
way,
aerialway,
man_made,
tags->'substance' AS substance,
name
tags->'substance' AS substance
FROM planet_osm_line
WHERE aerialway IS NOT NULL
OR (man_made = 'pipeline'
Expand Down Expand Up @@ -1644,8 +1643,6 @@ Layer:
table: |-
(SELECT
way,
name,
layer,
COALESCE(
'highway_' || CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' END,
'leisure_' || CASE WHEN leisure IN ('slipway', 'track') THEN leisure END,
Expand Down Expand Up @@ -1984,7 +1981,7 @@ Layer:
(SELECT
way,
NULL as way_pixels,
COALESCE('man_made_' || man_made, 'waterway_' || waterway, 'natural_' || "natural") AS feature,
COALESCE('aerialway_' || aerialway, 'attraction_' || CASE WHEN tags @> 'attraction=>water_slide' THEN 'water_slide' END, 'leisure_' || leisure, 'man_made_' || man_made, 'waterway_' || waterway, 'natural_' || "natural") AS feature,
access,
name,
tags->'operator' as operator,
Expand All @@ -1993,6 +1990,12 @@ Layer:
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building
FROM planet_osm_line
WHERE (man_made IN ('pier', 'breakwater', 'groyne', 'embankment')
OR (man_made = 'pipeline'
AND tags-> 'location' IN ('overground', 'overhead', 'surface', 'outdoor')
OR bridge IN ('yes', 'aqueduct', 'cantilever', 'covered', 'trestle', 'viaduct'))
OR tags @> 'attraction=>water_slide'
OR aerialway IN ('cable_car', 'gondola', 'mixed_lift', 'goods', 'chair_lift', 'drag_lift', 't-bar', 'j-bar', 'platter', 'rope_tow', 'zip_line')
OR leisure IN ('slipway', 'track')
OR waterway IN ('dam', 'weir')
OR "natural" IN ('arete', 'cliff', 'ridge'))
AND name IS NOT NULL
Expand Down
108 changes: 39 additions & 69 deletions style/aerialways.mss
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@
dash/line-color: black;
dash/line-dasharray: 0.4,13;
dash/line-clip: false;
[zoom >= 17] {
text-name: "[name]";
text-fill: #666666;
text-size: 10;
text-dy: 4;
text-spacing: 900;
text-clip: false;
text-placement: line;
text-repeat-distance: 200;
text-margin: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
[zoom >= 19] {
text-size: 11;
text-dy: 5;
}
}
}

Expand All @@ -47,24 +29,6 @@
dash/line-color: #707070;
dash/line-dasharray: 6,25;
dash/line-clip: false;
[zoom >= 17] {
text-name: "[name]";
text-fill: #666666;
text-size: 10;
text-dy: 4;
text-spacing: 900;
text-clip: false;
text-placement: line;
text-repeat-distance: 200;
text-margin: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
[zoom >= 19] {
text-size: 11;
text-dy: 5;
}
}
}

Expand All @@ -86,24 +50,6 @@
dash/line-color: black;
dash/line-dasharray: 1,30;
dash/line-clip: false;
[zoom >= 17] {
text-name: "[name]";
text-fill: #666666;
text-size: 10;
text-dy: 4;
text-spacing: 900;
text-clip: false;
text-placement: line;
text-repeat-distance: 200;
text-margin: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
[zoom >= 19] {
text-size: 11;
text-dy: 5;
}
}
}

Expand Down Expand Up @@ -161,21 +107,8 @@
[substance = 'water'] { center/line-color: @water-color; }
[substance = 'gas'] { center/line-color: #c1c1c1; } // Lch(78,0,0)
[substance = 'oil'] { center/line-color: #cfbfa5; } // Lch(78,15,83)
text-name: "[name]";
text-fill: #666666;
text-size: 10;
text-dy: 6;
text-spacing: 900;
text-clip: false;
text-placement: line;
text-repeat-distance: 200;
text-margin: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
[zoom >= 18] {
text-dy: 7;
line/line-width: 3;
line/line-dasharray: 0,1,30,1;
dash/line-width: 5;
Expand All @@ -184,8 +117,6 @@
center/line-dasharray: 0,2,28,2;
}
[zoom >= 19] {
text-size: 11;
text-dy: 8;
line/line-width: 4;
line/line-dasharray: 0,1,36,1;
dash/line-width: 6;
Expand All @@ -196,3 +127,42 @@
}
}
}

#text-line {
[feature = 'aerialway_cable_car'],
[feature = 'aerialway_gondola'],
[feature = 'aerialway_mixed_lift'],
[feature = 'aerialway_goods'],
[feature = 'aerialway_chair_lift'],
[feature = 'aerialway_drag_lift'],
[feature = 'aerialway_t-bar'],
[feature = 'aerialway_j-bar'],
[feature = 'aerialway_platter'],
[feature = 'aerialway_rope_tow'],
[feature = 'aerialway_zip_line'],
[feature = 'man_made_pipeline'] {
[zoom >= 17] {
text-name: "[name]";
text-fill: #666666;
text-size: 10;
text-dy: 4;
text-spacing: 900;
text-clip: false;
text-placement: line;
text-repeat-distance: 200;
text-margin: 18;
text-face-name: @book-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
[zoom >= 19] {
text-size: 11;
text-dy: 5;
}
[feature = 'man_made_pipeline'] {
text-dy: 6;
[zoom >= 18] { text-dy: 7; }
[zoom >= 19] { text-dy: 8; }
}
}
}
}
54 changes: 29 additions & 25 deletions style/amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2993,19 +2993,6 @@
line-width: 1;
[zoom >= 18] { line-width: 2; }
[zoom >= 19] { line-width: 4; }

[zoom >= 19] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-fill: darken(@pitch, 40%);
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-vertical-alignment: middle;
text-repeat-distance: @waterway-text-repeat-distance;
text-dy: 8;
}
}
}

Expand All @@ -3024,21 +3011,38 @@
line-width: 1;
[zoom >= 18] { line-width: 2; }
[zoom >= 19] { line-width: 4; }
}
}
}

[zoom >= 19] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-fill: darken(@pitch, 40%);
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-vertical-alignment: middle;
text-repeat-distance: @waterway-text-repeat-distance;
text-dy: 8;
}
#text-line {
[feature = 'leisure_track'],
[feature = 'attraction_water_slide'] {
[zoom >= 19] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-fill: darken(@pitch, 40%);
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: line;
text-vertical-alignment: middle;
text-repeat-distance: @waterway-text-repeat-distance;
text-dy: 8;
}
}

[feature = 'leisure_slipway'][zoom >= 17] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-fill: @transportation-text;
text-dy: 13;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
}

#trees [zoom >= 16] {
Expand Down

0 comments on commit 597d138

Please sign in to comment.