Skip to content

Commit

Permalink
Render entrances.
Browse files Browse the repository at this point in the history
New layer "entrances", with entrance and access tags.

Render entrances starting at z=17. The "main" and "staircase" entrances
are rendered with a square marker, the "service" entrance with a circle
and other entrances with a disc.

Three levels of marker brightness reflect the access permissions of the
entrance. Darker color means more permissive access. The "main"
entrances are dark by default. The access tag modifies the brightness
such that access="yes" and "permissive" set the marker to darkest and
access=no to the lightest colour. Markers with other access tag values
have intermediate brightness.

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.
  • Loading branch information
tpikonen committed Nov 8, 2017
1 parent 83c5cd0 commit f32449b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addressing.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
55 changes: 55 additions & 0 deletions buildings.mss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
@building-major-fill: darken(@building-fill, 20%);
@building-major-line: darken(@building-major-fill, 25%);

@entrance-accessible: darken(@building-line, 15%);
@entrance-normal: @building-line;
@entrance-noaccess: lighten(@building-line, 10%);

#buildings {
[zoom >= 13] {
Expand Down Expand Up @@ -42,3 +45,55 @@
polygon-fill: #B8B8B8;
}
}

#entrances {
["entrance" != null] {
marker-fill: @entrance-normal;
marker-line-color: @entrance-normal;
marker-line-opacity: 0.0;
marker-allow-overlap: true;
marker-ignore-placement: true;
["entrance" = "main"] {
marker-file: url('symbols/square.svg');
marker-fill: @entrance-accessible;
}
["entrance" = "staircase"] {
marker-file: url('symbols/square.svg');
}
["entrance" = "service"] {
marker-fill: @building-fill;
marker-line-opacity: 1.0;
marker-line-width: 0.75;
[zoom < 18] {
marker-opacity: 0.0;
}
}
["entrance" = "exit"],["entrance" = "emergency"] {
marker-opacity: 0.0;
}
["access" = "yes"],["access" = "permissive"] {
marker-fill: @entrance-accessible;
marker-line-color: @entrance-accessible;
}
["access" = "no"] {
marker-fill: @entrance-noaccess;
marker-line-color: @entrance-noaccess;
}
[zoom >= 17] {
marker-width: 3.5;
marker-height: 3.5;
}
[zoom >= 18] {
marker-width: 5;
marker-height: 5;
}
[zoom >= 19] {
marker-width: 6.5;
marker-height: 6.5;
}
[zoom >= 20] {
marker-width: 8;
marker-height: 8;
}
}
}
16 changes: 16 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f32449b

Please sign in to comment.