Skip to content

Commit

Permalink
SeparateSidewalkTagCheck [New Atlas Check] (#654)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vladlemberg authored Feb 15, 2022
1 parent 55e66d1 commit 8de81e7
Show file tree
Hide file tree
Showing 6 changed files with 1,197 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,18 @@
"tags":"highway"
}
},
"SeparateSidewalkTagCheck": {
"edge.length": 20.0,
"sidewalk.search.distance": 15.0,
"maximum.highway.type": "primary",
"challenge": {
"description": "Tasks contain separately mapped sidewalks that are inconsistent with highway's sidewalk tags.",
"blurb": "Modify sidewalks and highway sidewalks tags consistency",
"instruction": "Open your favorite editor and edit sidewalk tag",
"difficulty": "EASY",
"defaultPriority": "LOW"
}
},
"ShadowDetectionCheck": {
"challenge": {
"description": "Verify the height and level tags to make sure the building does not float in 3D",
Expand Down
1 change: 1 addition & 0 deletions docs/available_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ This document is a list of tables with a description and link to documentation f
| [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. |
| [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.
| [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. |
| [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). |
| [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. |
| ShortNameCheck | The short name check will validate that any and all names contain at least 2 letters in the name. |
| [StreetNameCheck](checks/streetNameCheck.md) |This check looks for "ss" or "ß" in street_name or name tags in AUT, CHE, DEU and LIE. |
Expand Down
43 changes: 43 additions & 0 deletions docs/checks/separateSidewalkTagCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Separate Sidewalk Tag Check

#### Description
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.

#### Live Example
Please note that examples below might be fixed olready.
1) [id:42023472](https://www.openstreetmap.org/way/42023472)
2) [id:415202408](https://www.openstreetmap.org/way/415202408)
3) [id:370064399](https://www.openstreetmap.org/way/370064399)
4) [id:684661218](https://www.openstreetmap.org/way/684661218)


#### Code Review
In [Atlas](https://github.com/osmlab/atlas), OSM elements are represented as Edges, Points, Lines,
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.
In OpenStreetMap, [Sidewalks](https://wiki.openstreetmap.org/wiki/Key:sidewalk) ma

Our first goal is to validate the incoming Atlas Object.
* Must be a valid main Edge
* Must have not already been flagged
* Must be car navigable
* Must have [Sidewalks](https://wiki.openstreetmap.org/wiki/Key:sidewalk) tags
* Must not be a closed way [OSM-wiki:Closed Way](https://wiki.openstreetmap.org/wiki/Item:Q4669)
* Must not be a [dual carriageway](https://wiki.openstreetmap.org/wiki/Tag:dual_carriageway%3Dyes).
* Must have a certain length (default 20 meters)

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)
to gather all sidewalks.

After we found separately mapped sidewalks, we ensure that
* Sidewalk is on the same layer with the highway
* Sidewalk is not crossing the highway
* Sidewalk is not sharing a location with the highway
* Sidewalk is more or less parallel with the highway

Our third goal is to identify the side (left|right) for every separately mapped sidewalk.

After we identified the side, we ensure that tagging of highway sidewalk is consistent with separately mapped sidewalk.


To learn more about the code, please look at the comments in the source code for the check.
[SeparateSidewalkTagCheck.java](../../src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SeparateSidewalkTagCheck.java)
Loading

0 comments on commit 8de81e7

Please sign in to comment.