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 entrance=main nodes starting at z=18 and other entrance types
defined in OSM wiki (entrance=yes|home|service|staircase) starting at z=19.

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 Jan 20, 2018
1 parent ff78bb7 commit 7691ea7
Show file tree
Hide file tree
Showing 6 changed files with 155 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
44 changes: 44 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,45 @@
polygon-fill: #B8B8B8;
}
}

#entrances {
[zoom >= 18]["entrance" != null] {
marker-fill: @entrance-normal;
marker-allow-overlap: true;
marker-ignore-placement: true;
marker-file: url('symbols/rect.svg');
marker-width: 5.0;
marker-height: 5.0;
marker-opacity: 0.0;
["entrance" = "main"] {
marker-opacity: 1.0;
marker-file: url('symbols/square.svg');
}
}
[zoom >= 19] {
["entrance" = "yes"],
["entrance" = "main"],
["entrance" = "home"],
["entrance" = "service"],
["entrance" = "staircase"] {
marker-opacity: 1.0;
marker-width: 6.0;
marker-height: 6.0;
["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');
}
}
[zoom >= 20]["entrance" != null] {
marker-width: 8.0;
marker-height: 8.0;
}
}
16 changes: 16 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,22 @@ Layer:
) AS guideways
properties:
minzoom: 11
- 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: 18
- 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 7691ea7

Please sign in to comment.