From a0e1ccaa73309c27936e787491b10b9967b58335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 26 Dec 2023 07:51:04 +0100 Subject: [PATCH 1/3] Buildings/*: convert all categories to YAML --- buildings-entrances.json | 27 ---- buildings-entrances.yaml | 14 ++ buildings-figure-ground.json | 40 ------ buildings-figure-ground.yaml | 26 ++++ buildings-height.json | 127 ------------------ buildings-height.yaml | 113 ++++++++++++++++ buildings-start_date.json | 165 ------------------------ buildings-start_date.yaml | 147 +++++++++++++++++++++ buildings-type.json | 243 ----------------------------------- buildings-type.yaml | 201 +++++++++++++++++++++++++++++ 10 files changed, 501 insertions(+), 602 deletions(-) delete mode 100644 buildings-entrances.json create mode 100644 buildings-entrances.yaml delete mode 100644 buildings-figure-ground.json create mode 100644 buildings-figure-ground.yaml delete mode 100644 buildings-height.json create mode 100644 buildings-height.yaml delete mode 100644 buildings-start_date.json create mode 100644 buildings-start_date.yaml delete mode 100644 buildings-type.json create mode 100644 buildings-type.yaml diff --git a/buildings-entrances.json b/buildings-entrances.json deleted file mode 100644 index 513cef0..0000000 --- a/buildings-entrances.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "overpass", - "name": { - "de": "Eingänge", - "en": "Entrances", - "fr": "Entrées", - "pt-br": "Acessos" - }, - "query": { - "16": [ - "(", - " node[entrance];", - " node[building=entrance];", - ")" - ] - }, - "feature": { - "description": [ - "{% if tags.entrance == 'yes' or (not tags.entrance and tags.building == 'entrance') %}", - "{{ keyTrans('entrance') }}", - "{% else %}", - "{{ tagTrans('entrance', tags.entrance) }}", - "{% endif %}" - ], - "styles": "" - } -} diff --git a/buildings-entrances.yaml b/buildings-entrances.yaml new file mode 100644 index 0000000..6f100c3 --- /dev/null +++ b/buildings-entrances.yaml @@ -0,0 +1,14 @@ +query: + 16: |- + ( + node[entrance]; + node[building=entrance]; + ) +feature: + description: |- + {% if tags.entrance == 'yes' or (not tags.entrance and tags.building == 'entrance') %} + {{ keyTrans('entrance') }} + {% else %} + {{ tagTrans('entrance', tags.entrance) }} + {% endif %} + styles: '' diff --git a/buildings-figure-ground.json b/buildings-figure-ground.json deleted file mode 100644 index 72a3ae6..0000000 --- a/buildings-figure-ground.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "overpass", - "name": { - "de": "Schwarzplan", - "en": "Figure-ground diagram", - "fr": "Empreintes", - "pt-br": "Cheios e vazios" - }, - "query": { - "16": [ - "(", - " way[building];", - " relation[building];", - ")" - ] - }, - "feature": { - "markerSymbol": "", - "listMarkerSymbol": "{{ markerPolygon({fillColor: \"#000000\", fillOpacity: 1 })|raw }}", - "priority": [ - "{% set p = 100 %}", - "{% if tags.name %}{% set p = p - 10 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", - "{% if tags.culture %}{% set p = p - 1 %}{% endif %}", - "{% if tags.highway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.railway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}", - "{{ p }}" - ], - "style": { - "width": "0", - "color": "#000000", - "fillColor": "#000000", - "fillOpacity": "1" - } - } -} diff --git a/buildings-figure-ground.yaml b/buildings-figure-ground.yaml new file mode 100644 index 0000000..28cef2f --- /dev/null +++ b/buildings-figure-ground.yaml @@ -0,0 +1,26 @@ +query: + 16: |- + ( + way[building]; + relation[building]; + ) +feature: + markerSymbol: '' + listMarkerSymbol: '{{ markerPolygon({fillColor: "#000000", fillOpacity: 1 })|raw }}' + priority: |- + {% set p = 100 %} + {% if tags.name %}{% set p = p - 10 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.historic %}{% set p = p - 1 %}{% endif %} + {% if tags.culture %}{% set p = p - 1 %}{% endif %} + {% if tags.highway %}{% set p = p - 1 %}{% endif %} + {% if tags.railway %}{% set p = p - 1 %}{% endif %} + {% if tags.aeroway %}{% set p = p - 1 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.tourism %}{% set p = p - 1 %}{% endif %} + {{ p }} + style: + width: 0 + color: '#000000' + fillColor: '#000000' + fillOpacity: 1 diff --git a/buildings-height.json b/buildings-height.json deleted file mode 100644 index a29e75e..0000000 --- a/buildings-height.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "type": "overpass", - "name": { - "de": "Gebäudehöhen", - "en": "Building height", - "fr": "Hauteur", - "pt-br": "Altura" - }, - "query": { - "16": [ - "(", - " way[building];", - " relation[building];", - ")" - ] - }, - "feature": { - "pre": [ - "{% if tags.height is defined %}", - "{% set approxHeight = tags.height %}", - "{% set m = tags.height|matches('(.*)\\s*(m|ft)$') %}", - "{% if m and m[2] == 'm' %}{% set approxHeight = m[1] %}{% endif %}", - "{% if m and m[2] == 'ft' %}{% set approxHeight = m[1] / 3.2808 %}{% endif %}", - "{% elseif attribute(tags, 'building:levels') is defined %}", - "{% set approxHeight = attribute(tags, 'building:levels') * 3.5 %}", - "{% endif %}", - "", - "{% if approxHeight <= 50 %}", - "{% set color = colorInterpolate(['green', 'red'], approxHeight / 50) %}", - "{% elseif approxHeight %}", - "{% set color = colorInterpolate(['red', 'yellow'], (approxHeight - 50) / 250) %} ", - "{% else %}", - "{% set color = '#7f7f7f' %}", - "{% endif %}" - ], - "description": [ - "{% if tags.building == 'yes' and tags.military %}", - "{{ tagTrans('building', 'military') }}", - "{% elseif tags.building == 'yes' %}", - "{{ keyTrans('building') }}", - "{% else %}", - "{{ tagTransList('building', tags.building) }}", - "{% endif %}", - "{% if tags.building == 'construction' and tags.construction %}", - "({{ tagTransList('building', tags.construction) }})", - "{% endif %}", - "{% if tags.building in [ 'yes', 'military' ] and tags.military %}", - "({{ tagTransList('military', tags.military) }})", - "{% endif %}" - ], - "details": [ - "{% if tags.height is defined %}", - " {% if tags.height|matches('(m|ft)$') %}{{ tags.height -}}", - " {% else %}{{ tags.height }} m", - " {%- endif -%}", - "{% endif -%}", - "", - "{%- if attribute(tags, 'building:levels') is defined -%}", - "{%- if tags.height is defined %}, {% endif %}", - "{{ attribute(tags, 'building:levels') }} {{ keyTrans('building:levels') }}", - "{% endif %}" - ], - "markerSymbol": null, - "listMarkerSymbol": "{{ markerPolygon({\"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}", - "priority": "{{ (approxHeight|default(0)) * -1 }}", - "style": { - "width": "1", - "color": "#000000", - "fillColor": "{{ color }}", - "fillOpacity": "1" - } - }, - "info": [ - "
", - "{{ tagTrans('height') }}", - "", - " ", - " ", - " ", - " ", - "{% for i in range(0, 50, 10) %}", - " ", - " ", - " ", - " ", - "{% endfor %}", - "{% for i in range(100, 250, 50) %}", - " ", - " ", - " ", - " ", - "{% endfor %}", - " ", - " ", - " ", - " ", - "
{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}{{ trans('unknown') }}
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": i }))|raw }}{{ i }}m
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": i }))|raw }}{{ i }}m
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": \"300\" }))|raw }}≥300m
", - "
", - "", - "
", - "{{ tagTrans('building:levels') }}", - "", - " ", - " ", - " ", - " ", - "{% for i in range(0, 12, 3) %}", - " ", - " ", - " ", - " ", - "{% endfor %}", - "{% for i in range(15, 84, 15) %}", - " ", - " ", - " ", - " ", - "{% endfor %}", - " ", - " ", - " ", - " ", - "
{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}{{ trans('unknown') }}
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": i }))|raw }}{{ i }}
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": i }))|raw }}{{ i }}
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": \"85\" }))|raw }}≥85
", - "", - "
" - ] -} diff --git a/buildings-height.yaml b/buildings-height.yaml new file mode 100644 index 0000000..69399a6 --- /dev/null +++ b/buildings-height.yaml @@ -0,0 +1,113 @@ +query: + 16: |- + ( + way[building]; + relation[building]; + ) +feature: + pre: |- + {% if tags.height is defined %} + {% set approxHeight = tags.height %} + {% set m = tags.height|matches('(.*)\s*(m|ft)$') %} + {% if m and m[2] == 'm' %}{% set approxHeight = m[1] %}{% endif %} + {% if m and m[2] == 'ft' %}{% set approxHeight = m[1] / 3.2808 %}{% endif %} + {% elseif attribute(tags, 'building:levels') is defined %} + {% set approxHeight = attribute(tags, 'building:levels') * 3.5 %} + {% endif %} + + {% if approxHeight <= 50 %} + {% set color = colorInterpolate(['green', 'red'], approxHeight / 50) %} + {% elseif approxHeight %} + {% set color = colorInterpolate(['red', 'yellow'], (approxHeight - 50) / 250) %} + {% else %} + {% set color = '#7f7f7f' %} + {% endif %} + description: |- + {% if tags.building == 'yes' and tags.military %} + {{ tagTrans('building', 'military') }} + {% elseif tags.building == 'yes' %} + {{ keyTrans('building') }} + {% else %} + {{ tagTransList('building', tags.building) }} + {% endif %} + {% if tags.building == 'construction' and tags.construction %} + ({{ tagTransList('building', tags.construction) }}) + {% endif %} + {% if tags.building in [ 'yes', 'military' ] and tags.military %} + ({{ tagTransList('military', tags.military) }}) + {% endif %} + details: |- + {% if tags.height is defined %} + {% if tags.height|matches('(m|ft)$') %}{{ tags.height -}} + {% else %}{{ tags.height }} m + {%- endif -%} + {% endif -%} + + {%- if attribute(tags, 'building:levels') is defined -%} + {%- if tags.height is defined %}, {% endif %} + {{ attribute(tags, 'building:levels') }} {{ keyTrans('building:levels') }} + {% endif %} + markerSymbol: null + listMarkerSymbol: |- + {{ markerPolygon({"fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }} + priority: |- + {{ (approxHeight|default(0)) * -1 }} + style: + width: 1 + color: '#000000' + fillColor: |- + {{ color }} + fillOpacity: 1 +info: |- +
+ {{ tagTrans('height') }} + + + + + + {% for i in range(0, 50, 10) %} + + + + + {% endfor %} + {% for i in range(100, 250, 50) %} + + + + + {% endfor %} + + + + +
{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}{{ trans('unknown') }}
{{ markerPolygon(evaluate({ "building": "yes", "height": i }))|raw }}{{ i }}m
{{ markerPolygon(evaluate({ "building": "yes", "height": i }))|raw }}{{ i }}m
{{ markerPolygon(evaluate({ "building": "yes", "height": "300" }))|raw }}≥300m
+
+ +
+ {{ tagTrans('building:levels') }} + + + + + + {% for i in range(0, 12, 3) %} + + + + + {% endfor %} + {% for i in range(15, 84, 15) %} + + + + + {% endfor %} + + + + +
{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}{{ trans('unknown') }}
{{ markerPolygon(evaluate({ "building": "yes", "building:levels": i }))|raw }}{{ i }}
{{ markerPolygon(evaluate({ "building": "yes", "building:levels": i }))|raw }}{{ i }}
{{ markerPolygon(evaluate({ "building": "yes", "building:levels": "85" }))|raw }}≥85
+ +
diff --git a/buildings-start_date.json b/buildings-start_date.json deleted file mode 100644 index 83da38e..0000000 --- a/buildings-start_date.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "type": "overpass", - "name": { - "de": "Gebäudealter", - "en": "Building age", - "fr": "Date de construction", - "pt-br": "Idade" - }, - "query": { - "16": [ - "(", - " way[building];", - " relation[building];", - ")" - ] - }, - "feature": { - "pre": [ - "{% set type = tags.building|split(';')[0] %}", - "{% if tags.military %}{% set type = 'military' %}{% endif %}", - "", - "{% set start_date = tags.start_date %}", - "{% if attribute(tags, 'building:start_date') %}{% set start_date = attribute(tags, 'building:start_date') %}{% endif %}", - "{# Deprecated tags #}", - "{% if not start_date and attribute(tags, 'building:age') %}{% set start_date = attribute(tags, 'building:age') %}{% endif %}", - "{% if not start_date and attribute(tags, 'building:year_built') %}{% set start_date = attribute(tags, 'building:year_built') %}{% endif %}", - "{% if not start_date and attribute(tags, 'building:buildyear') %}{% set start_date = attribute(tags, 'building:buildyear') %}{% endif %}", - "{% if not start_date and attribute(tags, 'year_built') %}{% set start_date = attribute(tags, 'year_built') %}{% endif %}", - "{% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %}", - "{% if not start_date and attribute(tags, 'year_of_construction') %}{% set start_date = attribute(tags, 'year_of_construction') %}{% endif %}", - "", - "{% if start_date %}", - " {# equalize tagging mistakes - need to add QA messages #}", - " {# convert 1910-1911 to 1910..1911 #}{% set m = start_date|matches('^(\\d{4})-(\\d{4})$') %}{% if m %}{% set start_date = m[1] ~ '..' ~ m[2] %}{% endif %}", - " {# convert 191* to 1910s #}{% set m = start_date|matches('^(\\d{3})\\*$') %}{% if m %}{% set start_date = m[1] ~ '0s' %}{% endif %}", - "", - "", - " {% set value = start_date|osmParseDate %}", - " {% if value and value[0] and value[1] %}", - " {% set value = (value[1] - value[0]) / 2 + value[0] %}", - " {% elseif value and value[0] %}", - " {% set value = value[0] %}", - " {% elseif value and value[1] %}", - " {% set value = value[1] %}", - " {% else %}", - " {% set value = 'error' %}", - " {% endif %}", - "", - " {% if value == 'error' %}", - " {% set color = '#ff0000' %}", - " {% elseif value < 1500 %}", - " {% set color = '#0000ff' %}", - " {% elseif value < 1900 %}", - " {% set color = colorInterpolate([ '#0000ff', '#ff00ff' ], (value - 1500.0) / 400) %}", - " {% elseif value < 2000 %}", - " {% set color = colorInterpolate([ '#ff00ff', '#ffff00' ], (value - 1900.0) / 100) %}", - " {% else %}", - " {% set color = colorInterpolate([ '#ffff00', '#00ff00' ], (value - 2000.0) / 50) %}", - " {% endif %}", - "{% else %}", - "{% set color = '#7f7f7f' %}", - "{% endif %}" - ], - "description": [ - "{% if tags.building == 'yes' and tags.military %}", - "{{ tagTrans('building', 'military') }}", - "{% elseif tags.building == 'yes' %}", - "{{ keyTrans('building') }}", - "{% else %}", - "{{ tagTransList('building', tags.building) }}", - "{% endif %}", - "{% if tags.building == 'construction' and tags.construction %}", - "({{ tagTransList('building', tags.construction) }})", - "{% endif %}", - "{% if tags.building in [ 'yes', 'military' ] and tags.military %}", - "({{ tagTransList('military', tags.military) }})", - "{% endif %}" - ], - "details": [ - "{% if start_date %}", - "{{ start_date|osmFormatDate({ format: 'short' }) }}", - "{% else %}", - "{{ trans('unknown') }}", - "{% endif %}" - ], - "body": [ - "" - ], - "markerSymbol": null, - "listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}", - "priority": [ - "{% set p = 100 %}", - "{% if start_date %}{% set p = p - 20 %}{% endif %}", - "{% if tags.name %}{% set p = p - 10 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", - "{% if tags.culture %}{% set p = p - 1 %}{% endif %}", - "{% if tags.highway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.railway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}", - "{{ p }}" - ], - "style": { - "width": "1", - "color": "#000000", - "fillColor": "{{ color }}", - "fillOpacity": "0.8" - } - }, - "info": [ - "", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1400\" }))|raw }}<1500
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1500\" }))|raw }}1500
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1600\" }))|raw }}1600
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1700\" }))|raw }}1700
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1800\" }))|raw }}1800
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1900\" }))|raw }}1900
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1950\" }))|raw }}1950
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2000\" }))|raw }}2000
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2020\" }))|raw }}2020
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"xxx\" }))|raw }}{{ repoTrans('date format not understood') }}
{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}{{ trans('unknown') }}
" - ] -} diff --git a/buildings-start_date.yaml b/buildings-start_date.yaml new file mode 100644 index 0000000..c53faa1 --- /dev/null +++ b/buildings-start_date.yaml @@ -0,0 +1,147 @@ +query: + 16: |- + ( + way[building]; + relation[building]; + ) +feature: + pre: |- + {% set type = tags.building|split(';')[0] %} + {% if tags.military %}{% set type = 'military' %}{% endif %} + + {% set start_date = tags.start_date %} + {% if attribute(tags, 'building:start_date') %}{% set start_date = attribute(tags, 'building:start_date') %}{% endif %} + {# Deprecated tags #} + {% if not start_date and attribute(tags, 'building:age') %}{% set start_date = attribute(tags, 'building:age') %}{% endif %} + {% if not start_date and attribute(tags, 'building:year_built') %}{% set start_date = attribute(tags, 'building:year_built') %}{% endif %} + {% if not start_date and attribute(tags, 'building:buildyear') %}{% set start_date = attribute(tags, 'building:buildyear') %}{% endif %} + {% if not start_date and attribute(tags, 'year_built') %}{% set start_date = attribute(tags, 'year_built') %}{% endif %} + {% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %} + {% if not start_date and attribute(tags, 'year_of_construction') %}{% set start_date = attribute(tags, 'year_of_construction') %}{% endif %} + + {% if start_date %} + {# equalize tagging mistakes - need to add QA messages #} + {# convert 1910-1911 to 1910..1911 #}{% set m = start_date|matches('^(\d{4})-(\d{4})$') %}{% if m %}{% set start_date = m[1] ~ '..' ~ m[2] %}{% endif %} + {# convert 191* to 1910s #}{% set m = start_date|matches('^(\d{3})\*$') %}{% if m %}{% set start_date = m[1] ~ '0s' %}{% endif %} + + + {% set value = start_date|osmParseDate %} + {% if value and value[0] and value[1] %} + {% set value = (value[1] - value[0]) / 2 + value[0] %} + {% elseif value and value[0] %} + {% set value = value[0] %} + {% elseif value and value[1] %} + {% set value = value[1] %} + {% else %} + {% set value = 'error' %} + {% endif %} + + {% if value == 'error' %} + {% set color = '#ff0000' %} + {% elseif value < 1500 %} + {% set color = '#0000ff' %} + {% elseif value < 1900 %} + {% set color = colorInterpolate([ '#0000ff', '#ff00ff' ], (value - 1500.0) / 400) %} + {% elseif value < 2000 %} + {% set color = colorInterpolate([ '#ff00ff', '#ffff00' ], (value - 1900.0) / 100) %} + {% else %} + {% set color = colorInterpolate([ '#ffff00', '#00ff00' ], (value - 2000.0) / 50) %} + {% endif %} + {% else %} + {% set color = '#7f7f7f' %} + {% endif %} + description: |- + {% if tags.building == 'yes' and tags.military %} + {{ tagTrans('building', 'military') }} + {% elseif tags.building == 'yes' %} + {{ keyTrans('building') }} + {% else %} + {{ tagTransList('building', tags.building) }} + {% endif %} + {% if tags.building == 'construction' and tags.construction %} + ({{ tagTransList('building', tags.construction) }}) + {% endif %} + {% if tags.building in [ 'yes', 'military' ] and tags.military %} + ({{ tagTransList('military', tags.military) }}) + {% endif %} + details: |- + {% if start_date %} + {{ start_date|osmFormatDate({ format: 'short' }) }} + {% else %} + {{ trans('unknown') }} + {% endif %} + body: |- + + markerSymbol: null + listMarkerSymbol: |- + {{ markerPolygon({ "fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }} + priority: |- + {% set p = 100 %} + {% if start_date %}{% set p = p - 20 %}{% endif %} + {% if tags.name %}{% set p = p - 10 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.historic %}{% set p = p - 1 %}{% endif %} + {% if tags.culture %}{% set p = p - 1 %}{% endif %} + {% if tags.highway %}{% set p = p - 1 %}{% endif %} + {% if tags.railway %}{% set p = p - 1 %}{% endif %} + {% if tags.aeroway %}{% set p = p - 1 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.tourism %}{% set p = p - 1 %}{% endif %} + {{ p }} + style: + width: 1 + color: '#000000' + fillColor: '{{ color }}' + fillOpacity: 0.8 +info: |- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1400" }))|raw }}<1500
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1500" }))|raw }}1500
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1600" }))|raw }}1600
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1700" }))|raw }}1700
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1800" }))|raw }}1800
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1900" }))|raw }}1900
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1950" }))|raw }}1950
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "2000" }))|raw }}2000
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "2020" }))|raw }}2020
{{ markerPolygon(evaluate({ "building": "yes", "start_date": "xxx" }))|raw }}{{ repoTrans('date format not understood') }}
{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}{{ trans('unknown') }}
diff --git a/buildings-type.json b/buildings-type.json deleted file mode 100644 index ea9eb4e..0000000 --- a/buildings-type.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "type": "overpass", - "name": { - "de": "Gebäudearten", - "en": "Building types", - "fr": "Type", - "pt-br": "Tipologias" - }, - "query": { - "16": "nwr[building][building!=no];" - }, - "feature": { - "pre": [ - "{% set type = tags.building|split(';')[0] %}", - "{% if tags.military %}{% set type = 'military' %}{% endif %}", - "{% set color = const.other.color %}", - "{% for cat, data in const %}", - " {% if type in data.types %}", - " {% set color = data.color %}", - " {% endif %}", - "{% endfor %}" - ], - "description": [ - "{% if tags.building == 'yes' and tags.military %}", - "{{ tagTrans('building', 'military') }}", - "{% elseif tags.building == 'yes' %}", - "{{ keyTrans('building') }}", - "{% else %}", - "{{ tagTransList('building', tags.building) }}", - "{% endif %}", - "{% if tags.building == 'construction' and tags.construction %}", - "({{ tagTransList('building', tags.construction) }})", - "{% endif %}", - "{% if tags.building in [ 'yes', 'military' ] and tags.military %}", - "({{ tagTransList('military', tags.military) }})", - "{% endif %}" - ], - "markerSymbol": "", - "listMarkerSymbol": "{{ markerPolygon({\"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}", - "priority": [ - "{% set p = 100 %}", - "{% if tags.name %}{% set p = p - 10 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", - "{% if tags.culture %}{% set p = p - 1 %}{% endif %}", - "{% if tags.highway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.railway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}", - "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", - "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}", - "{{ p }}" - ], - "style": { - "width": "1", - "color": "#000000", - "fillColor": "{{ color }}", - "fillOpacity": "0.8" - } - }, - "info": [ - "", - "{% for cat, data in const %}", - " ", - " ", - " ", - " ", - "{% endfor %}", - "
{{ markerPolygon({ \"fillColor\": data.color, \"fillOpacity\": \"0.8\", \"width\": 1, \"color\": \"#000000\" })|raw }}{{ trans(data.name) }}:", - " {% for i, type in data.types %}{% if i > 0 %}, {% endif %}{{ tagTrans('building', type) }}{% endfor %}", - " ", - "", - "
" - ], - "const": { - "residential": { - "name": "tag:building=residential", - "color": "#25a000", - "types": [ - "house", - "apartments", - "block", - "flats", - "farm", - "detached", - "dormitory", - "terrace", - "houseboat", - "bungalow", - "static_caravan", - "residential", - "semidetached_house", - "ger", - "trullo" - ] - }, - "tourism": { - "name": "tag:tourism", - "color": "#814ce2", - "types": [ - "hotel", - "ruins", - "conservatory" - ] - }, - "commercial": { - "name": "tag:building=commercial", - "color": "#ec5bcf", - "types": [ - "commercial", - "office", - "industrial", - "retail", - "supermarket", - "warehouse", - "kiosk", - "mall", - "shop" - ] - }, - "religious": { - "name": "tag:building=religious", - "color": "#af29cc", - "types": [ - "religious", - "cathedral", - "chapel", - "church", - "mosque", - "temple", - "synagogue", - "shrine", - "monastery" - ] - }, - "amenity": { - "name": "tag:amenity", - "color": "#2935cc", - "types": [ - "kindergarten", - "civic", - "government", - "hospital", - "school", - "university", - "grandstand", - "public", - "toilets", - "college" - ] - }, - "agriculture": { - "name": "tag:building=agriculture", - "color": "#92e934", - "types": [ - "bakehouse", - "barn", - "cowshed", - "farm_auxiliary", - "greenhouse", - "stable", - "sty", - "kitchen", - "slurry_tank", - "silo" - ] - }, - "industrial": { - "name": "tag:landuse=industrial", - "color": "#e2da1b", - "types": [ - "construction", - "garbage_shed", - "transformer_tower", - "service", - "water_tower", - "industrial", - "warehouse", - "storage_tank" - ] - }, - "transportation": { - "name": "tag:building=transportation", - "color": "#1bb5e2", - "types": [ - "carport", - "garage", - "garages", - "bridge", - "hangar", - "parking", - "train_station", - "transportation" - ] - }, - "sport": { - "name": "tag:sport", - "color": "#e21b66", - "types": [ - "pavilion", - "riding_hall", - "stadium", - "sports_hall" - ] - }, - "roof": { - "name": "tag:building=roof", - "color": "#afafaf7f", - "types": [ - "roof" - ] - }, - "shelter": { - "name": "tag:amenity=shelter", - "color": "#cc8725", - "types": [ - "cabin", - "hut", - "shed" - ] - }, - "military": { - "name": "tag:building=military", - "color": "#4a7300", - "types": [ - "bunker", - "military" - ] - }, - "unspecified": { - "name": "tag:building=generic", - "color": "#7f7f7f", - "types": [ - "yes", - "generic" - ] - }, - "other": { - "name": "other", - "color": "#ff0000", - "types": [] - } - } -} diff --git a/buildings-type.yaml b/buildings-type.yaml new file mode 100644 index 0000000..f68b21a --- /dev/null +++ b/buildings-type.yaml @@ -0,0 +1,201 @@ +query: + 16: nwr[building][building!=no]; +feature: + pre: |- + {% set type = tags.building|split(';')[0] %} + {% if tags.military %}{% set type = 'military' %}{% endif %} + {% set color = const.other.color %} + {% for cat, data in const %} + {% if type in data.types %} + {% set color = data.color %} + {% endif %} + {% endfor %} + description: |- + {% if tags.building == 'yes' and tags.military %} + {{ tagTrans('building', 'military') }} + {% elseif tags.building == 'yes' %} + {{ keyTrans('building') }} + {% else %} + {{ tagTransList('building', tags.building) }} + {% endif %} + {% if tags.building == 'construction' and tags.construction %} + ({{ tagTransList('building', tags.construction) }}) + {% endif %} + {% if tags.building in [ 'yes', 'military' ] and tags.military %} + ({{ tagTransList('military', tags.military) }}) + {% endif %} + markerSymbol: '' + listMarkerSymbol: |- + {{ markerPolygon({"fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }} + priority: |- + {% set p = 100 %} + {% if tags.name %}{% set p = p - 10 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.historic %}{% set p = p - 1 %}{% endif %} + {% if tags.culture %}{% set p = p - 1 %}{% endif %} + {% if tags.highway %}{% set p = p - 1 %}{% endif %} + {% if tags.railway %}{% set p = p - 1 %}{% endif %} + {% if tags.aeroway %}{% set p = p - 1 %}{% endif %} + {% if tags.amenity %}{% set p = p - 1 %}{% endif %} + {% if tags.tourism %}{% set p = p - 1 %}{% endif %} + {{ p }} + style: + width: 1 + color: '#000000' + fillColor: |- + {{ color }} + fillOpacity: 0.8 +info: |- + + {% for cat, data in const %} + + + + + {% endfor %} +
{{ markerPolygon({ "fillColor": data.color, "fillOpacity": "0.8", "width": 1, "color": "#000000" })|raw }}{{ trans(data.name) }}: + {% for i, type in data.types %}{% if i > 0 %}, {% endif %}{{ tagTrans('building', type) }}{% endfor %} + + +
+const: + residential: + name: tag:building=residential + color: '#25a000' + types: + - house + - apartments + - block + - flats + - farm + - detached + - dormitory + - terrace + - houseboat + - bungalow + - static_caravan + - residential + - semidetached_house + - ger + - trullo + tourism: + name: tag:tourism + color: '#814ce2' + types: + - hotel + - ruins + - conservatory + commercial: + name: tag:building=commercial + color: '#ec5bcf' + types: + - commercial + - office + - industrial + - retail + - supermarket + - warehouse + - kiosk + - mall + - shop + religious: + name: tag:building=religious + color: '#af29cc' + types: + - religious + - cathedral + - chapel + - church + - mosque + - temple + - synagogue + - shrine + - monastery + amenity: + name: tag:amenity + color: '#2935cc' + types: + - kindergarten + - civic + - government + - hospital + - school + - university + - grandstand + - public + - toilets + - college + agriculture: + name: tag:building=agriculture + color: '#92e934' + types: + - bakehouse + - barn + - cowshed + - farm_auxiliary + - greenhouse + - stable + - sty + - kitchen + - slurry_tank + - silo + industrial: + name: tag:landuse=industrial + color: '#e2da1b' + types: + - construction + - garbage_shed + - transformer_tower + - service + - water_tower + - industrial + - warehouse + - storage_tank + transportation: + name: tag:building=transportation + color: '#1bb5e2' + types: + - carport + - garage + - garages + - bridge + - hangar + - parking + - train_station + - transportation + sport: + name: tag:sport + color: '#e21b66' + types: + - pavilion + - riding_hall + - stadium + - sports_hall + roof: + name: tag:building=roof + color: '#afafaf7f' + types: + - roof + shelter: + name: tag:amenity=shelter + color: '#cc8725' + types: + - cabin + - hut + - shed + military: + name: tag:building=military + color: '#4a7300' + types: + - bunker + - military + unspecified: + name: tag:building=generic + color: '#7f7f7f' + types: + - 'yes' + - generic + other: + name: other + color: '#ff0000' + types: [] From 245e773638488945079f1f6581be441c0d418a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 26 Dec 2023 08:30:04 +0100 Subject: [PATCH 2/3] buildings-height: show height as label --- buildings-height.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/buildings-height.yaml b/buildings-height.yaml index 69399a6..543b6a7 100644 --- a/buildings-height.yaml +++ b/buildings-height.yaml @@ -50,6 +50,22 @@ feature: markerSymbol: null listMarkerSymbol: |- {{ markerPolygon({"fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }} + markerSign: |- + {% if map.zoom >= 18 %} + + {%- if attribute(tags, 'building:levels') is defined -%} + {{ attribute(tags, 'building:levels') }} +
+ {% endif %} + + {% if tags.height is defined %} + {% if tags.height|matches('(m|ft)$') %}({{ tags.height -}}) + {% else %}({{ tags.height }}m) + {%- endif -%} + {% endif -%} +
+ {% else %} {% endif %} + listMarkerSign: ' ' priority: |- {{ (approxHeight|default(0)) * -1 }} style: From 10d9f8e2e609b0b3b4f8320295f0960f9310521a Mon Sep 17 00:00:00 2001 From: Cybereric Date: Sun, 14 Jan 2024 14:23:15 +0000 Subject: [PATCH 3/3] Translated using Weblate (French) Currently translated at 100.0% (108 of 108 strings) Translation: OpenStreetBrowser/Main Categories Translate-URL: http://weblate.openstreetbrowser.org/projects/openstreetbrowser/main-categories/fr/ --- lang/fr.json | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lang/fr.json b/lang/fr.json index 03738e5..238c6dd 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -3,7 +3,7 @@ "category:administrative": "Zones administratives", "category:agriculture": "Agriculture", "category:alternative_amenities": "Équipement", - "category:alternative_routes": "Routes", + "category:alternative_routes": "Itinéraires", "category:buildings": "Bâtiments", "category:buildings-entrances": "Entrées", "category:buildings-figure-ground": "Empreintes", @@ -39,7 +39,7 @@ "category:law": "Services législatifs", "category:leisure": "Loisirs", "category:leisure_sport_shopping": "Vie quotidienne, loisirs et sports", - "category:memorial": "Mémoriaux & Monuments", + "category:memorial": "Mémoriaux et monuments commémoratifs", "category:military": "Équipements et zones militaires", "category:mtb-routes": "Itinéraires de VTT", "category:natural": "Éléments naturels", @@ -52,7 +52,7 @@ "category:places": "Lieux", "category:places_geo": "Lieux", "category:playgrounds": "Jeux pour enfants", - "category:post": "", + "category:post": "Poste", "category:power_routes": "Réseaux électriques", "category:pt": "Carte des transports publics", "category:pt:routes": "Lignes", @@ -92,5 +92,19 @@ "outdated feature": "Éléments obsolètes", "xmas:outdated-warning": "Cet élément n'a pas été mis à jour pour cette saison ! Veuillez vérifier son existence et régler la valeur de \"xmas:lastcheck\" à la date actuelle.", "category:climbing": "Escalade", - "category:roads": "Routes" + "category:roads": "Routes", + "category:culture-media": "Culture - Média/Wikidata", + "category:developable_areas": "Zones aménageables", + "category:developments": "Planification et construction", + "category:fixme": "Améliorez-moi", + "category:footways": "Cheminements piétonniers", + "category:heritage": "Protection patrimoniale", + "category:kerbs": "Bordures", + "category:osm-qa": "Contrôle qualité OpenStreetMap", + "category:paddling": "Pagayage", + "category:paddling_amenities": "Équipements de pagayage", + "category:paddling_hazards": "Risques en pagayage", + "category:paddling_routes": "Itinéraires en pagayage", + "category:proposals": "Propositions", + "deprecated": "Le tag %s est déprécié. Voir ici pour plus de détails." }