From 1778a7b26e4fb82614cedcfdcbc6f8b4df93f0d9 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Sun, 30 Jan 2022 16:15:58 +0100 Subject: [PATCH 1/7] added rendering of amenity=parcel_locker features --- project.mml | 6 ++- style/amenity-points.mss | 21 ++++++++++ symbols/amenity/parcel_locker.svg | 68 +++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 symbols/amenity/parcel_locker.svg diff --git a/project.mml b/project.mml index 7fb3d47227..cafdf692bb 100644 --- a/project.mml +++ b/project.mml @@ -1488,7 +1488,10 @@ Layer: 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 + THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END, + CASE + WHEN (amenity = 'parcel_locker' AND ref IS NOT NULL) + THEN ref END ) ) AS name, tags->'parking' as "parking", @@ -1509,6 +1512,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, diff --git a/style/amenity-points.mss b/style/amenity-points.mss index 85e36cca3c..a5d1e8b416 100644 --- a/style/amenity-points.mss +++ b/style/amenity-points.mss @@ -192,6 +192,27 @@ marker-clip: false; } + [feature = 'amenity_parcel_locker'] { + marker-fill: @amenity-brown; + [zoom = 17] { + marker-width: 4; + marker-line-width: 0; + } + [zoom >= 18] { + marker-file: url('symbols/amenity/parcel_locker.svg'); + marker-clip: false; + 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; + } + } + [feature = 'highway_traffic_signals'][zoom >= 17] { marker-file: url('symbols/highway/traffic_light.svg'); marker-fill: #545454; diff --git a/symbols/amenity/parcel_locker.svg b/symbols/amenity/parcel_locker.svg new file mode 100644 index 0000000000..f851a56f19 --- /dev/null +++ b/symbols/amenity/parcel_locker.svg @@ -0,0 +1,68 @@ + + + + + + +Tomasz-Wttomasz From 2002c7f4fdb56300295c7cc0bf5a493248a978d6 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Mon, 31 Jan 2022 00:26:23 +0100 Subject: [PATCH 2/7] changed how name is constructed for parcel lockers --- project.mml | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/project.mml b/project.mml index cafdf692bb..1e4813b870 100644 --- a/project.mml +++ b/project.mml @@ -1476,25 +1476,27 @@ 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') - 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' AND ref IS NOT NULL) - THEN ref END + CASE + WHEN amenity = 'parcel_locker' + THEN CONCAT(COALESCE(tags->'brand', tags->'operator', name), E'\n' || 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') + 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', From 54cc0780f7b09c2cd95c1cf9634214f614211190 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Mon, 31 Jan 2022 00:34:45 +0100 Subject: [PATCH 3/7] cleaned up SVG file --- symbols/amenity/parcel_locker.svg | 70 ++----------------------------- 1 file changed, 4 insertions(+), 66 deletions(-) diff --git a/symbols/amenity/parcel_locker.svg b/symbols/amenity/parcel_locker.svg index f851a56f19..0f6335437e 100644 --- a/symbols/amenity/parcel_locker.svg +++ b/symbols/amenity/parcel_locker.svg @@ -1,68 +1,6 @@ - + + - - - -Tomasz-Wttomasz + +Tomasz-Wttomasz From 038e0d2fb930b939b1d78bfe1a6a24f7a8495e73 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Thu, 10 Feb 2022 14:22:05 +0100 Subject: [PATCH 4/7] cleaned up svg xml --- symbols/amenity/parcel_locker.svg | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/symbols/amenity/parcel_locker.svg b/symbols/amenity/parcel_locker.svg index 0f6335437e..27461e6ddc 100644 --- a/symbols/amenity/parcel_locker.svg +++ b/symbols/amenity/parcel_locker.svg @@ -1,6 +1,4 @@ - - - - + -Tomasz-Wttomasz + + From 7ed19de1c6e5ef7da28a3b82a32499a4806e5f03 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Thu, 10 Feb 2022 14:38:36 +0100 Subject: [PATCH 5/7] refactored parcel locker style script to match formal requirements --- style/amenity-points.mss | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/style/amenity-points.mss b/style/amenity-points.mss index a5d1e8b416..9714bb143c 100644 --- a/style/amenity-points.mss +++ b/style/amenity-points.mss @@ -192,24 +192,15 @@ marker-clip: false; } - [feature = 'amenity_parcel_locker'] { + [feature = 'amenity_parcel_locker'][zoom >= 17] { marker-fill: @amenity-brown; - [zoom = 17] { + [zoom >= 17][zoom < 18] { marker-width: 4; marker-line-width: 0; } [zoom >= 18] { marker-file: url('symbols/amenity/parcel_locker.svg'); marker-clip: false; - 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; } } @@ -2989,6 +2980,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 { From 0f3cea539d95118f420e5689fc0adaa9262723f6 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Thu, 10 Feb 2022 14:45:23 +0100 Subject: [PATCH 6/7] changed concat to concat_ws --- project.mml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.mml b/project.mml index 1e4813b870..dd97a0d91f 100644 --- a/project.mml +++ b/project.mml @@ -1478,7 +1478,7 @@ Layer: way, CASE WHEN amenity = 'parcel_locker' - THEN CONCAT(COALESCE(tags->'brand', tags->'operator', name), E'\n' || ref) + THEN CONCAT_WS(E'\n', COALESCE(tags->'brand', tags->'operator', name), ref) ELSE CONCAT( name, From 0786922e47b44eb91fdbb9b009e74daf036f4479 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Mon, 18 Jul 2022 19:39:18 +0200 Subject: [PATCH 7/7] changed parcel_locker symbol to version with colour filled sides --- symbols/amenity/parcel_locker.svg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/symbols/amenity/parcel_locker.svg b/symbols/amenity/parcel_locker.svg index 27461e6ddc..c06f71c27f 100644 --- a/symbols/amenity/parcel_locker.svg +++ b/symbols/amenity/parcel_locker.svg @@ -1,4 +1,8 @@ - - - + + + + + + +