Skip to content

Commit

Permalink
Merge parcel locker rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorman committed Jul 29, 2022
2 parents 6d083e3 + 73ac794 commit 08daef1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 16 deletions.
38 changes: 22 additions & 16 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1457,23 +1457,28 @@ Layer:
FROM
(SELECT -- This subselect allows filtering on the feature column
way,
CONCAT(
name,
E'\n' || CONCAT( -- by doing this with a || if both the ele and height branches are null, this entire expression is null and only name is used
CASE
WHEN (tags ? 'ele') AND tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$'
AND ("natural" IN ('peak', 'volcano', 'saddle')
OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost')
OR (amenity = 'shelter' AND tags->'shelter_type' NOT IN ('public_transport', 'picnic_shelter'))
OR tags->'mountain_pass' = 'yes')
THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') END,
CASE
WHEN (tags ? 'height') AND tags->'height' ~ '^\d{1,3}(\.\d+)?$'
AND waterway = 'waterfall'
THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END
CASE
WHEN amenity = 'parcel_locker'
THEN CONCAT_WS(E'\n', COALESCE(tags->'brand', tags->'operator', name), ref)
ELSE
CONCAT(
name,
E'\n' || CONCAT( -- by doing this with a || if both the ele and height branches are null, this entire expression is null and only name is used
CASE
WHEN (tags ? 'ele') AND tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$'
AND ("natural" IN ('peak', 'volcano', 'saddle')
OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost')
OR (amenity = 'shelter' AND tags->'shelter_type' NOT IN ('public_transport', 'picnic_shelter'))
OR tags->'mountain_pass' = 'yes')
THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') END,
CASE
WHEN (tags ? 'height') AND tags->'height' ~ '^\d{1,3}(\.\d+)?$'
AND waterway = 'waterfall'
THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END
)
)
) AS name,
tags->'parking' as "parking",
END AS name,
tags->'parking' as "parking",
COALESCE(
'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway END,
'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'apartment', 'artwork', 'camp_site', 'caravan_site', 'chalet', 'gallery', 'guest_house',
Expand All @@ -1491,6 +1496,7 @@ Layer:
'university', 'vehicle_inspection', 'veterinary') THEN amenity END,
'amenity_' || CASE WHEN amenity IN ('waste_disposal') AND way_area IS NOT NULL THEN amenity END, -- Waste disposal points are rendered in the low priority layer
'amenity_' || CASE WHEN amenity IN ('vending_machine') AND tags->'vending' IN ('excrement_bags', 'parking_tickets', 'public_transport_tickets') THEN amenity END,
'amenity_' || CASE WHEN amenity IN ('parcel_locker') THEN amenity END,
'diplomatic_'|| CASE WHEN tags->'office' IN ('diplomatic') AND tags->'diplomatic' IN ('embassy', 'consulate') THEN tags->'diplomatic' ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' END,
'emergency_' || CASE WHEN tags->'emergency' IN ('phone') AND way_area IS NULL THEN tags->'emergency' END,
Expand Down
24 changes: 24 additions & 0 deletions style/amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@
marker-clip: false;
}

[feature = 'amenity_parcel_locker'][zoom >= 17] {
marker-fill: @amenity-brown;
[zoom >= 17][zoom < 18] {
marker-width: 4;
marker-line-width: 0;
}
[zoom >= 18] {
marker-file: url('symbols/amenity/parcel_locker.svg');
marker-clip: false;
}
}

[feature = 'highway_traffic_signals'][zoom >= 17] {
marker-file: url('symbols/highway/traffic_light.svg');
marker-fill: #545454;
Expand Down Expand Up @@ -2955,6 +2967,18 @@
[feature = 'amenity_motorcycle_parking'] { text-dy: 12; }
}
}

[feature = 'amenity_parcel_locker'][zoom >= 18] {
text-name: "[name]";
text-dy: 10;
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-fill: @amenity-brown;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
}
}

#text-low-priority {
Expand Down
8 changes: 8 additions & 0 deletions symbols/amenity/parcel_locker.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 08daef1

Please sign in to comment.