Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runway and taxiway rendering rework #4607

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
53 changes: 43 additions & 10 deletions project.mml
Expand Up @@ -40,6 +40,7 @@ Stylesheet:
- style/water-features.mss
- style/road-colors-generated.mss
- style/roads.mss
- style/aeroways.mss
- style/power.mss
- style/placenames.mss
- style/buildings.mss
Expand Down Expand Up @@ -779,16 +780,14 @@ Layer:
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL)
AND (covered NOT IN ('yes') OR covered IS NULL))
THEN railway END)),
(('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway END))
THEN railway END))
) AS feature
FROM planet_osm_polygon
WHERE highway IN ('pedestrian', 'footway', 'service', 'living_street', 'platform', 'services')
OR (railway IN ('platform')
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL)
AND (covered NOT IN ('yes') OR covered IS NULL))
OR aeroway IN ('runway', 'taxiway', 'helipad')
ORDER BY COALESCE(layer,0), way_area desc
) AS highway_area_fill
properties:
Expand Down Expand Up @@ -1010,6 +1009,20 @@ Layer:
AS entrances
properties:
minzoom: 18
- id: aeroway-area-fill
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
aeroway
FROM planet_osm_polygon
WHERE aeroway IN ('helipad')
) AS aeroway_area_fill
properties:
minzoom: 11
- id: aeroways
geometry: linestring
<<: *extents
Expand All @@ -1019,6 +1032,7 @@ Layer:
(SELECT
way,
aeroway,
tags->'runway' AS runway,
bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') AS bridge
FROM planet_osm_line
WHERE aeroway IN ('runway', 'taxiway')
Expand Down Expand Up @@ -1703,6 +1717,30 @@ Layer:
) AS power_towers
properties:
minzoom: 14
- id: aeroway-ref
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
aeroway,
ref
FROM planet_osm_line
WHERE ref IS NOT NULL
AND (aeroway = 'taxiway'
OR (aeroway = 'runway'
AND NOT tags @> 'runway=>displaced_threshold'))
ORDER BY CASE aeroway
WHEN 'runway' THEN 2
WHEN 'taxiway' THEN 1
END DESC,
ref,
osm_id
) AS aeroway_ref
properties:
minzoom: 15
- id: roads-text-ref-low-zoom
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1773,13 +1811,10 @@ Layer:
SELECT
osm_id,
way,
COALESCE(
CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') THEN highway END,
CASE WHEN aeroway IN ('runway', 'taxiway') THEN aeroway END
) AS highway,
highway,
string_to_array(ref, ';') AS refs
FROM planet_osm_line
WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') OR aeroway IN ('runway', 'taxiway'))
WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary')
AND ref IS NOT NULL
) AS p) AS q
WHERE height <= 4 AND width <= 11
Expand All @@ -1790,8 +1825,6 @@ Layer:
WHEN highway = 'primary' THEN 36
WHEN highway = 'secondary' THEN 35
WHEN highway = 'tertiary' THEN 34
WHEN highway = 'runway' THEN 6
WHEN highway = 'taxiway' THEN 5
END DESC NULLS LAST,
height DESC,
width DESC,
Expand Down
121 changes: 121 additions & 0 deletions style/aeroways.mss
@@ -0,0 +1,121 @@
@aeroway-fill: #babacb; // lch(76,9,290)
@aeroway-center: #e2e2e9; // lch(90,4,270)
@aeroway-text: #f3f3f7; // lch(96,2,270)
@aeroway-text-halo: #75758a; // lch(50,12,270)

#aeroway-ref {
[aeroway = 'runway'] {
[zoom >= 15] {
text-name: "[ref]";
text-size: 12;
text-fill: @aeroway-text;
text-halo-fill: @aeroway-text-halo;
text-spacing: 0;
text-clip: false;
text-placement: line;
text-face-name: @bold-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @minor-highway-text-repeat-distance;
[zoom >= 16] { text-size: 18; }
[zoom >= 17] { text-size: 24; }
[zoom >= 18] { text-size: 32; }
[zoom >= 19] { text-size: 40; }
}
}
[aeroway = 'taxiway'] {
[zoom >= 16] {
text-name: "[ref]";
text-size: 10;
text-fill: @aeroway-text;
text-spacing: 0;
text-clip: false;
text-placement: line;
text-face-name: @bold-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @aeroway-text-halo;
text-repeat-distance: @minor-highway-text-repeat-distance;
}
}
}

#aeroway-area-fill {
[aeroway = 'helipad'][zoom >= 16] {
polygon-fill: @aeroway-fill;
}
}

