Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crossing refactoring #1201

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
02eb4d0
crossing/_marked: remove terms
tordans Apr 24, 2024
41a9443
cycleway/crossing: add "oneway" field to unmarked in bicycle_foot
tordans Apr 24, 2024
89a1671
cycleway/crossing: add "tactile_paving" to traffic_signal
tordans Apr 24, 2024
ca2b2e5
crossing: Introduce `@templates/crossing/defaults`
tordans Apr 24, 2024
e47e4d6
crossing: Introduce `@templates/crossing/geometry_line`
tordans Apr 24, 2024
50aeb69
crossing: Introduce `@templates/crossing/traffic_signal`
tordans Apr 24, 2024
c624700
crossing: Introduce `@templates/crossing/traffic_signal_more`
tordans Apr 24, 2024
99caf27
crossing: remove "oneway" on highway/crossing vertex
tordans Apr 24, 2024
cb4b64e
crossing: Add `kerb` to all vertex crossings
tordans Apr 24, 2024
3ab88d0
crossing: Use the same property order for `fields/crossing/markings*`
tordans Apr 24, 2024
cd56a0d
crossing: Move the `@templates/crossing/markings` to first field posi…
tordans Apr 24, 2024
30a8be9
crossing: Introduce `highway=path+path=crossing` fields
tordans Apr 24, 2024
75d756f
crossing: New approach with `@templates/crossing/bicycle_relevance` a…
tordans Apr 24, 2024
8ca0db5
crossing: Fix marking* templates by allowing `line` geometries
tordans Apr 25, 2024
46ac971
crossing: New approach with `@templates/crossing/bicycle_more`, addin…
tordans Apr 25, 2024
28638cf
crossing: Apply `flashing_light` to all `footway=crossing` and crossi…
tordans Apr 25, 2024
118ae02
crossing: Extract `tactile_paving` from shared `@template` to node cr…
tordans Apr 25, 2024
2cec131
crossing: Add readme for crossing presets and fields
tordans Apr 25, 2024
289a57b
crossing: Add readme docs on the `presets/@templates`
tordans Apr 26, 2024
fa267ab
Fix `npm run lint` by ignoring `*.md` files in `data`
tordans Apr 25, 2024
8bfaef1
Fix "Check file endings" workflow to also allow `.md` files
tordans Apr 25, 2024
6c0174e
crossing: Re-add `crossing` to all fields
tordans Apr 26, 2024
b1ab6e3
crossing: Add `lit` to all crossing "way" geometry presets via new `@…
tordans Apr 26, 2024
4381d3a
crossing: Fix fields order for highway/crossing
tordans Apr 26, 2024
14e30fa
fix typo, minor rewording
tyrasd May 22, 2024
ffef876
fix typos, finish sentences
tyrasd May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
ignore_words_list: "auxilary,casette,cemetary,chancel,discus,extentions,faiway,generat,goverment,guerilla,guyser,kindergarden,ore,pavillion,sculpter,storys,linz,te"
only_warn: 1

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
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}"
}
24 changes: 24 additions & 0 deletions data/presets/@templates/crossing/traffic_signal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"fields": [
"button_operated",
"traffic_signals/sound",
"traffic_signals/vibration"
],
"geometry": [
"point",
"line"
],
"tags": {
"@template": "crossing/traffic_signal"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
24 changes: 24 additions & 0 deletions data/presets/@templates/crossing/traffic_signal_more.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"moreFields": [
"traffic_signals/arrow",
"traffic_signals/countdown",
"traffic_signals/minimap"
],
"geometry": [
"point",
"line"
],
"tags": {
"@template": "crossing/traffic_signal_more"
},
"searchable": false,
"locationSet": {
"include": [
"999"
],
"exclude": [
"999"
]
},
"name": "{point}"
}
8 changes: 3 additions & 5 deletions data/presets/highway/crossing.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"fields": [
"crossing",
"tactile_paving",
"crossing/island",
"{@templates/crossing/markings}",
"crossing_raised"
"{@templates/crossing/defaults}",
"tactile_paving"
],
"moreFields": [
"flashing_lights",
"kerb",
"oneway"
"flashing_lights"
],
"geometry": [
"vertex"
Expand Down
25 changes: 25 additions & 0 deletions data/presets/highway/crossing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# About the crossing presets

## General

These presets use fields `@templates` to make sure all have a similar structure.
Some presets like `traffic_signals` have additional fields and use a different field order.
Try to keep the file structure very similar so they can be easily compared.

## nodes `highway=crossing + crossing=*`

Crossing nodes are handled by `highway/crossing.json` and `highway/crossing/*.json` (as geometry type `vertex`).

Crossing nodes and crossing ways have a big overlap.
However, there are a few tags that should _only_ be expected on the crossing node. When crossing ways are present, this also means there are separate ways attached with additional nodes that may hold these additional tags.

There are places in OSM that follow a different tagging style where only crossing ways are used (without the vertex nodes). Those regions might use other conventions on where to place each tag.

## ways `highway=footway|cycleway|path + *=crossing + crossing=*`

Crossing way presets are duplicated per highway class:
- `/highway/footway/crossing.json` + `/highway/footway/crossing/*.json`
- `/highway/cycleway/crossing.json` + `/highway/cycleway/crossing/*.json`
- `/highway/path/crossing.json` + `/highway/path/crossing/*.json`

The crossing presets for `/cycleway*` and `/path*` are considered to be relevant for bike traffic and have additional fields that target bike vs. foot traffic.
Loading
Loading