From 693114b3d6c29a13d01a1eebd71e3821764560ad Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Fri, 28 Mar 2025 23:16:12 +0100 Subject: [PATCH] Theme(street_lighting): Add utility poles (#1642) --- assets/layers/street_lamps/street_lamps.json | 58 ++++++++++++- assets/layers/utility_pole/license_info.json | 10 +++ assets/layers/utility_pole/utility_pole.json | 65 +++++++++++++++ assets/layers/utility_pole/utility_pole.svg | 82 +++++++++++++++++++ .../utility_pole/utility_pole.svg.license | 2 + .../street_lighting/street_lighting.json | 13 +++ .../street_lighting_assen.json | 10 ++- 7 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 assets/layers/utility_pole/license_info.json create mode 100644 assets/layers/utility_pole/utility_pole.json create mode 100644 assets/layers/utility_pole/utility_pole.svg create mode 100644 assets/layers/utility_pole/utility_pole.svg.license diff --git a/assets/layers/street_lamps/street_lamps.json b/assets/layers/street_lamps/street_lamps.json index ddcc1be94..0f618e813 100644 --- a/assets/layers/street_lamps/street_lamps.json +++ b/assets/layers/street_lamps/street_lamps.json @@ -82,6 +82,26 @@ ], "tagRenderings": [ "images", + { + "id": "utility_pole", + "question": { + "en": "Is this lamp mounted on a utility pole?" + }, + "mappings": [ + { + "if": "man_made=utility_pole", + "then": { + "en": "This lamp is mounted on a utility pole" + } + }, + { + "if": "man_made=", + "then": { + "en": "This lamp is not mounted on a utility pole" + } + } + ] + }, { "id": "ref", "render": { @@ -104,7 +124,10 @@ }, "freeform": { "key": "ref" - } + }, + "labels": [ + "street_lamp_question" + ] }, { "id": "support", @@ -194,6 +217,10 @@ "cs": "Toto svítidlo se montuje na stěnu pomocí kovové tyče" } } + ], + "condition": "man_made!=utility_pole", + "labels": [ + "street_lamp_question" ] }, { @@ -206,7 +233,12 @@ "ca": "Com està muntat aquest fanal al pal?", "cs": "Jak se tato lampa montuje na sloup?" }, - "condition": "support=pole", + "condition": { + "and": [ + "support=pole", + "man_made!=utility_pole" + ] + }, "mappings": [ { "if": "lamp_mount=straight_mast", @@ -230,6 +262,9 @@ "cs": "Tato lampa je umístěna na konci ohnutého stožáru" } } + ], + "labels": [ + "street_lamp_question" ] }, { @@ -376,6 +411,9 @@ "cs": "Tato lampa svítí pomocí plynu" } } + ], + "labels": [ + "street_lamp_question" ] }, { @@ -434,6 +472,9 @@ "cs": "Tato lampa vydává oranžové světlo" } } + ], + "labels": [ + "street_lamp_question" ] }, { @@ -482,6 +523,9 @@ "es": "Esta lámpara tiene 2 accesorios" } } + ], + "labels": [ + "street_lamp_question" ] }, { @@ -539,6 +583,9 @@ "cs": "Tato lampa se rozsvítí na základě požadavku (např. pomocí tlačítka)" } } + ], + "labels": [ + "street_lamp_question" ] }, { @@ -563,7 +610,10 @@ "freeform": { "key": "light:direction", "type": "direction" - } + }, + "labels": [ + "street_lamp_question" + ] } ], "deletion": {}, @@ -571,4 +621,4 @@ "enableImproveAccuracy": true, "enableRelocation": false } -} +} \ No newline at end of file diff --git a/assets/layers/utility_pole/license_info.json b/assets/layers/utility_pole/license_info.json new file mode 100644 index 000000000..4814fcc56 --- /dev/null +++ b/assets/layers/utility_pole/license_info.json @@ -0,0 +1,10 @@ +[ + { + "path": "utility_pole.svg", + "license": "CC0-1.0", + "authors": [ + "Robin van der Linde" + ], + "sources": [] + } +] \ No newline at end of file diff --git a/assets/layers/utility_pole/utility_pole.json b/assets/layers/utility_pole/utility_pole.json new file mode 100644 index 000000000..cfda46bab --- /dev/null +++ b/assets/layers/utility_pole/utility_pole.json @@ -0,0 +1,65 @@ +{ + "id": "utility_pole", + "name": { + "en": "Utility Poles" + }, + "source": { + "osmTags": "man_made=utility_pole" + }, + "title": { + "en": "Utility Pole" + }, + "description": { + "en": "Layer showing various types of utility poles." + }, + "tagRenderings": [ + { + "id": "street_lamp", + "question": { + "en": "Does this utility pole have a street lamp mounted on it?" + }, + "mappings": [ + { + "if": "highway=street_lamp", + "then": { + "en": "This utility pole has a street lamp mounted on it." + } + }, + { + "if": "highway=", + "then": { + "en": "This utility pole does not have a street lamp mounted on it." + } + } + ] + } + ], + "presets": [ + { + "tags": [ + "man_made=utility_pole" + ], + "title": { + "en": "a utility pole" + } + } + ], + "pointRendering": [ + { + "marker": [ + { + "icon": "./assets/layers/utility_pole/utility_pole.svg" + } + ], + "location": [ + "point", + "centroid" + ] + } + ], + "minzoom": 18, + "allowMove": { + "enableImproveAccuracy": true, + "enableRelocation": false + } +} \ No newline at end of file diff --git a/assets/layers/utility_pole/utility_pole.svg b/assets/layers/utility_pole/utility_pole.svg new file mode 100644 index 000000000..81c22e227 --- /dev/null +++ b/assets/layers/utility_pole/utility_pole.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + diff --git a/assets/layers/utility_pole/utility_pole.svg.license b/assets/layers/utility_pole/utility_pole.svg.license new file mode 100644 index 000000000..75299f884 --- /dev/null +++ b/assets/layers/utility_pole/utility_pole.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Robin van der Linde +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/themes/street_lighting/street_lighting.json b/assets/themes/street_lighting/street_lighting.json index 133d3536f..f4405d8b5 100644 --- a/assets/themes/street_lighting/street_lighting.json +++ b/assets/themes/street_lighting/street_lighting.json @@ -45,6 +45,19 @@ ], "layers": [ "street_lamps", + { + "builtin": "utility_pole", + "override": { + "tagRenderings+": [ + { + "builtin": "street_lamps.street_lamp_question", + "override": { + "condition": "highway=street_lamp" + } + } + ] + } + }, { "id": "lit_streets", "name": { diff --git a/assets/themes/street_lighting_assen/street_lighting_assen.json b/assets/themes/street_lighting_assen/street_lighting_assen.json index 1cca1a0ad..c4ec176d5 100644 --- a/assets/themes/street_lighting_assen/street_lighting_assen.json +++ b/assets/themes/street_lighting_assen/street_lighting_assen.json @@ -15,7 +15,13 @@ ], "hideFromOverview": true, "layers": [ - "street_lamps", + { + "builtin": "street_lamps", + "hideTagRenderingsWithLabels": [ + "utility_pole" + ], + "override": {} + }, { "id": "assen", "name": "Dataset Assen", @@ -76,4 +82,4 @@ } } ] -} +} \ No newline at end of file