Merge branch 'develop' into alpha

This commit is contained in:
Pieter Vander Vennet 2021-10-11 23:52:22 +02:00
commit d0dfe9f607
9 changed files with 167 additions and 84 deletions

View file

@ -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

View file

@ -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 <span class='literal-code'>image</span> is given, the first picture URL will be added as <span class='literal-code'>image</span>, the second as <span class='literal-code'>image:0</span>, the third as <span class='literal-code'>image:1</span>, 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
`{import_button(,Import this data into OpenStreetMap,./assets/svg/addSmall.svg,18)}` Generated from UI/SpecialVisualisations.ts

View file

@ -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

View file

@ -8,10 +8,6 @@
"en": "What is the corresponding Wikidata entity?",
"nl": "Welk Wikidata-item komt overeen met dit object?"
},
"freeform": {
"key": "wikidata",
"type": "wikidata"
},
"mappings": [
{
"if": "wikidata=",
@ -21,7 +17,11 @@
},
"hideInAnswer": true
}
]
],
"freeform": {
"key": "wikidata",
"type": "wikidata"
}
},
"reviews": {
"render": "{reviews()}"
@ -62,10 +62,6 @@
},
"wikipedialink": {
"render": "<a href='https://wikipedia.org/wiki/{wikipedia}' target='_blank'><img src='./assets/wikipedia.svg' alt='WP'/></a>",
"freeform": {
"key": "wikidata",
"type": "wikidata"
},
"question": {
"en": "What is the corresponding item on Wikipedia?",
"nl": "Welk Wikipedia-artikel beschrijft dit object?"
@ -78,7 +74,11 @@
"nl": "Nog geen Wikipedia-artikel bekend"
}
}
]
],
"freeform": {
"key": "wikidata",
"type": "wikidata"
}
},
"email": {
"render": "<a href='mailto:{email}' target='_blank'>{email}</a>",
@ -190,7 +190,8 @@
"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": [
{
@ -281,7 +282,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": [
@ -326,7 +328,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",

View file

@ -73,7 +73,7 @@
],
"wayHandling": 2,
"deletion": {
"softDeletion": {
"softDeletionTags": {
"and": [
"amenity=",
"razed:amenity=post_box"

View file

@ -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"
}
}
}
}
}
}

View file

@ -3,6 +3,23 @@
"description": {
"question": "Ainda há algo de relevante que não tenha podido dar nas perguntas anteriores? Adicione-o aqui.<br/><span style='font-size: small'>Não repita factos já declarados</span>"
},
"dog-access": {
"mappings": {
"0": {
"then": "Os cães são permitidos"
},
"1": {
"then": "Os cães <b>não</b> 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 <b>não</b> 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?"
}
}
}
}

View file

@ -1367,5 +1367,56 @@
"description": "On this map, you'll find waste baskets near you. If a waste basket is missing on this map, you can add it yourself",
"shortDescription": "A map with waste baskets",
"title": "Waste Basket"
},
"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! :)<br/>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"
}
}

View file

@ -1022,7 +1022,8 @@
"toerisme_vlaanderen": {
"description": "Op deze kaart kan je info zien die relevant is voor toerisme, zoals:<br/><ul><li>Eetgelegenheden</li><li>Cafés en bars</li><li>(Fiets)oplaadpunten</li><li>Fietspompen, fietserverhuur en fietswinkels</li><li>Uitkijktorens</li><li>...</li></ul> 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.<br/><br/>Met de steun van Toerisme Vlaanderen<img src='./assets/themes/toerisme_vlaanderen/logo.png' />",
"shortDescription": "Een kaart om toeristisch relevante info op aan te duiden",
"title": "Toeristisch relevante info"
"title": "Toeristisch relevante info",
"descriptionTail": "Met de steun van Toerisme Vlaanderen<img style='height:5rem; width: auto;' src='./assets/themes/toerisme_vlaanderen/logo.png' />"
},
"toilets": {
"description": "Een kaart met openbare toiletten",