Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Indoor rendering #3364

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2864,6 +2864,24 @@
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}

[feature = 'indoor_corridor'][zoom >= 18][way_area >= 150],
[feature = 'indoor_room'][zoom >= 18][way_area >= 150],
[feature = 'indoor_area'][zoom >= 18][way_area >= 150],
[feature = 'indoor_corridor'][zoom >= 19][way_area >= 50],
[feature = 'indoor_room'][zoom >= 19][way_area >= 50],
[feature = 'indoor_area'][zoom >= 19][way_area >= 50] {
text-name: "[name]";
text-size: 9;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-fill: @indoor-text;
text-dy: 0;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}
}

#amenity-line {
Expand Down
26 changes: 26 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%);

@indoor-text: darken(@building-fill, 40%);

@entrance-permissive: darken(@building-line, 15%);
@entrance-normal: @building-line;

Expand Down Expand Up @@ -39,6 +41,30 @@
}
}

#indoor-areas {
[zoom >= 17] {
[indoor = 'room'] {
polygon-fill: lighten(@building-fill, 3%);
polygon-clip: false;
line-width: 0.5;
line-clip: false;
line-color: @building-line;
}
[indoor = 'corridor'] {
polygon-fill: lighten(@building-fill, 6%);
polygon-clip: false;
line-width: 0.5;
line-clip: false;
line-color: @building-line;
}
[indoor = 'area'] {
line-width: 0.5;
line-clip: false;
line-color: @building-line;
}
}
}

#bridge {
[zoom >= 12] {
polygon-fill: #B8B8B8;
Expand Down
1 change: 1 addition & 0 deletions openstreetmap-carto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local polygon_keys = {
'building:part',
'harbour',
'historic',
'indoor',
'landuse',
'leisure',
'man_made',
Expand Down
25 changes: 25 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,25 @@ Layer:
AS buildings_major
properties:
minzoom: 13
- id: indoor-areas
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,
tags->'level' AS level,
tags->'indoor' AS indoor
FROM planet_osm_polygon
WHERE tags->'indoor' IN ('corridor', 'room', 'area')
AND (tags->'level' IS NULL OR tags->'level' = '0')
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC)
AS indoor_areas
properties:
minzoom: 17
- id: tunnels
class: access
geometry: linestring
Expand Down Expand Up @@ -1519,6 +1538,7 @@ Layer:
tags->'tower:type' as "tower:type",
tags->'castle_type' as castle_type,
tags->'information' as information,

CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', 'books', 'butcher', 'clothes', 'computer',
'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist',
'garden_centre', 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet',
Expand Down Expand Up @@ -1961,6 +1981,7 @@ Layer:
name
FROM planet_osm_line
WHERE highway IN ('bridleway', 'footway', 'cycleway', 'path', 'track', 'steps')
OR (highway IN ('corridor') AND (tags->'level' = '0' OR tags->'level' IS NULL))
AND name IS NOT NULL
) AS paths_text_name
properties:
Expand Down Expand Up @@ -2086,6 +2107,7 @@ Layer:
'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END,
'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END,
'waterway_' || CASE WHEN waterway IN ('dam', 'dock') THEN waterway ELSE NULL END,
'indoor_' || CASE WHEN tags->'indoor' IN ('corridor', 'room', 'area') THEN tags->'indoor' ELSE NULL END,
'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END
) AS feature,
access,
Expand Down Expand Up @@ -2113,6 +2135,8 @@ Layer:
tags->'recycling_type' as recycling_type,
tags->'castle_type' as castle_type,
tags->'information' as information,
tags->'indoor' as indoor,
tags->'level' as level,
ref,
way_area,
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building
Expand All @@ -2134,6 +2158,7 @@ Layer:
OR military IN ('danger_area', 'bunker')
OR historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate')
OR tags->'memorial' IN ('plaque')
OR (tags->'indoor' IN ('corridor', 'room', 'area') AND (tags->'level' = '0' OR tags->'level' IS NULL))
OR highway IN ('services', 'rest_area', 'bus_stop', 'elevator')
OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation')
OR boundary IN ('national_park')
Expand Down
14 changes: 14 additions & 0 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,20 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
text-dy: 9;
}
}

[highway = 'corridor'] {
[zoom >= 18] {
text-name: "[name]";
text-size: 9;
text-face-name: @book-fonts;
text-fill: @indoor-text;
text-spacing: 300;
text-clip: false;
text-placement: line;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
}
}

.directions::directions {
Expand Down