This commit is contained in:
Pieter Vander Vennet 2021-12-02 02:54:28 +01:00
parent 290fc61f42
commit 7cfbb49bab
10 changed files with 585 additions and 172 deletions

View file

@ -1,13 +1,13 @@
{
"id": "grb",
"title": {
"nl": "GRB Fixup"
"nl": "GRB import helper"
},
"shortDescription": {
"nl": "Grb Fixup"
"nl": "Grb import helper tool"
},
"description": {
"nl": "GRB Fixup",
"nl": "Dit thema helpt het GRB importeren.",
"en": "This theme is an attempt to help automating the GRB import.<br/>Note that this is very hacky and 'steals' the GRB data from an external site; in order to do this, you need to install and activate <a href='https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/'>this firefox extension</a> for it to work."
},
"language": [
@ -355,74 +355,50 @@
]
},
{
"id": "crab-addresses 2021-10-26",
"source": {
"osmTags": "HUISNR~*",
"geoJson": "https://raw.githubusercontent.com/pietervdvn/pietervdvn.github.io/master/CRAB_2021_10_26/tile_{z}_{x}_{y}.geojson",
"#geoJson": "https://pietervdvn.github.io/CRAB_2021_10_26/tile_{z}_{x}_{y}.geojson",
"geoJsonZoomLevel": 18,
"maxCacheAge": 0
},
"name": "CRAB-addressen",
"title": "CRAB-adres",
"mapRendering": [
{
"location": [
"point",
"centroid"
],
"iconSize": "15,15,center",
"label": {
"render": "<div style='background:#faa' class='rounded-full'>{HNRLABEL}</div>"
}
}
],
"calculatedTags": [
"_embedded_in=feat.overlapWith('OSM-buildings')[0]?.feat?.properties ",
"_embedding_nr=feat.get('_embedded_in')['addr:housenumber']",
"_embedding_street=feat.get('_embedded_in')['addr:street']",
"_embedding_id=feat.get('_embedded_in').id"
],
"isShown": {
"render": "yes",
"mappings": [
"builtin": "crab_address",
"override": {
"calculatedTags+": [
"_embedded_in=feat.overlapWith('OSM-buildings')[0]?.feat?.properties ",
"_embedding_nr=feat.get('_embedded_in')['addr:housenumber']",
"_embedding_street=feat.get('_embedded_in')['addr:street']",
"_embedding_id=feat.get('_embedded_in').id"
],
"isShown": {
"render": "yes",
"mappings": [
{
"if": {
"and": [
"_embedding_nr:={HUISNR}",
"_embedding_street:={STRAATNM}"
]
},
"then": "no"
}
]
},
"tagRenderings+": [
{
"if": {
"id": "render_embedded",
"render": "Het omliggende object met addres heeft <b>{_embedding_street}</b> {_embedding_nr}",
"condition": {
"and": [
"_embedding_nr:={HUISNR}",
"_embedding_street:={STRAATNM}"
"_embedding_street~*",
"_embedding_nr~*"
]
},
"then": "no"
}
},
{
"id": "import-button",
"render": "{import_button(OSM-buildings, addr:street=$STRAATNM; addr:housenumber=$HUISNR,Import this address,,,OSM-buildings,5)}"
},
{
"id": "apply-button",
"render": "{tag_apply(addr:street=$STRAATNM; addr:housenumber=$HUISNR,Apply this address on the OSM-building,,_embedding_id)}",
"condition": "_embedded_in!="
}
]
},
"tagRenderings": [
{
"id": "render_crab",
"render": "Volgens het CRAB ligt hier <b>{STRAATNM}</b> {HUISNR} (label: {HNRLABEL})"
},
{
"id": "render_embedded",
"render": "Het omliggende object met addres heeft <b>{_embedding_street}</b> {_embedding_nr}",
"condition": {
"and": [
"_embedding_street~*",
"_embedding_nr~*"
]
}
},
"all_tags",
{
"id": "import-button",
"render": "{import_button(OSM-buildings, addr:street=$STRAATNM; addr:housenumber=$HUISNR,Import this address,,,OSM-buildings,5)}"
},
{
"id": "apply-button",
"render": "{tag_apply(addr:street=$STRAATNM; addr:housenumber=$HUISNR,Apply this address on the OSM-building,,_embedding_id)}",
"condition": "_embedded_in!="
}
]
}
},
{
"id": "GRB",
@ -523,7 +499,8 @@
}
}
]
}
},
"address"
],
"hideFromOverview": true,
"defaultBackgroundId": "AGIVFlandersGRB",

