Skip to content

Commit

Permalink
Merge branch 'main' into tordans-patch-6
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd authored Nov 13, 2024
2 parents 6657dbd + 5292df7 commit 4ab4051
Show file tree
Hide file tree
Showing 67 changed files with 599 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Follow these steps to test your PR yourself and make it a lot easier and faster
<!-- **Test the info-i** for your fields and preset and share relevant **screenshots** here.
The info needs to help mappers understand the preset and when to use it.
[Learn more…](https://github.com/tordans/id-tagging-schema/blob/main/CONTRIBUTING.md#info-i)
[Learn more…](https://github.com/openstreetmap/id-tagging-schema/blob/main/CONTRIBUTING.md#info-i)
-->
### Wording
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
notJSONs=`find data/ -type f -not -iname "*.json"`
for f in $notJSONs
disallowedFiles=`find data/ -type f -not -iname "*.json" -not -iname "*.md"`
for f in $disallowedFiles
do
echo "::error file=$f::File $f is not a .json file."
echo "::error file=$f::File $f is not a .json or .md file."
done
if [ ! -z "$notJSONs" ]; then exit 1; fi
if [ ! -z "$disallowedFiles" ]; then exit 1; fi
prettier:
name: Check for code formatting mistakes
Expand All @@ -23,7 +23,6 @@ jobs:
with:
node-version-file: '.nvmrc'
- run: npm clean-install
- run: 'for f in `find data/ -type f -not -iname "*.json"`; do echo "::error File $f is not a .json file."; done'
- run: npm run lint

codespell:
Expand All @@ -37,4 +36,3 @@ jobs:
skip: ./.git,./dist,./data/deprecated.json,./data/discarded.json
ignore_words_list: "auxilary,casette,cemetary,chancel,discus,extentions,faiway,generat,goverment,guerilla,guyser,kindergarden,ore,pavillion,sculpter,storys,linz,te"
only_warn: 1

9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ To make a change, update the corresponding file within the `data` folder: The `p

Icons from different sources (_icon sets_) can be used in the tagging schema. Head over to the [dedicated page](https://github.com/ideditor/schema-builder/blob/main/ICONS.md#icons) about how to use them.

### Info-`i`

![Screenshot of a preset in iD with the information details open.](https://github.com/openstreetmap/id-tagging-schema/assets/111561/13549318-cd7c-4dd1-9948-7a2d84662f04)

iD and other tools provide users with a way to learn more about the main tag of a preset. It is important to provide good information in this information panel. Here are a few notes on how to do this:
- Does your tag have a Wikidata entry? Click the small pencil icon next to the text to open the Wikidata item on the OSM wiki. Improve this wording if needed. If the Wikidata item is missing, [learn more about how to add it in "Current methods for creating new items"](https://wiki.openstreetmap.org/wiki/Data_items#Item_creation_process).
- Does your tag have a Wiki page with a good image?
- Your preset might need [a `reference` property](https://github.com/ideditor/schema-builder?tab=readme-ov-file#reference) to force the system to use a specific tag for the information section.

### Code Style

The input files are JSON files which use 4-space indentation. You can use the `npm run lint` command to check whether your files match the expected code style and run `npm run lint:fix` to reformat them if they don't do so.
Expand Down
4 changes: 3 additions & 1 deletion GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Consider the following:
- 📋 **Established Documentation**: The tagging schema will only consider tags that are well-documented on the OSM wiki. The documentation should be clear and unambiguous.
- 🏷️ **Established Tags Only**: No new or unestablished tags should be part of presets. Establishing tags must remain a community-driven process, not dictated by software implementation.
-**Proposal or Accepted**: A tag is considered established when it has completed the [proposal process](https://wiki.openstreetmap.org/wiki/Proposal_process) or is otherwise accepted by the OSM community. Factors include the tag's duration and frequency of use, whether its usage is increasing over time and its usage by mainstream data consumers.
- 🤷 **Useful Purpose**: Especially for less established tags, presets and fields should have a practical application. OSM allows for the collection of a wide variety of data, but not all of it is useful. For example, the brightness of street lamps might be documented, but it doesn't necessarily warrant a preset or field.
- 🤷 **Notable Purpose**: Especially for less established tags, presets and fields should have a practical application. OSM allows for the collection of a wide variety of data, some of it for niche purposes. For example, the brightness of street lamps might be documented, but it doesn't necessarily warrant a preset or field.
- 🕓 **Effort vs. Impact**: Consider whether the effort required is justified by the impact the preset or field will have. Assess how many elements this new type will apply to. This is particularly important if you do not plan to contribute the code changes yourself through a pull request (PR).

### User Experience
Expand Down Expand Up @@ -43,6 +43,8 @@ No preset or field is isolated; they are always presented alongside others in va
- There is a significant drop in usage compared to previous numbers, with a negative trend ([visible in the graph](https://taghistory.raifer.tech/)).
- Usage of the deprecated tag remains stagnant for a longer period (about a year).

In addition, the deprecated tag must have reasonably high usage to be considered. Low usage tags should be addressed through other cleanup methods, such as [MapRoulette](https://maproulette.org/) or similar initiatives.

**Deprecations are not for cleanup:**

Deprecation rules work such that the user sees a message with suggestions and can act only when editing the given element. This makes them well-suited for gradual, human-reviewed updates of taggings like crossings. However, they are not suitable for cleaning up incorrect tagging from the database, especially for low-volume changes.
Expand Down
8 changes: 8 additions & 0 deletions data/deprecated.json
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,14 @@
"old": {"man_made": "winery"},
"replace": {"craft": "winery"}
},
{
"old": {"map_type": "tactile_map", "information": "map"},
"replace": {"information": "tactile_map"}
},
{
"old": {"map_type": "tactile_model", "information": "map"},
"replace": {"information": "tactile_model"}
},
{
"old": {"maxage": "*"},
"replace": {"max_age": "$1"}
Expand Down
4 changes: 2 additions & 2 deletions data/fields/crossing/markings-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"options": [
Expand All @@ -15,6 +16,5 @@
"include": [
"BG"
]
},
"autoSuggestions": false
}
}
6 changes: 3 additions & 3 deletions data/fields/crossing/markings-DE-AT-CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"options": [
"zebra",
"yes",
Expand All @@ -10,9 +13,6 @@
"dashes",
"surface"
],
"autoSuggestions": false,
"iconsCrossReference": "{crossing/markings}",
"stringsCrossReference": "{crossing/markings}",
"locationSet": {
"include": [
"DE",
Expand Down
6 changes: 3 additions & 3 deletions data/fields/crossing/markings-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"options": [
"zebra",
"dots",
"surface",
"yes",
"no"
],
"autoSuggestions": false,
"iconsCrossReference": "{crossing/markings}",
"stringsCrossReference": "{crossing/markings}",
"locationSet": {
"include": [
"PL"
Expand Down
6 changes: 3 additions & 3 deletions data/fields/crossing/markings_yes-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"default": "yes",
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"default": "yes",
"options": [
"zebra",
"no",
Expand All @@ -16,6 +17,5 @@
"include": [
"BG"
]
},
"autoSuggestions": false
}
}
10 changes: 5 additions & 5 deletions data/fields/crossing/markings_yes-DE-AT-CH.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"default": "yes",
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"options": [
"zebra",
"yes",
Expand All @@ -10,15 +14,11 @@
"dashes",
"surface"
],
"autoSuggestions": false,
"iconsCrossReference": "{crossing/markings}",
"stringsCrossReference": "{crossing/markings}",
"locationSet": {
"include": [
"DE",
"AT",
"CH"
]
},
"default": "yes"
}
}
10 changes: 5 additions & 5 deletions data/fields/crossing/markings_yes-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"autoSuggestions": false,
"default": "yes",
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"options": [
"zebra",
"dots",
"surface",
"yes",
"no"
],
"autoSuggestions": false,
"iconsCrossReference": "{crossing/markings}",
"stringsCrossReference": "{crossing/markings}",
"locationSet": {
"include": [
"PL"
]
},
"default": "yes"
}
}
2 changes: 1 addition & 1 deletion data/fields/crossing/markings_yes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"key": "crossing:markings",
"type": "combo",
"label": "{crossing/markings}",
"default": "yes",
"stringsCrossReference": "{crossing/markings}",
"iconsCrossReference": "{crossing/markings}",
"default": "yes",
"locationSet": {
"exclude": [
"BG",
Expand Down
12 changes: 11 additions & 1 deletion data/fields/map_type.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"key": "map_type",
"type": "typeCombo",
"label": "Type"
"label": "Type",
"strings": {
"options": {
"topo": "Topographical Map",
"street": "Road Map",
"scheme": "Schematic Map",
"toposcope": "Toposcope"
}
},
"autoSuggestions": false,
"customValues": false
}
1 change: 1 addition & 0 deletions data/fields/vending.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"coffee": "Coffee",
"condoms": "Condoms",
"drinks": "Drinks",
"e-cigarettes": "E-Cigarettes",
"eggs": "Eggs",
"electronics": "Electronics",
"elongated_coin": "Souvenir Coins",
Expand Down
13 changes: 13 additions & 0 deletions data/presets/@templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# About `@templates`

Presets in `@templates` are a convention for a _virtual_ presets that are only used from inside other presets.

The only property that really matter for these special presets are the `fields`.

All other properties can be copied from existing template presets and ignored. They are default values that are meant to match all cases where they might be referenced.

## How to use

Inside another preset, reference the template – or any other preset - like `"{@templates/internet_access}"` in `fields` or `moreFields`. This will "copy" all the listed fields from the file `data/presets/@templates/internet_access.json`.

You can only "copy" (template) `fields` to (preset) `fields` and (template) `moreFields` to (preset) `moreFields`.
23 changes: 23 additions & 0 deletions data/presets/@templates/crossing/bicycle_more.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"moreFields": [
"oneway",
"access",
"segregated"
],
"geometry": [
"line"
],
"tags": {
"@template": "crossing/bicycle_more"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
23 changes: 23 additions & 0 deletions data/presets/@templates/crossing/defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"fields": [
"crossing/island",
"crossing_raised"
],
"geometry": [
"point",
"line"
],
"tags": {
"@template": "crossing/defaults"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
22 changes: 22 additions & 0 deletions data/presets/@templates/crossing/geometry_way_more.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"moreFields": [
"smoothness",
"lit"
],
"geometry": [
"line"
],
"tags": {
"@template": "crossing/geometry_way_more"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
3 changes: 2 additions & 1 deletion data/presets/@templates/crossing/markings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"crossing/markings-PL"
],
"geometry": [
"point"
"point",
"line"
],
"tags": {
"@template": "crossing/markings"
Expand Down
3 changes: 2 additions & 1 deletion data/presets/@templates/crossing/markings_yes.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"crossing/markings_yes-PL"
],
"geometry": [
"point"
"point",
"line"
],
"tags": {
"@template": "crossing/markings_yes"
Expand Down
22 changes: 22 additions & 0 deletions data/presets/@templates/crossing/surfacequality.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"fields": [
"surface",
"smoothness"
],
"geometry": [
"line"
],
"tags": {
"@template": "crossing/surfacequality"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
Loading

0 comments on commit 4ab4051

Please sign in to comment.