Skip to content

Commit 8de81e7

Browse files
authored
SeparateSidewalkTagCheck [New Atlas Check] (#654)
* SeparateSidewalkTagCheck initial draft * adding unit test * correcting sidewalkTagLeft|Right logic * arrangement * bug fix * spotless * refactoring cognitive complexity * removed nested ternary. * handling optional * handling optional for sonar * handling optional for sonar2 * refactoring cognitive complexity * add more unit test plus minor changes * add more logic for sidewalk=both case. more unit test coverage * extracting sidewalk analysis to separate method. * more unit test coverage * adding Check.md file and minor logic refinement. * fixed reverse heading case, add reverse heading unit test * additional unit test sor sidewalk=both * unit test combining footway=sidewalk with foot=designated plus negative edge sidewalk. * finalizing draft. * revert last changes. * spotless * alternative sidewalk mapping fix. * more unit test coverage, atlas bump, cosmetic
1 parent 55e66d1 commit 8de81e7

File tree

6 files changed

+1197
-0
lines changed

6 files changed

+1197
-0
lines changed

config/configuration.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,18 @@
10081008
"tags":"highway"
10091009
}
10101010
},
1011+
"SeparateSidewalkTagCheck": {
1012+
"edge.length": 20.0,
1013+
"sidewalk.search.distance": 15.0,
1014+
"maximum.highway.type": "primary",
1015+
"challenge": {
1016+
"description": "Tasks contain separately mapped sidewalks that are inconsistent with highway's sidewalk tags.",
1017+
"blurb": "Modify sidewalks and highway sidewalks tags consistency",
1018+
"instruction": "Open your favorite editor and edit sidewalk tag",
1019+
"difficulty": "EASY",
1020+
"defaultPriority": "LOW"
1021+
}
1022+
},
10111023
"ShadowDetectionCheck": {
10121024
"challenge": {
10131025
"description": "Verify the height and level tags to make sure the building does not float in 3D",

docs/available_checks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ This document is a list of tables with a description and link to documentation f
9999
| [MixedCaseNameCheck](checks/mixedCaseNameCheck.md) | The purpose of this check is to identify names that contain invalid mixed cases so that they can be edited to be the standard format. |
100100
| [RoadNameGapCheck](checks/RoadNameGapCheck.md) | The purpose of this check is to identify edge connected between two edges whose name tag is same. Flag the edge if the edge has a name tag different to name tag of edges connected to it or if there is no name tag itself.
101101
| [RoadNameSpellingConsistencyCheck](checks/RoadNameSpellingConsistencyCheck.md) | The purpose of this check is to identify road segments that have a name Tag with a different spelling from that of other segments of the same road. This check is primarily meant to catch small errors in spelling, such as a missing letter, letter accent mixups, or capitalization errors. |
102+
| [SeparateSidewalkTagCheck](checks/separateSidewalkTagCheck.md) | The purpose of this check is to validate tagging consistency between sidewalk=* tags are used on a highway with separately mapped sidewalk(s). |
102103
| [SimilarTagValueCheck](checks/SimilarTagValueCheck.md) | The purpose of this check is to identify tags whose values are either duplicates or similar enough to warrant someone to look at them. |
103104
| ShortNameCheck | The short name check will validate that any and all names contain at least 2 letters in the name. |
104105
| [StreetNameCheck](checks/streetNameCheck.md) |This check looks for "ss" or "ß" in street_name or name tags in AUT, CHE, DEU and LIE. |
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Separate Sidewalk Tag Check
2+
3+
#### Description
4+
A check to validate that when sidewalk=* tags are used on a highway that any separately mapped sidewalk(s) are consistent with the highway’s sidewalk tags.
5+
6+
#### Live Example
7+
Please note that examples below might be fixed olready.
8+
1) [id:42023472](https://www.openstreetmap.org/way/42023472)
9+
2) [id:415202408](https://www.openstreetmap.org/way/415202408)
10+
3) [id:370064399](https://www.openstreetmap.org/way/370064399)
11+
4) [id:684661218](https://www.openstreetmap.org/way/684661218)
12+
13+
14+
#### Code Review
15+
In [Atlas](https://github.com/osmlab/atlas), OSM elements are represented as Edges, Points, Lines,
16+
Nodes & Relations; in our case, we’re working with [Edges](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Edge.java) that have Sidewalk tags.
17+
In OpenStreetMap, [Sidewalks](https://wiki.openstreetmap.org/wiki/Key:sidewalk) ma
18+
19+
Our first goal is to validate the incoming Atlas Object.
20+
* Must be a valid main Edge
21+
* Must have not already been flagged
22+
* Must be car navigable
23+
* Must have [Sidewalks](https://wiki.openstreetmap.org/wiki/Key:sidewalk) tags
24+
* Must not be a closed way [OSM-wiki:Closed Way](https://wiki.openstreetmap.org/wiki/Item:Q4669)
25+
* Must not be a [dual carriageway](https://wiki.openstreetmap.org/wiki/Tag:dual_carriageway%3Dyes).
26+
* Must have a certain length (default 20 meters)
27+
28+
Our second goal is to search for [separately mapped Sidewalks](https://wiki.openstreetmap.org/wiki/Tag:highway%3Dfootway) around the Edge midpoint within certain search distance (default 15 meters). We use a [boxAround](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/Location.java#L211)
29+
to gather all sidewalks.
30+
31+
After we found separately mapped sidewalks, we ensure that
32+
* Sidewalk is on the same layer with the highway
33+
* Sidewalk is not crossing the highway
34+
* Sidewalk is not sharing a location with the highway
35+
* Sidewalk is more or less parallel with the highway
36+
37+
Our third goal is to identify the side (left|right) for every separately mapped sidewalk.
38+
39+
After we identified the side, we ensure that tagging of highway sidewalk is consistent with separately mapped sidewalk.
40+
41+
42+
To learn more about the code, please look at the comments in the source code for the check.
43+
[SeparateSidewalkTagCheck.java](../../src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SeparateSidewalkTagCheck.java)

0 commit comments

Comments
 (0)