Skip to content

Commit

Permalink
Add new AtGradeSignPostCheck (osmlab#258)
Browse files Browse the repository at this point in the history
* Add check

* Handle roundabouts

* spotless and checkstyle

* Update roundabout req

* Use edge direction

* Spotless

* Update java doc and spotless

* Add doc

* Fix typo

* Fix checkstyle errors

* Clean up

* Address Pr comments

* Rename method for clarity

* Spotlessapply

* Fix checkstyle and update doc

* Add challenge config

* Typo

* Rename variable

* SpotlessApply

* nit

* Rename variable

* Fix checkstyle issues

* remove enabled config key

Co-authored-by: Daniel B <[email protected]>
  • Loading branch information
sayas01 and Daniel B authored Feb 19, 2020
1 parent cb1c7d1 commit 2fc5086
Show file tree
Hide file tree
Showing 6 changed files with 1,007 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -941,5 +941,19 @@
"difficulty": "MEDIUM",
"defaultPriority": "MEDIUM"
}
},
"AtGradeSignPostCheck": {
"connected.highway.types": {
"primary": ["trunk","primary","secondary"],
"trunk": ["primary"],
"secondary": ["primary"]
},
"challenge":{
"description":"This tasks contains at-grade intersections that are not part of destination_sign relations.",
"blurb":"Add/Fix destination_sign relations to at-grade intersections",
"instruction":"Open your favorite editor and check the instruction fr the task and add a destination_sign relation or destination_sign tag to the at-grade intersection.",
"difficulty":"NORMAL",
"defaultPriority":"MEDIUM"
}
}
}
1 change: 1 addition & 0 deletions docs/available_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This document is a list of tables with a description and link to documentation f
| [SinkIslandCheck](tutorials/tutorial3-SinkIslandCheck.md) | The purpose of this check is to identify whether a network of car-navigable Edges can be exited. |
| [SnakeRoadCheck](checks/snakeRoadCheck.md) | The purpose of the SnakeRoad check is to identify roads that should be split into two or more roads. |
| [InvalidPiersCheck](checks/invalidPiersCheck.md) | The purpose of this check is to identify piers(OSM Ways with man_made=pier tag) that are ingested in Atlas as edges with linear or polygonal geometry without an area=yes tag |
| [AtGradeSignPostCheck](checks/atGradeSignPostCheck.md) | The purpose of this check is to identify at-grade intersections that are not part of destination sign relations. |

## Nodes
| Check Name | Check Description |
Expand Down
31 changes: 31 additions & 0 deletions docs/checks/atGradeSignPostCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# AtGradeSignPostCheck

#### Description

This check identifies at-grade intersections that are not modeled into destination_sign relations.
An at-grade intersection is an intersection with two or more edges at the same level with valid
highway classifications. The highway classifications of the in and out edges of an at-grade intersection are specified in the configuration file and are as follows:
1. If in edge is of type primary, the intersection is valid if there are at least two out edges, at the same z level as the in edge, that are either trunk, primary or secondary.
2. If in edge is of type trunk or secondary, the intersection is valid if there are at least two out edges, at the same z level as the in edge, that are primary.

#### Live Examples

1. Node [id:393673917](https://www.openstreetmap.org/node/393673917) forms an at-grade intersection
with ways [393673917](https://www.openstreetmap.org/way/202447272),
[34370252](https://www.openstreetmap.org/way/34370252) and
[41234996](https://www.openstreetmap.org/way/41234996) but is not a member of a "destination_sign" relation.
2. Node [id:5351792253](https://www.openstreetmap.org/node/5351792253) forms an at-grade intersection with its exit road
[554569602](https://www.openstreetmap.org/way/554569602) but is not a member of a "destination_sign" relation.

#### Code Review

The check ensures that the Atlas object being evaluated is a [Node](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Node.java)
with a minimum node valence of 3. The node is a valid candidate for the check if it forms an intersection with edges at the same z-level with highway classification specified in the configurable.
Once the node is evaluated to be a valid at-grade intersection, check if it is a member of any destination_sign relations.
If the node is not part of a destination_sign relation, then flag the node along with the intersecting edges. Since a node can be part of multiple destination_sign
relations, check if all the valid intersecting edges are members of destination_sign relations. If there are edges missing destination_sign
relations, flag the node and the edges. If all the intersecting edges are members of relations, check if all the relations have destination tags.
If the relations are missing destination_sign tag, flag it. If the node is part of a roundabout, flag all the roundabout edges when flagging the node and its intersecting edges.

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

0 comments on commit 2fc5086

Please sign in to comment.