forked from MapComplete/MapComplete
Add special visualisation for automated actions, add missing_street-theme, various fixes
This commit is contained in:
parent
e61c25fd6e
commit
20ec12b23c
23 changed files with 1116 additions and 690 deletions
|
@ -42,14 +42,19 @@
|
|||
}
|
||||
],
|
||||
"calculatedTags": [
|
||||
"_x='y'",
|
||||
"_embedded_crab_addresses=undefined // feat.overlapWith('crab_address').length"
|
||||
"_embedded_crab_addresses= Number(feat.properties.zoom) >= 18 ? feat.overlapWith('crab_address').length : undefined"
|
||||
],
|
||||
"minZoom": 18,
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "hw",
|
||||
"render": "There are {_embedded_crab_addresses} adresses in view",
|
||||
"mappings": [{
|
||||
"mappings": [
|
||||
{
|
||||
"if": "zoom<18",
|
||||
"then": "Zoom in more..."
|
||||
},
|
||||
{
|
||||
"if": "_embedded_crab_addresses=",
|
||||
"then": "Loading..."
|
||||
},{
|
||||
|
|
|
@ -6,15 +6,5 @@
|
|||
"Pieter Vander Vennet"
|
||||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "robot.svg",
|
||||
"license": "CC-BY 4.0 International",
|
||||
"authors": [
|
||||
"Font Awesome"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Font_Awesome_5_solid_robot.svg"
|
||||
]
|
||||
}
|
||||
]
|
154
assets/themes/grb_import/missing_streets.json
Normal file
154
assets/themes/grb_import/missing_streets.json
Normal file
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
"id": "missing_streets",
|
||||
"title": {
|
||||
"nl": "GRB import helper"
|
||||
},
|
||||
"shortDescription": {
|
||||
"nl": "Grb import helper tool"
|
||||
},
|
||||
"description": {
|
||||
"nl": "Dit thema voegt semi-automatisch straatnamen toe aan gebouwen met huisnummer en overeenkomstig CRAB-adres."
|
||||
},
|
||||
"language": [
|
||||
"nl"
|
||||
],
|
||||
"maintainer": "",
|
||||
"icon": "./assets/svg/robot.svg",
|
||||
"version": "0",
|
||||
"startLat": 51.0249,
|
||||
"startLon": 4.026489,
|
||||
"startZoom": 9,
|
||||
"widenFactor": 2,
|
||||
"socialImage": "",
|
||||
"clustering": {
|
||||
"maxZoom": 15
|
||||
},
|
||||
"overrideAll": {
|
||||
"minzoom": 14
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"builtin": "current_view",
|
||||
"override": {
|
||||
"+mapRendering": [
|
||||
{
|
||||
"location": [
|
||||
"point"
|
||||
],
|
||||
"icon": {
|
||||
"render": "./assets/themes/grb_import/robot.svg"
|
||||
},
|
||||
"iconSize": "15,15,center"
|
||||
}
|
||||
],
|
||||
"calculatedTags": [
|
||||
"_overlapping=Number(feat.properties.zoom) >= 14 ? feat.overlapWith('OSM-buildings').map(ff => ff.feat.properties) : undefined",
|
||||
"_applicable=feat.get('_overlapping').filter(p => (p._spelling_is_correct === 'true') && (p._singular_import === 'true')).map(p => p.id)",
|
||||
"_applicable_count=feat.get('_applicable')?.length"
|
||||
],
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "hw",
|
||||
"render": "There are {_applicable_count} applicable elements in view",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "zoom<14",
|
||||
"then": "Zoom in more to see the automatic action"
|
||||
},
|
||||
{
|
||||
"if": "_applicable_count=",
|
||||
"then": "Loading..."
|
||||
},
|
||||
{
|
||||
"if": "_applicable_count=0",
|
||||
"then": "No buildings with missing street names in view"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "autoapply",
|
||||
"render": "{auto_apply(OSM-buildings, _applicable, apply_streetname, Automatically add all missing streetnames on buildings in view)}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"named_streets",
|
||||
{
|
||||
"builtin": "crab_address",
|
||||
"override": {
|
||||
"mapRendering": [
|
||||
{
|
||||
"iconSize": "5,5,center",
|
||||
"icon": "circle:black;"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "OSM-buildings",
|
||||
"name": "Alle OSM-gebouwen met een huisnummer en zonder straat",
|
||||
"source": {
|
||||
"osmTags": {
|
||||
"and": [
|
||||
"building~*",
|
||||
"addr:housenumber~*",
|
||||
"addr:street="
|
||||
]
|
||||
},
|
||||
"maxCacheAge": 0
|
||||
},
|
||||
"calculatedTags": [
|
||||
"_embedded_crab_addresses:=Array.from(new Set(feat.overlapWith('crab_address').map(ff => ff.feat.properties).filter(p => p._HNRLABEL.toLowerCase() === (feat.properties['addr:housenumber'] + (feat.properties['addr:unit']??'')).toLowerCase()).map(p => p.STRAATNM)))",
|
||||
"_singular_import:=feat.get('_embedded_crab_addresses')?.length == 1",
|
||||
"_name_to_apply:=feat.get('_embedded_crab_addresses')[0]",
|
||||
"_nearby_street_names:=feat.closestn('named_streets',5,'name', 500).map(ff => ff.feat.properties.name)",
|
||||
"_spelling_is_correct:= feat.get('_nearby_street_names').indexOf(feat.properties['_name_to_apply']) >= 0"
|
||||
],
|
||||
"mapRendering": [
|
||||
{
|
||||
"width": {
|
||||
"render": "2",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "fixme~*",
|
||||
"then": "5"
|
||||
}
|
||||
]
|
||||
},
|
||||
"color": {
|
||||
"render": "#00c",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "_spelling_is_correct=false",
|
||||
"then": "#ff00ff"
|
||||
},
|
||||
{
|
||||
"if": "_singular_import=ffalse",
|
||||
"then": "#f00"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"title": "OSM-gebouw",
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "apply_streetname",
|
||||
"render": "{tag_apply(addr:street=$_name_to_apply ,Apply the CRAB-street onto this building)}",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "_spelling_is_correct=false",
|
||||
"then": "No nearby street has the same name. The CRAB-name is {_name_to_apply}"
|
||||
},
|
||||
{
|
||||
"if": "_singular_import=false",
|
||||
"then": "There are multiple streetnames applicable here"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"passAllFeatures": true
|
||||
}
|
||||
],
|
||||
"hideFromOverview": true
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M0 256v128c0 17.7 14.3 32 32 32h32V224H32c-17.7 0-32 14.3-32 32zM464 96H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H176c-44.2 0-80 35.8-80 80v272c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V176c0-44.2-35.8-80-80-80zM256 416h-64v-32h64v32zm-32-120c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm128 120h-64v-32h64v32zm96 0h-64v-32h64v32zm-32-120c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm192-72h-32v192h32c17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32z"/></svg>
|
||||
<!--
|
||||
Font Awesome Free 5.2.0 by @fontawesome - https://fontawesome.com
|
||||
License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
-->
|
Before Width: | Height: | Size: 751 B |
|
@ -326,28 +326,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "named_streets",
|
||||
"minzoom": 18,
|
||||
"source": {
|
||||
"osmTags": {
|
||||
"and": [
|
||||
"highway~*",
|
||||
"name~*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"mapRendering": [
|
||||
{
|
||||
"color": {
|
||||
"render": "#ccc"
|
||||
},
|
||||
"width": {
|
||||
"render": "0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
"named_streets"
|
||||
],
|
||||
"enableShareScreen": false,
|
||||
"enableMoreQuests": false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue