From e82f9290530c869973fb1d41bcf1d40e0c1cef3f Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 11 Oct 2021 23:44:01 +0200 Subject: [PATCH 1/3] Translation regeneration --- assets/tagRenderings/questions.json | 30 +++++++++++------ langs/shared-questions/id.json | 40 +++++++++++----------- langs/shared-questions/pt.json | 36 ++++++++++---------- langs/themes/en.json | 51 +++++++++++++++++++++++++++++ langs/themes/nl.json | 1 + 5 files changed, 110 insertions(+), 48 deletions(-) diff --git a/assets/tagRenderings/questions.json b/assets/tagRenderings/questions.json index 509749aa03..30b6e90c6e 100644 --- a/assets/tagRenderings/questions.json +++ b/assets/tagRenderings/questions.json @@ -156,35 +156,40 @@ "dog-access": { "question": { "en": "Are dogs allowed in this business?", - "nl": "Zijn honden toegelaten in deze zaak?" + "nl": "Zijn honden toegelaten in deze zaak?", + "pt": "Os cães são permitidos neste estabelecimento?" }, "mappings": [ { "if": "dog=yes", "then": { "en": "Dogs are allowed", - "nl": "honden zijn toegelaten" + "nl": "honden zijn toegelaten", + "pt": "Os cães são permitidos" } }, { "if": "dog=no", "then": { "en": "Dogs are not allowed", - "nl": "honden zijn niet toegelaten" + "nl": "honden zijn niet toegelaten", + "pt": "Os cães não são permitidos" } }, { "if": "dog=leashed", "then": { "en": "Dogs are allowed, but they have to be leashed", - "nl": "honden zijn enkel aan de leiband welkom" + "nl": "honden zijn enkel aan de leiband welkom", + "pt": "Os cães são permitidos, mas têm de ser presos pela trela" } }, { "if": "dog=unleashed", "then": { "en": "Dogs are allowed and can run around freely", - "nl": "honden zijn welkom en mogen vrij rondlopen" + "nl": "honden zijn welkom en mogen vrij rondlopen", + "pt": "Os cães são permitidos e podem correr livremente" } } ] @@ -247,7 +252,8 @@ "en": "Which methods of payment are accepted here?", "nl": "Welke betaalmiddelen worden hier geaccepteerd?", "pt": "Que métodos de pagamento são aceites aqui?", - "pt_BR": "Quais métodos de pagamento são aceitos aqui?" + "pt_BR": "Quais métodos de pagamento são aceitos aqui?", + "id": "Metode pembayaran manakah yang di terima disini?" }, "multiAnswer": true, "mappings": [ @@ -258,7 +264,8 @@ "en": "Cash is accepted here", "nl": "Cash geld wordt hier aanvaard", "pt": "Aceitam pagamento com dinheiro aqui", - "pt_BR": "Dinheiro é aceito aqui" + "pt_BR": "Dinheiro é aceito aqui", + "id": "Disini menerima pembayaran tunai" } }, { @@ -268,7 +275,8 @@ "en": "Payment cards are accepted here", "nl": "Betalen met bankkaarten kan hier", "pt": "Aceitam pagamento com cartões bancários aqui", - "pt_BR": "Cartões de pagamento são aceitos aqui" + "pt_BR": "Cartões de pagamento são aceitos aqui", + "id": "Disini menerima pembayaran dengan kartu" } } ] @@ -292,7 +300,8 @@ "pl": "Na jakim poziomie znajduje się ta funkcja?", "pt_BR": "Em que nível esse recurso está localizado?", "ru": "На каком этаже находится этот объект?", - "pt": "Em que nível se encontra este elemento?" + "pt": "Em que nível se encontra este elemento?", + "id": "Pada tingkat apa fitur ini diletakkan?" }, "render": { "en": "Located on the {level}th floor", @@ -369,7 +378,8 @@ "fr": "Premier étage", "pl": "Znajduje się na pierwszym piętrze", "sv": "Ligger på första våningen", - "pt": "Está no primeiro andar" + "pt": "Está no primeiro andar", + "id": "Berlokasi di lantai pertama" } } ] diff --git a/langs/shared-questions/id.json b/langs/shared-questions/id.json index ba2382719a..7c29ed6e61 100644 --- a/langs/shared-questions/id.json +++ b/langs/shared-questions/id.json @@ -3,30 +3,30 @@ "email": { "question": "Apa alamat surel dari {name}?" }, + "level": { + "mappings": { + "3": { + "then": "Berlokasi di lantai pertama" + } + }, + "question": "Pada tingkat apa fitur ini diletakkan?" + }, + "payment-options": { + "mappings": { + "0": { + "then": "Disini menerima pembayaran tunai" + }, + "1": { + "then": "Disini menerima pembayaran dengan kartu" + } + }, + "question": "Metode pembayaran manakah yang di terima disini?" + }, "phone": { "question": "Nomor telepon dari {name|?" }, "website": { "question": "Apa situs web dari {name}?" - }, - "payment-options": { - "mappings": { - "1": { - "then": "Disini menerima pembayaran dengan kartu" - }, - "0": { - "then": "Disini menerima pembayaran tunai" - } - }, - "question": "Metode pembayaran manakah yang di terima disini?" - }, - "level": { - "question": "Pada tingkat apa fitur ini diletakkan?", - "mappings": { - "3": { - "then": "Berlokasi di lantai pertama" - } - } } } -} +} \ No newline at end of file diff --git a/langs/shared-questions/pt.json b/langs/shared-questions/pt.json index a1622b21a3..fbd7309863 100644 --- a/langs/shared-questions/pt.json +++ b/langs/shared-questions/pt.json @@ -3,6 +3,23 @@ "description": { "question": "Ainda há algo de relevante que não tenha podido dar nas perguntas anteriores? Adicione-o aqui.
Não repita factos já declarados" }, + "dog-access": { + "mappings": { + "0": { + "then": "Os cães são permitidos" + }, + "1": { + "then": "Os cães não são permitidos" + }, + "2": { + "then": "Os cães são permitidos, mas têm de ser presos pela trela" + }, + "3": { + "then": "Os cães são permitidos e podem correr livremente" + } + }, + "question": "Os cães são permitidos neste estabelecimento?" + }, "email": { "question": "Qual é o endereço de e-mail de {name}?" }, @@ -61,23 +78,6 @@ } }, "question": "Este lugar é acessível a utilizadores de cadeiras de rodas?" - }, - "dog-access": { - "mappings": { - "0": { - "then": "Os cães são permitidos" - }, - "1": { - "then": "Os cães não são permitidos" - }, - "2": { - "then": "Os cães são permitidos, mas têm de ser presos pela trela" - }, - "3": { - "then": "Os cães são permitidos e podem correr livremente" - } - }, - "question": "Os cães são permitidos neste estabelecimento?" } } -} +} \ No newline at end of file diff --git a/langs/themes/en.json b/langs/themes/en.json index e1d8f67241..ea1aecd5e9 100644 --- a/langs/themes/en.json +++ b/langs/themes/en.json @@ -1240,6 +1240,57 @@ "shortDescription": "A map with playgrounds", "title": "Playgrounds" }, + "postboxes": { + "description": "On this map you can find and add data of post offices and post boxes. You can use this map to find where you can mail your next postcard! :)
Spotted an error or is a post box missing? You can edit this map with a free OpenStreetMap account. ", + "layers": { + "0": { + "description": "The layer showing postboxes.", + "name": "Postboxes", + "presets": { + "0": { + "title": "postbox" + } + }, + "title": { + "render": "Postbox" + } + }, + "1": { + "description": "A layer showing post offices.", + "filter": { + "0": { + "options": { + "0": { + "question": "Currently open" + } + } + } + }, + "name": "Post offices", + "presets": { + "0": { + "title": "Post Office" + } + }, + "tagRenderings": { + "OH": { + "mappings": { + "0": { + "then": "24/7 opened (including holidays)" + } + }, + "question": "What are the opening hours for this post office?", + "render": "Opening Hours: {opening_hours_table()}" + } + }, + "title": { + "render": "Post Office" + } + } + }, + "shortDescription": "A map showing postboxes and post offices", + "title": "Postbox and Post Office Map" + }, "shops": { "description": "On this map, one can mark basic information about shops, add opening hours and phone numbers", "layers": { diff --git a/langs/themes/nl.json b/langs/themes/nl.json index 409d96feaa..991614fad2 100644 --- a/langs/themes/nl.json +++ b/langs/themes/nl.json @@ -1025,6 +1025,7 @@ }, "toerisme_vlaanderen": { "description": "Op deze kaart kan je info zien die relevant is voor toerisme, zoals:
Zie je fouten op de kaart? Dan kan je zelf makkelijk aanpasingen maken, die zichtbaar zijn voor iedereen. Hiervoor dien je een gratis OpenStreetMap account voor te maken.

