Browse Source

Merge branch 'buildings'

pedestrian
parent
commit
1daa424037
  1. 25
      buildings-entrances.json
  2. 38
      buildings-figure-ground.json
  3. 104
      buildings-height.json
  4. 120
      buildings-start_date.json
  5. 239
      buildings-type.json
  6. 46
      buildings.json

25
buildings-entrances.json

@ -0,0 +1,25 @@
{
"type": "overpass",
"name": {
"de": "Eingänge",
"en": "Entrances"
},
"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": ""
}
}

38
buildings-figure-ground.json

@ -0,0 +1,38 @@
{
"type": "overpass",
"name": {
"de": "Schwarzplan",
"en": "Figure-ground diagram"
},
"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"
}
}
}

104
buildings-height.json

@ -0,0 +1,104 @@
{
"type": "overpass",
"name": {
"de": "Gebäudehöhen",
"en": "Building height"
},
"query": {
"16": [
"(",
" way[building];",
" relation[building];",
")"
]
},
"feature": {
"pre": [
"{% if tags.height is defined %}",
"{% set approxHeight = tags.height %}",
"{% 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.height is defined %}",
"{{ tags.height }}m",
"{% endif %}",
"",
"{% if attribute(tags, 'building:levels') is defined %}",
"{{ 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": [
"<div style='display: inline-block'>",
"{{ tagTrans('height') }}",
"<table>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
"{% for i in range(0, 50, 10) %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": i }))|raw }}</td>",
" <td>{{ i }}m</td>",
" </tr>",
"{% endfor %}",
"{% for i in range(100, 250, 50) %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": i }))|raw }}</td>",
" <td>{{ i }}m</td>",
" </tr>",
"{% endfor %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"height\": \"300\" }))|raw }}</td>",
" <td>≥300m</td>",
" </tr>",
"</table>",
"</div>",
"",
"<div style='display: inline-block'>",
"{{ tagTrans('building:levels') }}",
"<table>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
"{% for i in range(0, 12, 3) %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": i }))|raw }}</td>",
" <td>{{ i }}</td>",
" </tr>",
"{% endfor %}",
"{% for i in range(15, 84, 15) %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": i }))|raw }}</td>",
" <td>{{ i }}</td>",
" </tr>",
"{% endfor %}",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"building:levels\": \"85\" }))|raw }}</td>",
" <td>≥85</td>",
" </tr>",
"</table>",
"",
"</div>"
]
}

120
buildings-start_date.json

@ -0,0 +1,120 @@
{
"type": "overpass",
"name": {
"en": "Building age",
"de": "Gebäudealter"
},
"query": {
"16": [
"(",
" way[building];",
" relation[building];",
")"
]
},
"feature": {
"pre": [
"{% if tags.start_date %}",
" {% set value = tags.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.start_date %}",
"{{ tags.start_date }}",
"{% endif %}"
],
"markerSymbol": null,
"listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}",
"priority": [
"{% set p = 100 %}",
"{% if tags.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": [
"<table>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1400\" }))|raw }}</td>",
" <td>&lt;1500</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1500\" }))|raw }}</td>",
" <td>1500</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1600\" }))|raw }}</td>",
" <td>1600</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1700\" }))|raw }}</td>",
" <td>1700</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1800\" }))|raw }}</td>",
" <td>1800</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1900\" }))|raw }}</td>",
" <td>1900</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1950\" }))|raw }}</td>",
" <td>1950</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2000\" }))|raw }}</td>",
" <td>2000</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2020\" }))|raw }}</td>",
" <td>2020</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"xxx\" }))|raw }}</td>",
" <td>unparseable start_date</td>",
" </tr>",
" <tr>",
" <td>{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}</td>",
" <td>no start_date</td>",
" </tr>",
"</table>"
]
}

239
buildings-type.json

@ -0,0 +1,239 @@
{
"type": "overpass",
"name": {
"de": "Gebäudearten",
"en": "Building types"
},
"query": {
"16": [
"(",
" way[building][building!=no];",
" relation[building][building!=no];",
")"
]
},
"feature": {
"pre": [
"{% set type = tags.building|split(';')[0] %}",
"{% 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' %}",
"{{ keyTrans('building') }}",
"{% else %}",
"{{ tagTransList('building', tags.building) }}",
"{% endif %}",
"{% if tags.building == 'construction' and tags.construction %}",
"({{ tagTransList('building', tags.construction) }})",
"{% 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": [
"<table>",
"{% for cat, data in const %}",
" <tr>",
" <td valign='top'>{{ markerPolygon({ \"fillColor\": data.color, \"fillOpacity\": \"0.8\", \"width\": 1, \"color\": \"#000000\" })|raw }}</td>",
" <td onclick='this.classList.toggle(\"infoShowDetails\")'><b>{{ trans(data.name) }}</b><span class='details'>:",
" {% for i, type in data.types %}<span title='building={{ type }}'>{% if i > 0 %}, {% endif %}{{ tagTrans('building', type) }}</span>{% endfor %}",
" </span>",
"<span class='summary'><i class=\"fa fa-info-circle\" aria-hidden=\"true\"></i></span>",
" </td>",
" </tr>",
"{% endfor %}",
"</table>"
],
"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:landuse=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:military",
"color": "#4a7300",
"types": [
"bunker"
]
},
"unspecified": {
"name": "tag:building=generic",
"color": "#7f7f7f",
"types": [
"yes",
"generic"
]
},
"other": {
"name": "other",
"color": "#ff0000",
"types": []
}
}
}

46
buildings.json

@ -1,5 +1,5 @@
{
"type": "overpass",
"type": "index",
"name": {
"de": "Gebäude",
"en": "Buildings",
@ -8,33 +8,21 @@
"pt": "Edifícios",
"pt-br": "Edificações"
},
"query": {
"16": [
"(",
" way[building];",
" relation[building];",
")"
]
},
"feature": {
"markerSymbol": null,
"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": "#000000"
"subCategories": [
{
"id": "buildings-type"
},
{
"id": "buildings-figure-ground"
},
{
"id": "buildings-height"
},
{
"id": "buildings-start_date"
},
{
"id": "buildings-entrances"
}
}
]
}
Loading…
Cancel
Save