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. 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.
  • Loading branch information
tpikonen committed Nov 10, 2017
1 parent 83c5cd0 commit 77c66e2
Show file tree
Hide file tree
Showing 6 changed files with 154 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
43 changes: 43 additions & 0 deletions buildings.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down Expand Up @@ -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;
}
}
}
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
30 changes: 30 additions & 0 deletions symbols/corners.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions symbols/rect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions symbols/rectdiag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 77c66e2

Please sign in to comment.