#aeroways {
[aeroway = 'runway'] {
[zoom >= 11] {
::casing[bridge = true][zoom >= 14] {
line-width: 9 + 2*@major-casing-width-z14;
line-color: @bridge-casing;
line-join: round;
[zoom >= 15] { line-width: 13.5 + 2*@major-casing-width-z15; }
[zoom >= 16] { line-width: 20 + 2*@major-casing-width-z16; }
[zoom >= 17] { line-width: 30 + 2*@major-casing-width-z17; }
[zoom >= 18] { line-width: 46 + 2*@major-casing-width-z18; }
[zoom >= 19] { line-width: 68 + 2*@major-casing-width-z19; }
}
::fill {
line-color: @aeroway-fill;
line-width: 2;
[zoom >= 12] { line-width: 4; }
[zoom >= 13] { line-width: 6; }
[zoom >= 14] { line-width: 9; }
[zoom >= 15] { line-width: 13.5; }
[zoom >= 16] { line-width: 20; }
[zoom >= 17] { line-width: 30; }
[zoom >= 18] { line-width: 46; }
[zoom >= 19] { line-width: 68; }
}
::center[runway != 'displaced_threshold'][zoom >= 15] {
line-color: @aeroway-center;
line-width: 1.5;
line-dasharray: 12,8;
[zoom >= 16] {
line-width: 2;
line-dasharray: 21,14;
}
[zoom >= 17] {
line-width: 3.3;
line-dasharray: 42,28;
}
[zoom >= 18] {
line-width: 4.5;
line-dasharray: 84,56;
}
[zoom >= 19] {
line-width: 6;
line-dasharray: 168,112;
}
}
}
}
[aeroway = 'taxiway'] {
[zoom >= 11] {
::casing[bridge = true][zoom >= 14] {
line-width: 3 + 2*@secondary-casing-width-z14;
line-color: @bridge-casing;
line-join: round;
[zoom >= 15] { line-width: 4.5 + 2*@secondary-casing-width-z15; }
[zoom >= 16] { line-width: 6.8 + 2*@secondary-casing-width-z16; }
[zoom >= 17] { line-width: 10.1 + 2*@secondary-casing-width-z17; }
[zoom >= 18] { line-width: 15.2 + 2*@secondary-casing-width-z18; }
[zoom >= 19] { line-width: 23.8 + 2*@secondary-casing-width-z19; }
}
::fill {
line-color: @aeroway-fill ;
line-width: 1.3;
[zoom >= 13] { line-width: 2; }
[zoom >= 14] { line-width: 3; }
[zoom >= 15] { line-width: 4.5; }
[zoom >= 16] { line-width: 6.8; }
[zoom >= 17] { line-width: 10.1; }
[zoom >= 18] { line-width: 15.2; }
[zoom >= 19] { line-width: 23.8; }
}
}
}
}
76 changes: 0 additions & 76 deletions style/roads.mss
Expand Up @@ -17,10 +17,6 @@
@bridleway-fill-noaccess: #aaddaa;
@track-fill: #996600;
@track-fill-noaccess: #e2c5bb;
@aeroway-fill: #bbc;
@runway-fill: @aeroway-fill;
@taxiway-fill: @aeroway-fill;
@helipad-fill: @aeroway-fill;
@access-marking: #eaeaea;
@access-marking-living-street: #cccccc;

Expand Down Expand Up @@ -2728,18 +2724,6 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
polygon-gamma: 0.65;
}
}

[feature = 'aeroway_runway'][zoom >= 11] {
polygon-fill: @runway-fill;
}

[feature = 'aeroway_taxiway'][zoom >= 13] {
polygon-fill: @taxiway-fill;
}

[feature = 'aeroway_helipad'][zoom >= 16] {
polygon-fill: @helipad-fill;
}
}

#junctions {
Expand Down Expand Up @@ -2961,51 +2945,6 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}
}

#aeroways {
[aeroway = 'runway'] {
[zoom >= 11] {
::casing[bridge = true][zoom >= 14] {
line-width: 12 + 2*@major-casing-width-z14;
line-color: @bridge-casing;
line-join: round;
[zoom >= 15] { line-width: 18 + 2*@major-casing-width-z15; }
[zoom >= 16] { line-width: 24 + 2*@major-casing-width-z16; }
[zoom >= 17] { line-width: 24 + 2*@major-casing-width-z17; }
[zoom >= 18] { line-width: 24 + 2*@major-casing-width-z18; }
}
::fill {
line-color: @runway-fill;
line-width: 2;
[zoom >= 12] { line-width: 4; }
[zoom >= 13] { line-width: 6; }
[zoom >= 14] { line-width: 12; }
[zoom >= 15] { line-width: 18; }
[zoom >= 16] { line-width: 24; }
}
}
}
[aeroway = 'taxiway'] {
[zoom >= 11] {
::casing[bridge = true][zoom >= 14] {
line-width: 4 + 2*@secondary-casing-width-z14;
line-color: @bridge-casing;
line-join: round;
[zoom >= 15] { line-width: 6 + 2*@secondary-casing-width-z15; }
[zoom >= 16] { line-width: 8 + 2*@secondary-casing-width-z16; }
[zoom >= 17] { line-width: 8 + 2*@secondary-casing-width-z17; }
[zoom >= 18] { line-width: 8 + 2*@secondary-casing-width-z18; }
}
::fill {
line-color: @taxiway-fill ;
line-width: 1;
[zoom >= 13] { line-width: 2; }
[zoom >= 14] { line-width: 4; }
[zoom >= 15] { line-width: 6; }
[zoom >= 16] { line-width: 8; }
}
}
}
}

#roads-text-ref-low-zoom[zoom < 13] {
[highway = 'motorway'][zoom >= 10],
Expand Down Expand Up @@ -3128,21 +3067,6 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}
}
}
[highway = 'runway'],
[highway = 'taxiway'] {
[zoom >= 15] {
text-name: "[refs]";
text-size: 10;
text-fill: #333;
text-spacing: 750;
text-clip: false;
text-placement: line;
text-face-name: @oblique-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-repeat-distance: @minor-highway-text-repeat-distance;
}
}
}

#roads-text-ref-minor {
Expand Down