View file

@ -0,0 +1,305 @@
{
"id": "grb_fixme",
"title": {
"nl": "GRB Fixup"
},
"shortDescription": {
"nl": "Grb Fixup"
},
"description": {
"nl": "Gebouwen met een FIXME - wss GRB-import die gefixed moeten worden"
},
"language": [
"nl"
],
"maintainer": "",
"icon": "./assets/svg/bug.svg",
"version": "0",
"startLat": 51.2132,
"startLon": 3.231,
"startZoom": 14,
"widenFactor": 2,
"socialImage": "",
"clustering": {
"maxZoom": 15
},
"overrideAll": {
"source": {
"maxCacheAge": 0
}
},
"enableGeolocation": false,
"layers": [
{
"id": "OSM-buildings-fixme",
"name": "OSM-buildings with a fixme",
"source": {
"osmTags": {"and":
["building~*","fixme~*"]
},
"maxCacheAge": 0
},
"calculatedTags": [
"_grbNumber=(feat.properties.fixme?.match(/GRB thinks that this has number ([0-9a-zA-Z;]+)/) ?? ['','none']) [1]"
],
"mapRendering": [
{
"width": {
"render": "2",
"mappings": [
{
"if": "fixme~*",
"then": "5"
}
]
},
"color": {
"render": "#00c",
"mappings": [
{
"if": "fixme~*",
"then": "#ff00ff"
},
{
"if": "building=house",
"then": "#a00"
},
{
"if": "building=shed",
"then": "#563e02"
},
{
"if": {
"or": [
"building=garage",
"building=garages"
]
},
"then": "#f9bfbb"
},
{
"if": "building=yes",
"then": "#0774f2"
}
]
}
},
{
"location": [
"point",
"centroid"
],
"label": {
"mappings": [
{
"if": "addr:housenumber~*",
"then": "<div style='background-color: white; font: large; width: 1.5em; height: 1.5em; border-radius: 100%'>{addr:housenumber}</div>"
}
]
},
"iconSize": {
"render": "40,40,center"
}
}
],
"title": "OSM-gebouw",
"tagRenderings": [
{
"id": "building type",
"freeform": {
"key": "building"
},
"render": "The building type is <b>{building}</b>",
"question": {
"en": "What kind of building is this?"
},
"mappings": [
{
"if": "building=house",
"then": "A normal house"
},
{
"if": "building=detached",
"then": "A house detached from other building"
},
{
"if": "building=semidetached_house",
"then": "A house sharing only one wall with another house"
},
{
"if": "building=apartments",
"then": "An apartment building - highrise for living"
},
{
"if": "building=office",
"then": "An office building - highrise for work"
},
{
"if": "building=apartments",
"then": "An apartment building"
},
{
"if": "building=shed",
"then": "A small shed, e.g. in a garden"
},
{
"if": "building=garage",
"then": "A single garage to park a car"
},
{
"if": "building=garages",
"then": "A building containing only garages; typically they are all identical"
},
{
"if": "building=yes",
"then": "A building - no specification"
}
]
},
{
"id": "grb-housenumber",
"render": {
"nl": "Het huisnummer is <b>{addr:housenumber}</b>"
},
"question": {
"nl": "Wat is het huisnummer?"
},
"freeform": {
"key": "addr:housenumber"
},
"mappings": [
{
"if": {
"and": [
"not:addr:housenumber=yes",
"addr:housenumber="
]
},
"then": {
"nl": "Geen huisnummer"
}
},
{
"if": {
"and": [
"addr:housenumber:={_grbNumber}",
"fixme="
]
},
"then": "Het huisnummer is <b>{_grbNumber}</b>, wat overeenkomt met het GRB",
"hideInAnswer": {
"or": [
"_grbNumber=",
"_grbNumber=none",
"_grbNumber=no number"
]
}
},
{
"if": {
"and": [
"addr:housenumber=",
"not:addr:housenumber=yes",
"fixme="
]
},
"then": "Dit gebouw heeft geen nummer, net zoals in het GRB",
"hideInAnswer": "_grbNumber!=no number"
}
]
},
{
"id": "grb-unit",
"question": "Wat is de wooneenheid-aanduiding?",
"render": {
"nl": "De wooneenheid-aanduiding is <b>{addr:unit}</b> "
},
"freeform": {
"key": "addr:unit"
},
"mappings": [
{
"if": "addr:unit=",
"then": "Geen wooneenheid-nummer"
}
]
},
{
"id": "grb-street",
"render": {
"nl": "De straat is <b>{addr:street}</b>"
},
"freeform": {
"key": "addr:street"
},
"question": {
"nl": "Wat is de straat?"
}
},
{
"id": "grb-fixme",
"render": {
"nl": "De fixme is <b>{fixme}</b>"
},
"question": {
"nl": "Wat zegt de fixme?"
},
"freeform": {
"key": "fixme"
},
"mappings": [
{
"if": {
"and": [
"fixme="
]
},
"then": {
"nl": "Geen fixme"
}
}
]
},
{
"id": "grb-min-level",
"render": {
"nl": "Dit gebouw begint maar op de {building:min_level} verdieping"
},
"question": {
"nl": "Hoeveel verdiepingen ontbreken?"
},
"freeform": {
"key": "building:min_level",
"type": "pnat"
}
},
"all_tags"
],
"minzoom": 14
},
{
"builtin": "address",
"override": {
"minzoom": 18
}
},
{
"builtin":"crab_address",
"override": {
"minzoom": 18,
"+tagRenderings":[
{
"id": "import-button",
"render": "{import_button(address, addr:street=$STRAATNM; addr:housenumber=$HUISNR,Import this address)}"
}
]
}
}
],
"hideFromOverview": true,
"defaultBackgroundId": "AGIVFlandersGRB",
"overpassMaxZoom": 15,
"osmApiTileSize": 17
}

