mapcomplete/assets/themes/grb_import/grb.json

616 lines
20 KiB
JSON
Raw Normal View History

2021-03-21 15:12:53 +01:00
{
"id": "grb",
"title": {
2021-12-02 02:54:28 +01:00
"nl": "GRB import helper"
2021-03-21 15:12:53 +01:00
},
"shortDescription": {
2021-12-02 02:54:28 +01:00
"nl": "Grb import helper tool"
2021-03-21 15:12:53 +01:00
},
"description": {
2021-12-02 02:54:28 +01:00
"nl": "Dit thema helpt het GRB importeren.",
2021-12-05 21:03:39 +01:00
"en": "This theme is an attempt to help automating the GRB import."
2021-03-21 15:12:53 +01:00
},
"language": [
"nl",
"en"
2021-03-21 15:12:53 +01:00
],
"maintainer": "",
"icon": "./assets/svg/bug.svg",
"version": "0",
2021-12-06 12:41:05 +01:00
"startLat": 51.0249,
"startLon": 4.026489,
"startZoom": 9,
"widenFactor": 2,
2021-03-21 15:12:53 +01:00
"socialImage": "",
"clustering": {
"maxZoom": 15
},
"overrideAll": {
2021-12-05 05:16:58 +01:00
"minzoom": 19
},
2021-03-21 15:12:53 +01:00
"layers": [
{
2021-11-22 03:49:17 +01:00
"builtin": "type_node",
"override": {
"calculatedTags": [
"_is_part_of_building=feat.get('parent_ways')?.some(p => p.building !== undefined && p.building !== '') ?? false",
"_is_part_of_building_passage=feat.get('parent_ways')?.some(p => p.tunnel === 'building_passage') ?? false",
"_is_part_of_highway=!feat.get('is_part_of_building_passage') && (feat.get('parent_ways')?.some(p => p.highway !== undefined && p.highway !== '') ?? false)",
"_is_part_of_landuse=feat.get('parent_ways')?.some(p => (p.landuse !== undefined && p.landuse !== '') || (p.natural !== undefined && p.natural !== '')) ?? false"
],
"mapRendering": [
{
"icon": "square:#00f",
"iconSize": "5,5,center",
"location": "point"
}
2021-12-05 05:16:58 +01:00
],
"passAllFeatures": true
2021-11-22 03:49:17 +01:00
}
},
{
"id": "OSM-buildings",
"name": "All OSM-buildings",
2021-03-21 15:12:53 +01:00
"source": {
2021-11-22 03:49:17 +01:00
"osmTags": "building~*",
"maxCacheAge": 0
2021-03-21 15:12:53 +01:00
},
2021-04-11 19:21:41 +02:00
"calculatedTags": [
"_grbNumber=(feat.properties.fixme?.match(/GRB thinks that this has number ([^;]+)/ ) ?? ['','none']) [1]"
],
2021-11-22 03:49:17 +01:00
"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"
}
]
}
}
],
"title": "OSM-gebouw",
2021-03-21 15:12:53 +01:00
"tagRenderings": [
2021-11-22 03:49:17 +01:00
{
"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"
}
]
},
2021-03-21 15:12:53 +01:00
{
2021-09-26 19:56:40 +02:00
"id": "grb-housenumber",
2021-03-21 15:12:53 +01:00
"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"
}
2021-04-11 19:21:41 +02:00
},
{
"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": [
2021-09-04 18:59:51 +02:00
"addr:housenumber=",
2021-04-11 19:21:41 +02:00
"not:addr:housenumber=yes",
"fixme="
]
},
"then": "Dit gebouw heeft geen nummer, net zoals in het GRB",
"hideInAnswer": "_grbNumber!=no number"
2021-03-21 15:12:53 +01:00
}
]
},
{
2021-09-26 19:56:40 +02:00
"id": "grb-unit",
2021-04-11 19:21:41 +02:00
"question": "Wat is de wooneenheid-aanduiding?",
2021-03-21 15:12:53 +01:00
"render": {
2021-04-11 19:21:41 +02:00
"nl": "De wooneenheid-aanduiding is <b>{addr:unit}</b> "
2021-03-21 15:12:53 +01:00
},
"freeform": {
"key": "addr:unit"
},
"mappings": [
{
"if": "addr:unit=",
"then": "Geen wooneenheid-nummer"
}
]
},
{
2021-09-26 19:56:40 +02:00
"id": "grb-street",
2021-03-21 15:12:53 +01:00
"render": {
"nl": "De straat is <b>{addr:street}</b>"
},
"freeform": {
"key": "addr:street"
},
"question": {
"nl": "Wat is de straat?"
}
},
{
2021-09-26 19:56:40 +02:00
"id": "grb-fixme",
2021-03-21 15:12:53 +01:00
"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"
}
}
]
},
{
2021-09-26 19:56:40 +02:00
"id": "grb-min-level",
2021-03-21 15:12:53 +01:00
"render": {
"nl": "Dit gebouw begint maar op de {building:min_level} verdieping"
},
"question": {
"nl": "Hoeveel verdiepingen ontbreken?"
},
"freeform": {
"key": "building:min_level",
"type": "pnat"
}
2021-10-28 01:26:35 +02:00
},
2021-11-22 03:49:17 +01:00
"all_tags"
2021-10-28 01:26:35 +02:00
],
2021-11-22 03:49:17 +01:00
"filter": [
{
2021-11-22 03:49:17 +01:00
"id": "has-fixme",
"options": [
2021-10-28 00:13:18 +02:00
{
2021-11-22 03:49:17 +01:00
"osmTags": "fixme~*",
"question": "Heeft een FIXME"
2021-10-28 00:13:18 +02:00
}
]
2021-11-22 03:49:17 +01:00
}
2021-12-05 05:16:58 +01:00
],
"#": "Pass all the features in order to render the address in the layer below",
"passAllFeatures": true
},
2021-12-05 05:16:58 +01:00
"address",
{
"id": "All OSM objects",
"name": "All OSM Objects",
"source": {
"osmTags": {
"and": [
"id~*",
"landuse=",
"place=",
"disused:power=",
"power=",
"type!=boundary",
"boundary=",
2021-10-28 00:13:18 +02:00
{
"or": [
"level=",
"level=0"
]
},
{
"or": [
"layer=0",
"layer="
]
2021-10-28 00:13:18 +02:00
}
]
},
"maxCacheAge": 0
},
"mapRendering": [
2021-10-28 00:13:18 +02:00
{
"color": {
"render": "#00c"
2021-10-28 00:13:18 +02:00
},
"width": {
"render": "1"
2021-10-28 00:13:18 +02:00
}
}
],
"title": {
"render": {
"*": "OSM-Object"
}
},
"tagRenderings": [
"all_tags"
]
},
{
2021-12-02 02:54:28 +01:00
"builtin": "crab_address",
"override": {
"calculatedTags+": [
2021-12-06 12:41:05 +01:00
"_embedded_in=feat.overlapWith('OSM-buildings').filter(b => /* Do not match newly created objects */ b.feat.properties.id.indexOf('-') < 0)[0]?.feat?.properties ?? {}",
2021-12-05 05:16:58 +01:00
"_embedding_nr=feat.get('_embedded_in')['addr:housenumber']+(feat.get('_embedded_in')['addr:unit'] ?? '')",
2021-12-02 02:54:28 +01:00
"_embedding_street=feat.get('_embedded_in')['addr:street']",
2021-12-05 05:16:58 +01:00
"_embedding_id=feat.get('_embedded_in').id",
"_closeby_addresses=feat.closestn('address',10,undefined,50).map(f => f.feat).filter(addr => addr.properties['addr:street'] == feat.properties['STRAATNM'] && feat.properties['HNRLABEL'] == addr.properties['addr:housenumber'] + (addr.properties['addr:unit']??'') ).length",
2021-12-06 03:24:33 +01:00
"_has_identical_closeby_address=feat.get('_closeby_addresses') >= 1 ? 'yes' : 'no'",
"_embedded_in_grb=feat.overlapWith('GRB')[0]?.feat?.properties ?? {}",
"_embedding_nr_grb=feat.get('_embedded_in_grb')['addr:housenumber']",
"_embedding_street_grb=feat.get('_embedded_in_grb')['addr:street']"
2021-12-02 02:54:28 +01:00
],
2021-12-06 03:24:33 +01:00
"filter": [
{
"id": "show_matched_addresses",
"options": [
{
"question": "Show all CRAB-addresses (including already matched ones)"
2021-12-02 02:54:28 +01:00
},
2021-12-06 03:24:33 +01:00
{
"question": "Only show unmatched addresses",
"osmTags": {
"and": [
"_has_identical_closeby_address!=yes",
{
"#": "Matches the embedding OSM object",
"or": [
"_embedding_nr!:={HUISNR}",
"_embedding_street!:={STRAATNM}"
]
},
{
"#": "Matches the embedding GRB object",
2021-12-06 03:24:33 +01:00
"or": [
"_embedding_nr_grb!:={HUISNR}",
"_embedding_street_grb!:={STRAATNM}"
]
}
]
}
}
]
}
],
2021-12-02 02:54:28 +01:00
"tagRenderings+": [
{
2021-12-02 02:54:28 +01:00
"id": "render_embedded",
2021-12-05 05:16:58 +01:00
"render": "Dit CRAB-adres ligt in een OSM-gebouw. Het OSM-gebouw heeft geen volledig adres",
"mapping": [
{
"if": {
"and": [
"_embedding_street~*",
"_embedding_nr~*"
]
},
"then": "Het omliggende object met addres heeft <b>{_embedding_street}</b> {_embedding_nr}"
}
],
"condition": "_embedding_id~*"
},
{
"id": "apply-button",
2021-12-06 03:24:33 +01:00
"render": "{tag_apply(addr:street=$STRAATNM; addr:housenumber=$_HNRLABEL,Apply this address on the OSM-building,,_embedding_id)}",
2021-12-05 05:16:58 +01:00
"condition": "_embedding_id!="
},
{
"id": "import-button",
2021-12-06 12:41:05 +01:00
"render": "{import_button(OSM-buildings, addr:street=$STRAATNM; addr:housenumber=$_HNRLABEL,Voeg dit adres als een nieuw adrespunt toe,,,OSM-buildings,5)}",
2021-12-02 02:54:28 +01:00
"condition": {
2021-12-06 12:41:05 +01:00
"or": [
"_embedding_street!:={STRAATNM}",
"_embedding_nr!:={$_HNRLABEL}"
]
2021-12-02 02:54:28 +01:00
}
}
]
2021-12-02 02:54:28 +01:00
}
},
{
"id": "GRB",
2021-12-05 05:16:58 +01:00
"description": "Geometry which comes from GRB with tools to import them",
"source": {
"osmTags": "HUISNR~*",
"geoJson": "https://betadata.grbosm.site/grb?bbox={x_min},{y_min},{x_max},{y_max}",
"geoJsonZoomLevel": 18,
"mercatorCrs": true,
"maxCacheAge": 0
},
"name": "GRB geometries",
"title": "GRB outline",
"calculatedTags": [
2021-12-06 03:24:33 +01:00
"_overlaps_with=feat.overlapWith('OSM-buildings').filter(f => f.overlap > 1 && (feat.get('_surface') < 20 || f.overlap / feat.get('_surface')) > 0.5)[0] ?? ''",
"_overlap_absolute=feat.get('_overlaps_with')?.overlap",
"_overlap_percentage=Math.round(100 * feat.get('_overlap_absolute') / feat.get('_surface')) ",
"_osm_obj:source:ref=feat.get('_overlaps_with')?.feat?.properties['source:geometry:ref']",
"_osm_obj:source:date=feat.get('_overlaps_with')?.feat?.properties['source:geometry:date'].replace(/\\//g, '-')",
2021-12-06 03:24:33 +01:00
"_osm_obj:building=feat.get('_overlaps_with')?.feat?.properties?.building",
"_osm_obj:id=feat.get('_overlaps_with')?.feat?.properties?.id",
"_osm_obj:addr:street=(feat.get('_overlaps_with')?.feat?.properties ?? {})['addr:street']",
"_osm_obj:addr:housenumber=(feat.get('_overlaps_with')?.feat?.properties ?? {})['addr:housenumber']",
"_grb_ref=feat.properties['source:geometry:entity'] + '/' + feat.properties['source:geometry:oidn']",
"_imported_osm_object_found= feat.properties['_osm_obj:source:ref'] == feat.properties._grb_ref",
"_grb_date=feat.properties['source:geometry:date'].replace(/\\//g,'-')",
"_imported_osm_still_fresh= feat.properties['_osm_obj:source:date'] == feat.properties._grb_date",
2021-12-05 05:16:58 +01:00
"_target_building_type=feat.properties['_osm_obj:building'] === 'yes' ? feat.properties.building : (feat.properties['_osm_obj:building'] ?? feat.properties.building)",
"_building:min_level= feat.properties['fixme']?.startsWith('verdieping, correct the building tag, add building:level and building:min_level before upload in JOSM!') ? '1' : ''"
2021-10-28 01:26:35 +02:00
],
"tagRenderings": [
2021-12-06 03:24:33 +01:00
{
"id": "Import-button",
2021-12-06 12:41:05 +01:00
"render": "{import_button(OSM-buildings,building=$building;man_made=$man_made; source:geometry:date=$_grb_date; source:geometry:ref=$_grb_ref; addr:street=$addr:street; addr:housenumber=$addr:housenumber; building:min_level=$_building:min_level, Upload this building to OpenStreetMap)}",
2021-12-06 03:24:33 +01:00
"mappings": [
{
"if": {
"and": [
"_overlaps_with!=",
"_osm_obj:addr:street=",
"_osm_obj:addr:housenumber=",
"addr:street~*",
"addr:housenumber~*"
]
2021-12-06 03:24:33 +01:00
},
"then": "{import_button(OSM-buildings,building=$_target_building_type; source:geometry:date=$_grb_date; source:geometry:ref=$_grb_ref; addr:street=$addr:street; addr:housenumber=$addr:housenumber, Replace the geometry in OpenStreetMap and add the address,,,_osm_obj:id)}"
},
{
"if": "_overlaps_with!=",
"then": "{import_button(OSM-buildings,building=$_target_building_type; source:geometry:date=$_grb_date; source:geometry:ref=$_grb_ref, Replace the geometry in OpenStreetMap,,,_osm_obj:id)}"
}
]
},
2021-10-29 13:53:00 +02:00
{
"id": "Building info",
"render": "This is a <b>{building}</b> <span class='subtle'>detected by {detection_method}</span>"
},
2021-12-06 03:24:33 +01:00
{
"id": "overlapping building address",
"render": "The overlapping openstreetmap-building has no address information at all",
"mappings": [
{
"if": {
"and": [
"_osm_obj:addr:street~*",
"_osm_obj:addr:housenumber~*"
]
},
"then": "The overlapping openstreetmap-building has address {_osm_obj:addr:street} {_osm_obj:addr:housenumber}"
},
{
"if": "_osm_obj:addr:street~*",
"then": "The overlapping building only has a street known: {_osm_obj:addr:street}"
},
{
"if": "_osm_obj:addr:housenumber~*",
"then": "The overlapping building only has a housenumber known: {_osm_obj:addr:housenumber}"
}
],
"conditon": "_osm_obj:id~*"
},
{
"id": "grb_address_diff",
"render": "<div>The overlapping openstreetmap-building has a different address then this GRB-object: {addr:street} {addr:housenumber}<br/>{tag_apply(addr:street=$addr:street; addr:housenumber=$addr:housenumber,Copy the GRB-address onto the OSM-object,,_osm_obj:id)}",
"condition": {
"and": [
"_osm_obj:id~*",
"addr:street~*",
"addr:housenumber~*",
{
"or": [
"addr:street!:={_osm_obj:addr:street}",
"addr:housenumber!:={_osm_obj:addr:housenumber}"
]
}
]
}
},
{
"id": "overlapping building type",
2021-12-06 03:24:33 +01:00
"render": "<div>The overlapping <a href='https://osm.org/{_osm_obj:id}' target='_blank'>openstreetmap-building</a> is a <b>{_osm_obj:building}</b> and covers <b>{_overlap_percentage}%</b> of the GRB building<div><h3>GRB geometry:</h3>{minimap(21, id):height:10rem;border-radius:1rem;overflow:hidden}<h3>OSM geometry:</h3>{minimap(21,_osm_obj:id):height:10rem;border-radius:1rem;overflow:hidden}",
"condition": "_overlaps_with!="
},
{
"id": "apply-id",
"render": "{tag_apply(source:geometry:date=$_grb_date; source:geometry:ref=$_grb_ref,Mark the OSM-building as imported,,_osm_obj:id)}",
"condition": {
"and": [
2021-12-06 03:24:33 +01:00
"_overlaps_with!=",
"_imported!=yes"
]
}
},
{
"id": "apply-building-type",
"render": "{tag_apply(building=$building,Use the building type from GRB,,_osm_obj:id)}",
"condition": {
"and": [
2021-12-06 03:24:33 +01:00
"_overlaps_with!=",
"_osm_obj:building=yes",
"building!=yes"
]
}
2021-12-06 03:24:33 +01:00
}
],
"isShown": {
"render": "yes",
"mappings": [
{
"if": {
"and": [
"_imported_osm_object_found=true",
"_imported_osm_still_fresh=true"
]
},
"then": "no"
}
]
},
"mapRendering": [
{
2021-12-06 03:24:33 +01:00
"label": {
"render": "<div style='margin-top: -42px; color: black' class='rounded-full p-1 font-bold relative'>{addr:housenumber}</div>",
"condition": "addr:housenumber~*"
},
"iconSize": "50,50,center",
"icon": {
"render": "./assets/themes/grb_import/housenumber_blank.svg",
"mappings": [
{
"if": "addr:housenumber=",
"then": ""
}
]
},
"location": [
"point",
"centroid"
]
},
{
"width": {
"render": 5,
"mappings": [
{
"if": "_imported=yes",
"then": "1"
}
]
},
"color": {
"render": "#00a",
"mappings": [
2021-12-06 03:24:33 +01:00
{
"if": "_imported=yes",
"then": "#00ff00"
2021-12-06 03:24:33 +01:00
},
{
"if": {
"and": [
"_imported_osm_object_found=true",
"_imported_osm_still_fresh=true"
]
},
"then": "#0f0"
}
]
}
}
]
2021-12-05 05:16:58 +01:00
}
2021-03-21 15:12:53 +01:00
],
"hideFromOverview": true,
2021-10-28 00:13:18 +02:00
"defaultBackgroundId": "AGIVFlandersGRB",
"overpassMaxZoom": 15,
2021-10-28 00:13:18 +02:00
"osmApiTileSize": 17
2021-03-21 15:12:53 +01:00
}