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

View file

@ -197,7 +197,6 @@ export default class BackgroundMapSwitch extends Combine {
super(buttons)
this.SetClass("flex")
currentBackground.addCallbackAndRun(bg => console.trace("Current background is", bg.id))
}
}

View file

@ -128,11 +128,13 @@ ${Utils.Special_visualizations_tagsToApplyHelpText}
name: "minzoom",
doc: "How far the contributor must zoom in before being able to import the point",
defaultValue: "18"
}, {
},
{
name: "Snap onto layer(s)/replace geometry with this other way",
doc: " - If the value corresponding with this key starts with 'way/' and the feature is a LineString or Polygon, the original OSM-way geometry will be changed to match the new geometry\n" +
" - If a way of the given layer(s) is closeby, will snap the new point onto this way (similar as preset might snap). To show multiple layers to snap onto, use a `;`-seperated list",
}, {
},
{
name: "snap max distance",
doc: "The maximum distance that this point will move to snap onto a layer (in meters)",
defaultValue: "5"
@ -173,7 +175,7 @@ ${Utils.Special_visualizations_tagsToApplyHelpText}
} else {
const snapToLayers = args[5]?.split(";").filter(s => s !== "")
const snapToLayers = args[5]?.split(";")?.filter(s => s !== "")
const snapToLayersMaxDist = Number(args[6] ?? 6)
if (targetLayer === undefined) {

View file

@ -31,8 +31,6 @@ import SimpleMetaTagger from "../Logic/SimpleMetaTagger";
import MultiApply from "./Popup/MultiApply";
import AllKnownLayers from "../Customizations/AllKnownLayers";
import ShowDataLayer from "./ShowDataLayer/ShowDataLayer";
import Link from "./Base/Link";
import List from "./Base/List";
import {SubtleButton} from "./Base/SubtleButton";
import ChangeTagAction from "../Logic/Osm/Actions/ChangeTagAction";
import {And} from "../Logic/Tags/And";

View file

@ -0,0 +1,175 @@
{
"id": "address",
"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": "Адреса"
},
"tagRenderings": [
{
"id": "housenumber",
"render": {
"en": "The housenumber is <b>{addr:housenumber}</b>",
"nl": "Het huisnummer is <b>{addr:housenumber}</b>",
"de": "Die Hausnummer ist <b>{addr:housenumber}</b>"
},
"question": {
"en": "What is the number of this house?",
"de": "Wie lautet die Nummer dieses Hauses?"
},
"freeform": {
"key": "addr:housenumber",
"addExtraTags": [
"nohousenumber="
]
},
"mappings": [
{
"if": {
"and": [
"nohousenumber=yes"
]
},
"then": {
"en": "This building has no house number",
"nl": "Dit gebouw heeft geen huisnummer",
"de": "Dieses Gebäude hat keine Hausnummer"
}
}
]
},
{
"id": "street",
"render": {
"en": "This address is in street <b>{addr:street}</b>",
"de": "Diese Adresse befindet sich in der Straße <b>{addr:street}</b>"
},
"question": {
"en": "What street is this address located in?",
"de": "In welcher Straße befindet sich diese Adresse?"
},
"freeform": {
"key": "addr:street"
},
"mappings": [
{
"if": "addr:street:={_closest_street:0:name}",
"then": "Located in <b>{_closest_street:0:name}</b>",
"hideInAnswer": "_closest_street:0:name="
},
{
"if": "addr:street:={_closest_street:1:name}",
"then": "Located in <b>{_closest_street:1:name}</b>",
"hideInAnswer": "_closest_street:1:name="
},
{
"if": "addr:street:={_closest_street:2:name}",
"then": "Located in <b>{_closest_street:2:name}</b>",
"hideInAnswer": "_closest_street:2:name="
}
],
"condition": {
"and": [
"nohousenumber!~yes"
]
}
},
{
"id": "fixme",
"render": "<b>Fixme description</b>{fixme}",
"question": {
"en": "What should be fixed here? Please explain"
},
"freeform": {
"key": "fixme"
},
"mappings": [
{
"if": "fixme=",
"then": "No fixme - write something here to explain complicated cases"
}
]
}
],
"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"
}
}
]
}

View file

@ -0,0 +1,33 @@
{
"id": "crab_address",
"description": "Address data for Flanders by the governement, suited for import into OpenStreetMap. Datadump from 2021-10-26. This layer contains only visualisation logic. Import buttons should be added via an override.",
"source": {
"osmTags": "HUISNR~*",
"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>"
}
}
],
"tagRenderings": [
{
"id": "render_crab",
"render": {
"nl":"Volgens het CRAB ligt hier <b>{STRAATNM}</b> {HUISNR} (label: {HNRLABEL})"
}
},
"all_tags"
]
}

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"
}
}
]
},
{

View file

@ -864,18 +864,22 @@ video {
margin-left: 0.75rem;
}
.mt-1 {
margin-top: 0.25rem;
}
.mt-4 {
margin-top: 1rem;
}
.mt-1 {
margin-top: 0.25rem;
}
.mr-4 {
margin-right: 1rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.ml-2 {
margin-left: 0.5rem;
}
@ -892,10 +896,6 @@ video {
margin-right: 0.5rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.mb-10 {
margin-bottom: 2.5rem;
}
@ -1503,11 +1503,6 @@ video {
line-height: 1.75rem;
}
.text-3xl {
font-size: 1.875rem;
line-height: 2.25rem;
}
.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
@ -1518,6 +1513,11 @@ video {
line-height: 1.75rem;
}
.text-3xl {
font-size: 1.875rem;
line-height: 2.25rem;
}
.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;

View file

@ -11,7 +11,7 @@
"start": "npm run start:prepare && npm-run-all --parallel start:parallel:*",
"strt": "npm run start:prepare && npm run start:parallel:parcel",
"start:prepare": "ts-node scripts/generateLayerOverview.ts --no-fail && npm run increase-memory",
"start:parallel:parcel": "node --max_old_space_size=8000 $(which parcel) serve *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/layers/*/*.jpg assets/layers/*/*.png assets/layers/*/*.css assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.css assets/themes/*/*.jpg assets/themes/*/*.png vendor/* vendor/*/*",
"start:parallel:parcel": "node --max_old_space_size=12000 $(which parcel) serve *.html UI/** Logic/** assets/*.json assets/svg/* assets/generated/* assets/layers/*/*.svg assets/layers/*/*.jpg assets/layers/*/*.png assets/layers/*/*.css assets/tagRenderings/*.json assets/themes/*/*.svg assets/themes/*/*.css assets/themes/*/*.jpg assets/themes/*/*.png vendor/* vendor/*/*",
"start:parallel:tailwindcli": "tailwindcss -i index.css -o css/index-tailwind-output.css --watch",
"generate:css": "tailwindcss -i index.css -o css/index-tailwind-output.css",
"test": "ts-node test/TestAll.ts",