From 77c66e2a34215f8c162ee50c09a6268bcc71aeb7 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Fri, 3 Nov 2017 11:44:01 +0200 Subject: [PATCH] Render entrances. New layer "entrances", with entrance and access tags. Render entrances starting at z=17. Most entrances are rendered with a hollow square marker. Entrances marked as "main" are rendered with a solid square, "service" entrances with corners of a hollow square and entrances with access="no" with a hollow square with a line along a diagonal. The marker brightness reflects the access permissions of the entrance. Entrances with access="yes" and "permissive" have a darker color. Markers with other access tag values have the same color as the building perimeter line. Exits, such as entrance=exit and entrance=emergency are not rendered. Address label text-halo-radius is increased at z>=18 to improve readability of labels on top of entrance markers. --- addressing.mss | 7 +++++-- buildings.mss | 43 +++++++++++++++++++++++++++++++++++++++++++ project.mml | 16 ++++++++++++++++ symbols/corners.svg | 30 ++++++++++++++++++++++++++++++ symbols/rect.svg | 30 ++++++++++++++++++++++++++++++ symbols/rectdiag.svg | 30 ++++++++++++++++++++++++++++++ 6 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 symbols/corners.svg create mode 100644 symbols/rect.svg create mode 100644 symbols/rectdiag.svg diff --git a/addressing.mss b/addressing.mss index 4fe3222a9c..1b3f8cd54d 100644 --- a/addressing.mss +++ b/addressing.mss @@ -34,8 +34,11 @@ text-wrap-width: 30; // 3.0 em text-line-spacing: -1.5; // -0.15 em text-margin: 3; // 0.3 em - [zoom >= 18]["addr_unit" != null]["addr_housenumber" = null] { - text-name: [addr_unit]; + [zoom >= 18] { + text-halo-radius: @standard-halo-radius * 1.25; + ["addr_unit" != null]["addr_housenumber" = null] { + text-name: [addr_unit]; + } } [zoom >= 20] { text-size: 11; diff --git a/buildings.mss b/buildings.mss index 3c5291b452..acb9026079 100644 --- a/buildings.mss +++ b/buildings.mss @@ -5,6 +5,8 @@ @building-major-fill: darken(@building-fill, 20%); @building-major-line: darken(@building-major-fill, 25%); +@entrance-permissive: darken(@building-line, 15%); +@entrance-normal: @building-line; #buildings { [zoom >= 13] { @@ -42,3 +44,44 @@ polygon-fill: #B8B8B8; } } + +#entrances { + ["entrance" != null] { + marker-fill: @entrance-normal; + marker-allow-overlap: true; + marker-ignore-placement: true; + marker-file: url('symbols/rect.svg'); + ["entrance" = "main"] { + marker-file: url('symbols/square.svg'); + } + ["entrance" = "service"] { + marker-file: url('symbols/corners.svg'); + } + ["access" = "yes"],["access" = "permissive"] { + marker-fill: @entrance-permissive; + } + ["access" = "no"] { + marker-fill: @entrance-normal; + marker-file: url('symbols/rectdiag.svg'); + } + ["entrance" = "exit"],["entrance" = "emergency"] { + marker-opacity: 0.0; + } + [zoom >= 17] { + marker-width: 4.0; + marker-height: 4.0; + } + [zoom >= 18] { + marker-width: 6; + marker-height: 6; + } + [zoom >= 19] { + marker-width: 8.0; + marker-height: 8.0; + } + [zoom >= 20] { + marker-width: 10; + marker-height: 10; + } + } +} diff --git a/project.mml b/project.mml index 2a73911086..8cb7bf6244 100644 --- a/project.mml +++ b/project.mml @@ -1068,6 +1068,22 @@ Layer: ) AS guideways properties: minzoom: 13 + - id: entrances + geometry: point + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + tags->'entrance' AS entrance, + access + FROM planet_osm_point + WHERE tags->'indoor' = 'no' + OR tags->'indoor' IS NULL) + AS entrances + properties: + minzoom: 17 - id: aeroways geometry: linestring <<: *extents diff --git a/symbols/corners.svg b/symbols/corners.svg new file mode 100644 index 0000000000..7307594a9e --- /dev/null +++ b/symbols/corners.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/symbols/rect.svg b/symbols/rect.svg new file mode 100644 index 0000000000..61e8432437 --- /dev/null +++ b/symbols/rect.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/symbols/rectdiag.svg b/symbols/rectdiag.svg new file mode 100644 index 0000000000..a75405c49e --- /dev/null +++ b/symbols/rectdiag.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + +