Add decent intersection detection to GRB theme
This commit is contained in:
parent
65f5b130a8
commit
741564471c
3 changed files with 46 additions and 7 deletions
|
@ -38,7 +38,7 @@
|
|||
"point"
|
||||
],
|
||||
"icon": {
|
||||
"render": "./assets/themes/grb_import/robot.svg"
|
||||
"render": "./assets/svg/robot.svg"
|
||||
},
|
||||
"iconSize": "15,15,center"
|
||||
}
|
||||
|
@ -350,6 +350,7 @@
|
|||
"all_tags"
|
||||
]
|
||||
},
|
||||
"address",
|
||||
{
|
||||
"builtin": "crab_address",
|
||||
"override": {
|
||||
|
@ -464,7 +465,7 @@
|
|||
"title": "GRB outline",
|
||||
"calculatedTags": [
|
||||
"_overlaps_with_buildings=feat.overlapWith('OSM-buildings')",
|
||||
"_overlap_with=feat.get('_overlaps_with_buildings').filter(f => f.overlap > 1 && (feat.get('_surface') < 20 || f.overlap / feat.get('_surface')) > 0.5)[0] ?? ''",
|
||||
"_overlaps_with=feat.get('_overlaps_with_buildings').filter(f => f.overlap > 1 /* square meter */ )[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']",
|
||||
|
@ -479,18 +480,17 @@
|
|||
"_imported_osm_still_fresh= feat.properties['_osm_obj:source:date'] == feat.properties._grb_date",
|
||||
"_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' : ''",
|
||||
"_overlaps_with_other_features=feat.overlapWith('generic_osm_object').map(f => \"<a href='https://osm.org/\"+f.feat.properties.id+\"' target='_blank'>\" + f.feat.properties.id + \"</a>\").join(', ')"
|
||||
"_intersects_with_other_features=feat.intersectionsWith('generic_osm_object').map(f => \"<a href='https://osm.org/\"+f.feat.properties.id+\"' target='_blank'>\" + f.feat.properties.id + \"</a>\").join(', ')"
|
||||
],
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "Import-button",
|
||||
"render": "{import_way_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,,_is_part_of_building=true,1,_moveable=true)}",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "_overlaps_with_other_features~*",
|
||||
"then": "This GRB building overlaps with the following features: {_overlaps_with_other_features}.<br/>Fix the overlap and try again"
|
||||
{"#": "Hide import button if intersection with other objects are detected",
|
||||
"if": "_intersects_with_other_features~*",
|
||||
"then": "This GRB building intersects with the following features: {_intersects_with_other_features}.<br/>Fix the overlap and try again"
|
||||
},
|
||||
|
||||
{
|
||||
"if": {
|
||||
"and": [
|
||||
|
@ -534,6 +534,7 @@
|
|||
"if": "_osm_obj:addr:housenumber~*",
|
||||
"then": "The overlapping building only has a housenumber known: {_osm_obj:addr:housenumber}"
|
||||
},
|
||||
|
||||
{
|
||||
"if": "_osm_obj:id=",
|
||||
"then": "No overlapping OpenStreetMap-building found"
|
||||
|
@ -608,6 +609,10 @@
|
|||
"icon": {
|
||||
"render": "./assets/themes/grb_import/housenumber_blank.svg",
|
||||
"mappings": [
|
||||
{
|
||||
"if": "_intersects_with_other_features~*",
|
||||
"then": "./assets/themes/grb_import/warning.svg"
|
||||
},
|
||||
{
|
||||
"if": "addr:housenumber=",
|
||||
"then": ""
|
||||
|
|
|
@ -6,5 +6,15 @@
|
|||
"Pieter Vander Vennet"
|
||||
],
|
||||
"sources": []
|
||||
},
|
||||
{
|
||||
"path": "warning.svg",
|
||||
"license": "CC0",
|
||||
"authors": [
|
||||
"penubag"
|
||||
],
|
||||
"sources": [
|
||||
"https://commons.wikimedia.org/wiki/File:Ambox_warning_pn.svg"
|
||||
]
|
||||
}
|
||||
]
|
24
assets/themes/grb_import/warning.svg
Normal file
24
assets/themes/grb_import/warning.svg
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 380 330">
|
||||
<defs>
|
||||
<linearGradient id="linearGradient3134">
|
||||
<stop stop-color="#f54c4c" offset="0"/>
|
||||
<stop stop-color="#ba1313" offset="0.5"/>
|
||||
<stop stop-color="#9a1919" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linearGradient3140" y2="237.7" xlink:href="#linearGradient3134" gradientUnits="userSpaceOnUse" y1="4.32" x2="245" x1="91.3"/>
|
||||
<filter id="filter3172">
|
||||
<feGaussianBlur stdDeviation="5.092"/>
|
||||
</filter>
|
||||
<linearGradient id="linearGradient2184" y2="328.8" xlink:href="#linearGradient3134" gradientUnits="userSpaceOnUse" x2="334.5" y1="90.9" x1="125.6"/>
|
||||
</defs>
|
||||
<g transform="translate(-15 -37)">
|
||||
<path d="m213.05 47.378c-4.21 0.218-8.03 2.547-10.15 6.193l-168.96 291.54c-2.239 3.86-2.246 8.63-0.018 12.5 2.227 3.87 6.352 6.26 10.819 6.27l336.93 0.53c4.47 0.01 8.6-2.36 10.85-6.23 2.24-3.86 2.25-8.63 0.03-12.51l-168.02-292.06c-2.35-4.071-6.78-6.478-11.48-6.232zm0.61 37.462l146.41 254.53-293.65-0.46 147.24-254.07z" fill-opacity="0.8" filter="url(#filter3172)" fill="#777"/>
|
||||
<g stroke-linejoin="round" stroke-linecap="round">
|
||||
<path d="m199.83 41.494c-4.22 0.218-8.04 2.547-10.16 6.194l-168.96 291.53c-2.237 3.87-2.244 8.64-0.016 12.51s6.352 6.26 10.819 6.26l336.93 0.53c4.47 0.02 8.61-2.36 10.85-6.22 2.24-3.87 2.25-8.63 0.03-12.51l-168.01-292.06c-2.35-4.075-6.79-6.482-11.48-6.236v0zm0.6 37.462l146.41 254.52-293.65-0.45 147.24-254.07z" stroke="#870000" stroke-width="6.25" fill="url(#linearGradient2184)"/>
|
||||
<path stroke="url(#linearGradient3140)" stroke-width="20.69" fill="url(#linearGradient3140)" d="m 230.7 197.9 l -278.8 -0.45 139.8 -241.2 139 241.7 z" transform="matrix(1.208 0 0 1.208 89.7 106.9)"/>
|
||||
</g>
|
||||
<path d="m199.89 117.76c-2.6 0.14-4.96 1.6-6.27 3.89l-104.42 183.11c-1.379 2.42-1.383 5.42-0.007 7.85 1.377 2.43 3.926 3.93 6.687 3.93l208.22 0.34c2.76 0 5.31-1.49 6.7-3.91 1.39-2.43 1.39-5.42 0.02-7.86l-103.83-183.43c-1.45-2.56-4.19-4.07-7.1-3.92z" fill="#fff"/>
|
||||
<path d="m203.69 256.44h-5.34c-0.55-9.45-2.39-20.78-5.51-33.96l-6.35-26.88c-3.8-16.11-5.7-27.65-5.7-34.61 0-14.06 6.71-21.09 20.14-21.09 5.88 0 10.74 1.94 14.57 5.83s5.75 8.85 5.75 14.88c0 6.41-2.02 18.07-6.07 34.99l-6.44 26.88c-2.26 9.45-3.95 20.77-5.05 33.96zm-2.49 17.64c6.26 0 11.1 2.13 14.53 6.39 3.44 4.26 5.15 8.81 5.15 13.67 0 6.4-2.08 11.33-6.25 14.79-4.17 3.45-8.64 5.17-13.43 5.17-6.31 0-11.17-2.11-14.57-6.34s-5.1-8.77-5.1-13.62c0-5.66 1.88-10.42 5.65-14.28s8.45-5.78 14.02-5.78z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in a new issue