Met de steun van Toerisme Vlaanderen", + "descriptionTail": "Met de steun van Toerisme Vlaanderen", "shortDescription": "Een kaart om toeristisch relevante info op aan te duiden", "title": "Toeristisch relevante info" }, From dce43b4556514e040c785fc583292b4c3d987a00 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 11 Oct 2021 23:46:37 +0200 Subject: [PATCH 2/3] Use correct deletion configuration --- assets/themes/postboxes/postboxes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/themes/postboxes/postboxes.json b/assets/themes/postboxes/postboxes.json index f19df492e6..d90c5a1c39 100644 --- a/assets/themes/postboxes/postboxes.json +++ b/assets/themes/postboxes/postboxes.json @@ -73,7 +73,7 @@ ], "wayHandling": 2, "deletion": { - "softDeletion": { + "softDeletionTags": { "and": [ "amenity=", "razed:amenity=post_box" From 28ed52d4a961e120180102d6842e91d0b64203cb Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 11 Oct 2021 23:46:58 +0200 Subject: [PATCH 3/3] Documentation regeneration --- Docs/CalculatedTags.md | 50 +++++++++++++++++++++++++-------------- Docs/SpecialRenderings.md | 38 +++++++++++++++++++---------- Docs/URL_Parameters.md | 2 +- 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/Docs/CalculatedTags.md b/Docs/CalculatedTags.md index 8d8973b7b7..08083a10f4 100644 --- a/Docs/CalculatedTags.md +++ b/Docs/CalculatedTags.md @@ -26,12 +26,16 @@ The following values are always calculated, by default, by MapComplete and are a The latitude and longitude of the point (or centerpoint in the case of a way/area) + + ### _surface, _surface:ha The surface area of the feature, in square meters and in hectare. Not set on points and ways +This is a lazy metatag and is only calculated when needed + ### _length, _length:km @@ -40,6 +44,8 @@ The surface area of the feature, in square meters and in hectare. Not set on poi The total length of a feature in meters (and in kilometers, rounded to one decimal for '_length:km'). For a surface, the length of the perimeter + + ### Theme-defined keys @@ -47,6 +53,8 @@ The total length of a feature in meters (and in kilometers, rounded to one decim If 'units' is defined in the layoutConfig, then this metatagger will rewrite the specified keys to have the canonical form (e.g. `1meter` will be rewritten to `1m`) + + ### _country @@ -54,18 +62,15 @@ If 'units' is defined in the layoutConfig, then this metatagger will rewrite the The country code of the property (with latlon2country) + + ### _isOpen, _isOpen:description If 'opening_hours' is present, it will add the current state of the feature (being 'yes' or 'no') - -### _width:needed, _width:needed:no_pedestrians, _width:difference - - - -Legacy for a specific project calculating the needed width for safe traffic on a road. Only activated if 'width:carriageway' is present +This is a lazy metatag and is only calculated when needed ### _direction:numerical, _direction:leftright @@ -75,6 +80,8 @@ Legacy for a specific project calculating the needed width for safe traffic on a _direction:numerical is a normalized, numerical direction based on 'camera:direction' or on 'direction'; it is only present if a valid direction is found (e.g. 38.5 or NE). _direction:leftright is either 'left' or 'right', which is left-looking on the map or 'right-looking' on the map + + ### _now:date, _now:datetime, _loaded:date, _loaded:_datetime @@ -82,6 +89,8 @@ _direction:numerical is a normalized, numerical direction based on 'camera:direc Adds the time that the data got loaded - pretty much the time of downloading from overpass. The format is YYYY-MM-DD hh:mm, aka 'sortable' aka ISO-8601-but-not-entirely + + ### _last_edit:contributor, _last_edit:contributor:uid, _last_edit:changeset, _last_edit:timestamp, _version_number @@ -89,6 +98,8 @@ Adds the time that the data got loaded - pretty much the time of downloading fro Information about the last edit of this object. + + Calculating tags with Javascript ---------------------------------- @@ -140,15 +151,15 @@ Some advanced functions are available on **feat** as well: - distanceTo - overlapWith - closest + - closestn - memberships - - score ### distanceTo Calculates the distance between the feature and a specified point in kilometer. The input should either be a pair of coordinates, a geojson feature or the ID of an object - 0. longitude - 1. latitude + 0. feature OR featureID OR longitude + 1. undefined OR latitude ### overlapWith @@ -160,10 +171,21 @@ For example to get all objects which overlap or embed from a layer, use `_contai ### closest - Given either a list of geojson features or a single layer name, gives the single object which is nearest to the feature. In the case of ways/polygons, only the centerpoint is considered. + Given either a list of geojson features or a single layer name, gives the single object which is nearest to the feature. In the case of ways/polygons, only the centerpoint is considered. Returns a single geojson feature or undefined if nothing is found (or not yet laoded) 0. list of features +### closestn + + Given either a list of geojson features or a single layer name, gives the n closest objects which are nearest to the feature (excluding the feature itself). In the case of ways/polygons, only the centerpoint is considered. Returns a list of `{feat: geojson, distance:number}` the empty list if nothing is found (or not yet loaded) + +If a 'unique tag key' is given, the tag with this key will only appear once (e.g. if 'name' is given, all features will have a different name) + + 0. list of features or layer name + 1. amount of features + 2. unique tag key (optional) + 3. maxDistanceInMeters (optional) + ### memberships Gives a list of `{role: string, relation: Relation}`-objects, containing all the relations that this feature is part of. @@ -171,12 +193,4 @@ For example to get all objects which overlap or embed from a layer, use `_contai For example: `_part_of_walking_routes=feat.memberships().map(r => r.relation.tags.name).join(';')` - -### score - - Given the path of an aspected routing json file, will calculate the score. This score is wrapped in a UIEventSource, so for further calculations, use `.map(score => ...)` - -For example: `_comfort_score=feat.score('https://raw.githubusercontent.com/pietervdvn/AspectedRouting/master/Examples/bicycle/aspects/bicycle.comfort.json')` - - 0. path Generated from SimpleMetaTagger, ExtraFunction \ No newline at end of file diff --git a/Docs/SpecialRenderings.md b/Docs/SpecialRenderings.md index da4a4bc204..f5ca4d6e81 100644 --- a/Docs/SpecialRenderings.md +++ b/Docs/SpecialRenderings.md @@ -5,11 +5,6 @@ ### all_tags Prints all key-value pairs of the object - used for debugging - -name | default | description ------- | --------- | ------------- - - #### Example usage `{all_tags()}` @@ -20,11 +15,10 @@ name | default | description name | default | description ------ | --------- | ------------- image key/prefix | image | The keys given to the images, e.g. if image is given, the first picture URL will be added as image, the second as image:0, the third as image:1, etc... -smart search | true | Also include images given via 'Wikidata', 'wikimedia_commons' and 'mapillary #### Example usage - `{image_carousel(image,true)}` + `{image_carousel(image)}` ### image_upload Creates a button where a user can upload an image to IMGUR @@ -36,6 +30,17 @@ image-key | image | Image tag to add the URL to (or image-tag:0, image-tag:1 whe #### Example usage `{image_upload(image)}` +### wikipedia + + A box showing the corresponding wikipedia article - based on the wikidata tag + +name | default | description +------ | --------- | ------------- +keyToShowWikipediaFor | wikidata | Use the wikidata entry from this key to show the wikipedia article for + +#### Example usage + + `{wikipedia()}` is a basic example, `{wikipedia(name:etymology:wikidata)}` to show the wikipedia page of whom the feature was named after. Also remember that these can be styled, e.g. `{wikipedia():max-height: 10rem}` to limit the height ### minimap A small map showing the selected feature. Note that no styling is applied, wrap this in a div @@ -128,16 +133,25 @@ If you want to import a dataset, make sure that: 1. The dataset to import has a suitable license 2. The community has been informed of the import -3. The theme will filter out duplicate nodes4. All other requirements of the [import guidelines](https://wiki.openstreetmap.org/wiki/Import/Guidelines) have been followed +3. All other requirements of the [import guidelines](https://wiki.openstreetmap.org/wiki/Import/Guidelines) have been followed + +There are also some technicalities in your theme to keep in mind: + +1. The new point will be added and will flow through the program as any other new point as if it came from OSM. + This means that there should be a layer which will match the new tags and which will display it. +2. The original point from your geojson layer will gain the tag '_imported=yes'. + This should be used to change the appearance or even to hide it (eg by changing the icon size to zero) +3. There should be a way for the theme to detect previously imported points, even after reloading. + A reference number to the original dataset is an excellen way to do this + name | default | description ------ | --------- | ------------- -tags | undefined | Tags to copy-specification. This contains one or more pairs (seperated by a `;`), e.g. `amenity=fast_food; addr:housenumber={number}`. This new point will then have the tags `amenity=fast_food` and `addr:housenumber` with the value that was saved in `number` in the original feature. (Hint: prepare these values, e.g. with calculatedTags) +tags | undefined | Tags to copy-specification. This contains one or more pairs (seperated by a `;`), e.g. `amenity=fast_food; addr:housenumber=$number`. This new point will then have the tags `amenity=fast_food` and `addr:housenumber` with the value that was saved in `number` in the original feature. (Hint: prepare these values, e.g. with calculatedTags) text | Import this data into OpenStreetMap | The text to show on the button icon | ./assets/svg/addSmall.svg | A nice icon to show in the button +minzoom | 18 | How far the contributor must zoom in before being able to import the point #### Example usage - `{import_button(,Import this data into OpenStreetMap,./assets/svg/addSmall.svg)}` - -Generated from UI/SpecialVisualisations.ts \ No newline at end of file + `{import_button(,Import this data into OpenStreetMap,./assets/svg/addSmall.svg,18)}` Generated from UI/SpecialVisualisations.ts \ No newline at end of file diff --git a/Docs/URL_Parameters.md b/Docs/URL_Parameters.md index f353809015..bd363df9b7 100644 --- a/Docs/URL_Parameters.md +++ b/Docs/URL_Parameters.md @@ -161,7 +161,7 @@ Finally, the URL-hash is the part after the `#`. It is `node/1234` in this case. overpassUrl ------------- - Point mapcomplete to a different overpass-instance. Example: https://overpass-api.de/api/interpreter The default value is _https://overpass-api.de/api/interpreter_ + Point mapcomplete to a different overpass-instance. Example: https://overpass-api.de/api/interpreter The default value is _https://overpass-api.de/api/interpreter,https://overpass.kumi.systems/api/interpreter,https://overpass.openstreetmap.ru/cgi/interpreter_ overpassTimeout