View file

@ -189,39 +189,16 @@
"description": "Alamat"
},
{
"id": "addresses",
"name": {
"en": "Known addresses in OSM",
"de": "Bekannte Adressen in OSM"
},
"minzoom": 18,
"source": {
"osmTags": {
"or": [
"addr:housenumber~*",
"addr:street~*",
"ref:inspireid~*"
]
}
},
"calculatedTags": [
"_closest_3_street_names=feat.closestn('named_streets',3, 'name').map(f => f.feat.properties.name)",
"_closest_street:0:name=JSON.parse(feat.properties._closest_3_street_names)[0]",
"_closest_street:1:name=JSON.parse(feat.properties._closest_3_street_names)[1]",
"_closest_street:2:name=JSON.parse(feat.properties._closest_3_street_names)[2]"
],
"title": {
"render": {
"en": "Known address",
"de": "Bekannte Adresse"
}
},
"description": {
"en": "Addresses",
"nl": "Adressen",
"de": "Adressen",
"ru": "Адреса"
"builtin": "address",
"override": {
"calculatedTags": [
"_closest_3_street_names=feat.closestn('named_streets',3, 'name').map(f => f.feat.properties.name)",
"_closest_street:0:name=JSON.parse(feat.properties._closest_3_street_names)[0]",
"_closest_street:1:name=JSON.parse(feat.properties._closest_3_street_names)[1]",
"_closest_street:2:name=JSON.parse(feat.properties._closest_3_street_names)[2]"
]
},
"tagRenderings": [
{
"id": "uk_addresses_explanation_osm",
@ -348,59 +325,6 @@
"en": "{image_carousel(image:address)}<br/>{image_upload(image:address, Add image of the address)}"
}
}
],
"mapRendering": [
{
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_ok.svg",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"then": "./assets/themes/uk_addresses/housenumber_unknown.svg"
}
]
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point"
]
},
{
"color": {
"render": "#00f",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"then": "#ff0"
}
]
},
"width": {
"render": "8"
}
}
]
},
{