Skip to content

Commit

Permalink
Render area:aeroway and taxiway with width
Browse files Browse the repository at this point in the history
Treat `aeroway=taxiway` the same as `aeroway=runway`, and use its width
for rendering. `area:aeroway` is rendered for values of `runway`,
`taxiway`, and `stopway`. Colours of runway, taxiway, and aeroway area
are adjusted to work well together.
  • Loading branch information
jdhoek committed Mar 15, 2021
1 parent 1ad7257 commit 42f308c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 26 deletions.
1 change: 1 addition & 0 deletions openstreetmap-carto.lua
Expand Up @@ -12,6 +12,7 @@ local polygon_keys = {
'allotments',
'amenity',
'area:highway',
'area:aeroway',
'craft',
'building',
'building:part',
Expand Down
35 changes: 31 additions & 4 deletions project.mml
Expand Up @@ -780,6 +780,31 @@ Layer:
properties:
cache-features: true
minzoom: 10
- id: aeroway-area-fill
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
CASE
WHEN surface IN ('paved', 'asphalt', 'concrete', 'concrete:lanes', 'concrete:plates', 'metal') THEN 'paved'
WHEN surface IN ('grass') THEN 'grass'
ELSE 'unpaved'
END AS int_surface,
COALESCE(
(('aeroway_' || CASE
WHEN aeroway IN ('helipad') THEN aeroway
WHEN tags->'area:aeroway' IN ('runway', 'taxiway', 'stopway') THEN tags->'area:aeroway'
END))
) AS feature
FROM planet_osm_polygon
WHERE aeroway IN ('helipad')
OR tags->'area:aeroway' IN ('runway', 'taxiway', 'stopway')
ORDER BY COALESCE(layer,0), way_area desc
) AS highway_area_fill
properties:
minzoom: 14
- id: highway-area-fill
# FIXME: No geometry?
<<: *extents
Expand All @@ -795,16 +820,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 @@ -1072,7 +1095,11 @@ Layer:
-- WHEN tags->'width' ~ '^[0-9]+"$' THEN LEFT(tags->'width', -1)::real * 0.0254
ELSE NULL
END,
20
-- Default to a small standard width for runways and a matching taxiway width.
CASE
WHEN aeroway IN ('runway') THEN 18
ELSE 7.5
END
) as width,
NULLIF(scale_factor(way)*!scale_denominator!*0.001*0.28, 0) AS sf
FROM planet_osm_line
Expand Down
75 changes: 53 additions & 22 deletions style/roads.mss
Expand Up @@ -19,23 +19,26 @@
@track-fill-noaccess: #e2c5bb;

@aeroway-fill: #bbc;
@runway-fill: @aeroway-fill;
@stopway-fill: lighten(@aeroway-fill, 5%);
@taxiway-fill: @aeroway-fill;
@helipad-fill: @aeroway-fill;
@runway-fill: #9a9ab4;
@taxiway-fill: #aaaac0;
@stopway-fill: @taxiway-fill;
@helipad-fill: @runway-fill;
@aeroway-runway-centreline: white;
@aeroway-taxiway-centreline: #f1fa4a;
@unpaved-aeroway-fill: #dcbeab;
@unpaved-runway-fill: @unpaved-aeroway-fill;
@unpaved-stopway-fill: lighten(@unpaved-aeroway-fill, 5%);
@unpaved-taxiway-fill: @unpaved-aeroway-fill;
@unpaved-runway-fill: #cb9e81;
@unpaved-taxiway-fill: #d3ae97;
@unpaved-stopway-fill: @unpaved-taxiway-fill;
@unpaved-helipad-fill: @unpaved-aeroway-fill;
@unpaved-aeroway-runway-centreline: darken(@unpaved-aeroway-fill, 10%);
@grass-aeroway-fill: #d2dcab;
@grass-runway-fill: @grass-aeroway-fill;
@grass-stopway-fill: lighten(@grass-aeroway-fill, 5%);
@grass-taxiway-fill: @grass-aeroway-fill;
@unpaved-aeroway-runway-centreline: #efdccf;
@unpaved-aeroway-taxiway-centreline: darken(@unpaved-aeroway-runway-centreline, 5%);
@grass-aeroway-fill: #dce3bd;
@grass-runway-fill: #d2dcab;
@grass-taxiway-fill: lighten(@grass-runway-fill, 2%);
@grass-stopway-fill: @grass-taxiway-fill;
@grass-helipad-fill: @grass-aeroway-fill;
@grass-aeroway-runway-centreline: darken(@grass-aeroway-fill, 10%);
@grass-aeroway-runway-centreline: @aeroway-fill;
@grass-aeroway-taxiway-centreline: @grass-aeroway-runway-centreline;

@access-marking: #eaeaea;
@access-marking-living-street: #cccccc;
Expand Down Expand Up @@ -2719,6 +2722,30 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}
}

#aeroway-area-fill {
[feature = 'aeroway_runway'][zoom >= 14] {
polygon-fill: @aeroway-fill;
[int_surface = 'unpaved'] { polygon-fill: @unpaved-aeroway-fill; }
[int_surface = 'grass'] { polygon-fill: @grass-aeroway-fill; }
}

[feature = 'aeroway_taxiway'][zoom >= 14] {
polygon-fill: @aeroway-fill;
[int_surface = 'unpaved'] { polygon-fill: @unpaved-aeroway-fill; }
[int_surface = 'grass'] { polygon-fill: @grass-aeroway-fill; }
}

[feature = 'aeroway_stopway'][zoom >= 14] {
polygon-fill: @stopway-fill;
[int_surface = 'unpaved'] { polygon-fill: @unpaved-stopway-fill; }
[int_surface = 'grass'] { polygon-fill: @grass-stopway-fill; }
}

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

#highway-area-fill {
[feature = 'highway_living_street'][zoom >= 14] {
polygon-fill: @living-street-fill;
Expand All @@ -2744,14 +2771,6 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
polygon-gamma: 0.65;
}
}

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

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

#junctions {
Expand Down Expand Up @@ -3045,11 +3064,23 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line-color: @taxiway-fill;
[int_surface = 'unpaved'] { line-color: @unpaved-taxiway-fill; }
[int_surface = 'grass'] { line-color: @grass-taxiway-fill; }
line-width: 1;
line-width: [area_width];
/*line-width: 1;
[zoom >= 13] { line-width: 2; }
[zoom >= 14] { line-width: 4; }
[zoom >= 15] { line-width: 6; }
[zoom >= 16] { line-width: 8; }
[zoom >= 17] { line-width: 12; }
[zoom >= 18] { line-width: 24; }*/
}
::centerline[zoom >= 15] {
line-color: @aeroway-taxiway-centreline;
[int_surface = 'unpaved'] { line-color: @unpaved-aeroway-taxiway-centreline; }
[int_surface = 'grass'] { line-color: @grass-aeroway-taxiway-centreline; }
line-width: 0.3;
[zoom >= 16] { line-width: 0.5; }
[zoom >= 17] { line-width: 1; }
[zoom >= 18] { line-width: 2; }
}
}
}
Expand Down

0 comments on commit 42f308c

Please sign in to comment.