From 6bcdb6d9a01c48e5be083bb9195f65af491c7420 Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 9 Dec 2024 18:59:06 +0100 Subject: [PATCH 1/5] Themes(climbing): Change conditions for gear rental questions - Also recognize speed as enough to show the harness rental question - Require answer on climbing styles before showing harness/belay device rental --- assets/layers/climbing_gym/climbing_gym.json | 34 +++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/assets/layers/climbing_gym/climbing_gym.json b/assets/layers/climbing_gym/climbing_gym.json index c5093d8114..341990dbaf 100644 --- a/assets/layers/climbing_gym/climbing_gym.json +++ b/assets/layers/climbing_gym/climbing_gym.json @@ -242,8 +242,24 @@ }, "condition": { "or": [ - "climbing:sport!=no", - "climbing:toprope!=no" + { + "and": [ + "climbing:sport!=", + "climbing:sport!=no" + ] + }, + { + "and": [ + "climbing:toprope!=", + "climbing:toprope!=no" + ] + }, + { + "and": [ + "climbing:speed!=", + "climbing:speed!=no" + ] + } ] }, "mappings": [ @@ -327,8 +343,18 @@ }, "condition": { "or": [ - "climbing:sport!=no", - "climbing:toprope!=no" + { + "and": [ + "climbing:sport!=", + "climbing:sport!=no" + ] + }, + { + "and": [ + "climbing:toprope!=", + "climbing:toprope!=no" + ] + } ] }, "mappings": [ From c54060e4ab04889cbe40823f8163338141de0311 Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 9 Dec 2024 22:26:17 +0100 Subject: [PATCH 2/5] Themes(climbing): Clarify questions about gear rental Specify in the question that it's for gear to rent for use within the gym. --- assets/layers/climbing_gym/climbing_gym.json | 16 ++++++++-------- langs/layers/en.json | 8 ++++---- langs/layers/nl.json | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/assets/layers/climbing_gym/climbing_gym.json b/assets/layers/climbing_gym/climbing_gym.json index 341990dbaf..b96cf5d457 100644 --- a/assets/layers/climbing_gym/climbing_gym.json +++ b/assets/layers/climbing_gym/climbing_gym.json @@ -147,8 +147,8 @@ { "id": "shoe_rental", "question": { - "en": "Can one rent climbing shoes here?", - "nl": "Kunnen hier klimschoenen gehuurd worden?", + "en": "Can one rent climbing shoes here to use in the gym?", + "nl": "Kunnen hier klimschoenen gehuurd worden voor gebruik in de zaal?", "fr": "Peut-on louer des chaussures d'escalade ici ?", "de": "Kann man hier Kletterschuhe ausleihen?", "pl": "Czy można tutaj wypożyczyć buty do wspinaczki?", @@ -233,8 +233,8 @@ { "id": "harness_rental", "question": { - "en": "Can one rent a climbing harness here?", - "nl": "Kan een klimgordel hier gehuurd worden?", + "en": "Can one rent a climbing harness here to use in the gym?", + "nl": "Kan hier een klimgordel gehuurd worden voor gebruik in de zaal?", "fr": "Peut-on louer un baudrier d'escalade ici ?", "de": "Kann man hier einen Klettergurt ausleihen?", "cs": "Lze si zde zapůjčit horolezecký postroj?", @@ -334,8 +334,8 @@ { "id": "belay_device_rental", "question": { - "en": "Can one rent a belay device here?", - "nl": "Kan een zekeringsapparaat hier gehuurd worden?", + "en": "Can one rent a belay device here to use in the gym?", + "nl": "Kan hier een zekeringsapparaat gehuurd worden voor gebruik in de zaal?", "fr": "Peut-on louer un dispositif d'assurage ici ?", "de": "Kann man hier ein Sicherungsgerät ausleihen?", "cs": "Lze si zde půjčit jištění?", @@ -448,8 +448,8 @@ { "id": "rope_rental", "question": { - "en": "Can one rent a climbing rope here?", - "nl": "Kan een klimtouw hier gehuurd worden?", + "en": "Can one rent a climbing rope here to use in the gym?", + "nl": "Kan hier een klimtouw gehuurd worden voor gebruik in de zaal?", "fr": "Peut-on louer une corde d'escalade ici ?", "de": "Kann man hier ein Kletterseil ausleihen?", "cs": "Lze si zde půjčit lezecké lano?", diff --git a/langs/layers/en.json b/langs/layers/en.json index 108894803f..82799e2949 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -3069,7 +3069,7 @@ "then": "A belay device can not be rented here" } }, - "question": "Can one rent a belay device here?" + "question": "Can one rent a belay device here to use in the gym?" }, "harness_rental": { "mappings": { @@ -3086,7 +3086,7 @@ "then": "A climbing harness can not be rented here" } }, - "question": "Can one rent a climbing harness here?" + "question": "Can one rent a climbing harness here to use in the gym?" }, "name": { "question": "What is the name of this climbing gym?" @@ -3106,7 +3106,7 @@ "then": "A climbing rope can not be rented here" } }, - "question": "Can one rent a climbing rope here?" + "question": "Can one rent a climbing rope here to use in the gym?" }, "shoe_rental": { "mappings": { @@ -3123,7 +3123,7 @@ "then": "Climbing shoes can not be rented here" } }, - "question": "Can one rent climbing shoes here?" + "question": "Can one rent climbing shoes here to use in the gym?" } }, "title": { diff --git a/langs/layers/nl.json b/langs/layers/nl.json index 3fc1734c60..b0156f9808 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -3060,7 +3060,7 @@ "then": "Hier kan geen zekeringsapparaat gehuurd worden" } }, - "question": "Kan een zekeringsapparaat hier gehuurd worden?" + "question": "Kan hier een zekeringsapparaat gehuurd worden voor gebruik in de zaal?" }, "harness_rental": { "mappings": { @@ -3077,7 +3077,7 @@ "then": "Hier kunnen geen klimgordels gehuurd worden" } }, - "question": "Kan een klimgordel hier gehuurd worden?" + "question": "Kan hier een klimgordel gehuurd worden voor gebruik in de zaal?" }, "name": { "question": "Wat is de naam van deze klimzaal?" @@ -3097,7 +3097,7 @@ "then": "Hier kan geen klimtouw gehuurd worden" } }, - "question": "Kan een klimtouw hier gehuurd worden?" + "question": "Kan hier een klimtouw gehuurd worden voor gebruik in de zaal?" }, "shoe_rental": { "mappings": { @@ -3114,7 +3114,7 @@ "then": "Hier kunnen geen klimschoenen gehuurd worden" } }, - "question": "Kunnen hier klimschoenen gehuurd worden?" + "question": "Kunnen hier klimschoenen gehuurd worden voor gebruik in de zaal?" } }, "title": { From 026825aa3d37650b8b0121e2a5d39c6d55d42d63 Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 9 Dec 2024 18:52:05 +0100 Subject: [PATCH 3/5] Themes(climbing): Add auto belay tags I even documented these tags on the wiki! https://wiki.openstreetmap.org/wiki/Climbing#Climbing_gym_services_and_facilities --- assets/layers/climbing_gym/climbing_gym.json | 99 ++++++++++++++++++++ langs/layers/en.json | 34 +++++++ langs/layers/nl.json | 34 +++++++ 3 files changed, 167 insertions(+) diff --git a/assets/layers/climbing_gym/climbing_gym.json b/assets/layers/climbing_gym/climbing_gym.json index b96cf5d457..f229c195e6 100644 --- a/assets/layers/climbing_gym/climbing_gym.json +++ b/assets/layers/climbing_gym/climbing_gym.json @@ -331,6 +331,105 @@ } ] }, + { + "id": "auto_belay_toprope", + "question": { + "en": "Are there auto belays for top roping here?", + "nl": "Zijn hier auto belays voor toprope?" + }, + "questionHint": { + "en": "Excluding auto belays that are only for speed climbing", + "nl": "Autobelays die enkel voor speed zijn, tellen niet mee" + }, + "condition": { + "and": [ + "climbing:toprope!=", + "climbing:toprope!=no" + ] + }, + "freeform": { + "key": "climbing:autobelay:toprope", + "type": "nat" + }, + "mappings": [ + { + "if": "climbing:autobelay:toprope=no", + "then": { + "en": "There are no auto belays for top roping", + "nl": "Er zijn geen autobelays voor toprope" + } + }, + { + "if": "climbing:autobelay:toprope=yes", + "then": { + "en": "There are a number of auto belays for top roping", + "nl": "Er zijn enkele autobelays voor toprope" + } + }, + { + "if": "climbing:autobelay:toprope=all", + "then": { + "en": "There is an auto belay for every top rope route but manual belaying is also possible", + "nl": "Elke toproperoute kan op autobelay geklommen worden maar handmatig zekeren is ook mogelijk" + } + }, + { + "if": "climbing:autobelay:toprope=only", + "then": { + "en": "Top rope routes can only be climbed on auto belay", + "nl": "Toproperoutes kunnen enkel op autobelay geklommen worden" + } + } + ], + "render": { + "en": "There are {climbing:autobelay:toprope} auto belay devices for top roping", + "nl": "Er zijn {climbing:autobelay:toprope} autobelaytoestellen voor toprope" + } + }, + { + "id": "auto_belay_lead", + "question": { + "en": "Are there auto belays for lead climbing here?", + "nl": "Zijn hier autobelays voor voorklimmen?" + }, + "condition": { + "and": [ + "climbing:sport!=", + "climbing:sport!=no" + ] + }, + "freeform": { + "key": "climbing:autobelay:sport", + "type": "nat" + }, + "mappings": [ + { + "if": "climbing:autobelay:sport=no", + "then": { + "en": "There are no auto belays for lead climbing", + "nl": "Er zijn geen autobelays voor voorklimmen" + } + }, + { + "if": "climbing:autobelay:sport=yes", + "then": { + "en": "There is a number of auto belays for lead climbing", + "nl": "Er zijn enkele autobelays voor voorklimmen" + } + }, + { + "if": "climbing:autobelay:sport=all", + "then": { + "en": "There is an auto belay for every lead climbing route", + "nl": "Elke voorklimroute kan op autobelay geklommen worden" + } + } + ], + "render": { + "en": "There are {climbing:autobelay:sport} auto belays for lead climbing", + "nl": "Er zijn {climbing:autobelay:sport} autobelays voor voorklimmen" + } + }, { "id": "belay_device_rental", "question": { diff --git a/langs/layers/en.json b/langs/layers/en.json index 82799e2949..e554a9d4c1 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -3051,6 +3051,40 @@ }, "question": "Is there a speed climbing wall?" }, + "auto_belay_lead": { + "mappings": { + "0": { + "then": "There are no auto belays for lead climbing" + }, + "1": { + "then": "There is a number of auto belays for lead climbing" + }, + "2": { + "then": "There is an auto belay for every lead climbing route" + } + }, + "question": "Are there auto belays for lead climbing here?", + "render": "There are {climbing:autobelay:sport} auto belays for lead climbing" + }, + "auto_belay_toprope": { + "mappings": { + "0": { + "then": "There are no auto belays for top roping" + }, + "1": { + "then": "There are a number of auto belays for top roping" + }, + "2": { + "then": "There is an auto belay for every top rope route but manual belaying is also possible" + }, + "3": { + "then": "Top rope routes can only be climbed on auto belay" + } + }, + "question": "Are there auto belays for top roping here?", + "questionHint": "Excluding auto belays that are only for speed climbing", + "render": "There are {climbing:autobelay:toprope} auto belay devices for top roping" + }, "belay_device_rental": { "mappings": { "0": { diff --git a/langs/layers/nl.json b/langs/layers/nl.json index b0156f9808..7e12e621cf 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -3042,6 +3042,40 @@ }, "question": "Is er een snelklimmuur (speed climbing)?" }, + "auto_belay_lead": { + "mappings": { + "0": { + "then": "Er zijn geen autobelays voor voorklimmen" + }, + "1": { + "then": "Er zijn enkele autobelays voor voorklimmen" + }, + "2": { + "then": "Elke voorklimroute kan op autobelay geklommen worden" + } + }, + "question": "Zijn hier autobelays voor voorklimmen?", + "render": "Er zijn {climbing:autobelay:sport} autobelays voor voorklimmen" + }, + "auto_belay_toprope": { + "mappings": { + "0": { + "then": "Er zijn geen autobelays voor toprope" + }, + "1": { + "then": "Er zijn enkele autobelays voor toprope" + }, + "2": { + "then": "Elke toproperoute kan op autobelay geklommen worden maar handmatig zekeren is ook mogelijk" + }, + "3": { + "then": "Toproperoutes kunnen enkel op autobelay geklommen worden" + } + }, + "question": "Zijn hier auto belays voor toprope?", + "questionHint": "Autobelays die enkel voor speed zijn, tellen niet mee", + "render": "Er zijn {climbing:autobelay:toprope} autobelaytoestellen voor toprope" + }, "belay_device_rental": { "mappings": { "0": { From f35bf01abbcefe750bb873503dcb7fa10d7fecde Mon Sep 17 00:00:00 2001 From: Midgard Date: Tue, 10 Dec 2024 01:36:25 +0100 Subject: [PATCH 4/5] Themes(climbing): Recognize leisure=sports_hall This commit just adds support to recognize `leisure=sports_hall`, it doesn't add a preset. Imo `leisure=sports_hall` vs `leisure=sports_centre` looks like a hot mess in many cases (there are several forum threads about this question) and we shouldn't bother MapComplete users with this when they want to add a climbing gym. But there's one clear case where I'd even like to add this tag myself (with JOSM): on halls within a larger sports_centre. Sport Vlaanderen Brugge and Sportoase Leuven come to mind. --- assets/layers/climbing_gym/climbing_gym.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/layers/climbing_gym/climbing_gym.json b/assets/layers/climbing_gym/climbing_gym.json index f229c195e6..492ecedf35 100644 --- a/assets/layers/climbing_gym/climbing_gym.json +++ b/assets/layers/climbing_gym/climbing_gym.json @@ -28,7 +28,12 @@ "osmTags": { "and": [ "sport=climbing", - "leisure=sports_centre" + { + "or": [ + "leisure=sports_centre", + "leisure=sports_hall" + ] + } ] } }, From 9ab8d99e56d8ae9653921c21e2f3559d69cc675f Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 10 Dec 2024 02:45:30 +0100 Subject: [PATCH 5/5] Fix: fix #2306 by using a cutof of 150m --- .../ImageProviders/ImageUploadManager.ts | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Logic/ImageProviders/ImageUploadManager.ts b/src/Logic/ImageProviders/ImageUploadManager.ts index aced3e88be..b2b686f80f 100644 --- a/src/Logic/ImageProviders/ImageUploadManager.ts +++ b/src/Logic/ImageProviders/ImageUploadManager.ts @@ -85,7 +85,7 @@ export class ImageUploadManager { uploadFinished: this.getCounterFor(this._uploadFinished, featureId), retried: this.getCounterFor(this._uploadRetried, featureId), failed: this.getCounterFor(this._uploadFailed, featureId), - retrySuccess: this.getCounterFor(this._uploadRetriedSuccess, featureId), + retrySuccess: this.getCounterFor(this._uploadRetriedSuccess, featureId) } } @@ -94,7 +94,7 @@ export class ImageUploadManager { if (sizeInBytes > this._uploader.maxFileSizeInMegabytes * 1000000) { const error = Translations.t.image.toBig.Subs({ actual_size: Math.floor(sizeInBytes / 1000000) + "MB", - max_size: this._uploader.maxFileSizeInMegabytes + "MB", + max_size: this._uploader.maxFileSizeInMegabytes + "MB" }) return { error } } @@ -144,7 +144,7 @@ export class ImageUploadManager { properties, { theme: tags?.data?.["_orig_theme"] ?? this._theme.id, - changeType: "add-image", + changeType: "add-image" } ) @@ -168,15 +168,22 @@ export class ImageUploadManager { if (this._gps.data && !ignoreGps) { location = [this._gps.data.longitude, this._gps.data.latitude] } - if (location === undefined || location?.some((l) => l === undefined)) { + { feature ??= this._indexedFeatures.featuresById.data.get(featureId) - if(feature === undefined){ + if (feature === undefined) { throw "ImageUploadManager: no feature given and no feature found in the indexedFeature. Cannot upload this image" } - location = GeoOperations.centerpointCoordinates(feature) + const featureCenterpoint = GeoOperations.centerpointCoordinates(feature) + if (location === undefined || location?.some((l) => l === undefined) || + GeoOperations.distanceBetween(location, featureCenterpoint) > 150) { + /* GPS location is either unknown or very far away from the photographed location. + * Default to the centerpoint + */ + location = featureCenterpoint + } } try { - ;({ key, value, absoluteUrl } = await this._uploader.uploadImage( + ({ key, value, absoluteUrl } = await this._uploader.uploadImage( blob, location, author, @@ -186,7 +193,7 @@ export class ImageUploadManager { this.increaseCountFor(this._uploadRetried, featureId) console.error("Could not upload image, trying again:", e) try { - ;({ key, value, absoluteUrl } = await this._uploader.uploadImage( + ({ key, value, absoluteUrl } = await this._uploader.uploadImage( blob, location, author, @@ -202,7 +209,7 @@ export class ImageUploadManager { ctx: "While uploading an image in the Image Upload Manager", featureId, author, - targetKey, + targetKey }) ) return undefined