Skip to content

Commit

Permalink
Suddenhighwaytypechange (osmlab#381)
Browse files Browse the repository at this point in the history
* new suddenhighwaytypechangecheck with simplified logic and more inline with osmose issue 1090.

* Updated check and required documents

* Fixed test issues

* Replacing strings with HighwayType.

* removing config default value

* updating documentation regarding the suddenhighwaytypechangecheck

* spotless apply

* fixing sonar cloud errors and spotless

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* consolidated conditionals to simplify final method

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* Update SuddenHighwayTypeChangeCheck.java

* removing marking connected edges as flagged to maximize detections.

* Update SuddenHighwayTypeChangeCheck.java

* fixing change requests from pull request.

* updated test checks for cases and addressed comments

* fixed config

* fixing code smells

* hopefully last spotless apply

* fixed config

* siplified the main functions with return true or false
  • Loading branch information
reichg authored Oct 23, 2020
1 parent 64a634e commit 05112bd
Show file tree
Hide file tree
Showing 6 changed files with 576 additions and 5 deletions.
30 changes: 25 additions & 5 deletions config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -920,16 +920,36 @@
"difficulty": "MEDIUM",
"defaultPriority": "LOW",
"highPriorityRule": {
"condition":"OR",
"rules":["highway=motorway","highway=motorway_link","highway=trunk","highway=trunk_link"]
"condition": "OR",
"rules": [
"highway=motorway",
"highway=motorway_link",
"highway=trunk",
"highway=trunk_link"
]
},
"mediumPriorityRule": {
"condition":"OR",
"rules":["highway=primary","highway=primary_link","highway=secondary","highway=secondary_link"]
"condition": "OR",
"rules": [
"highway=primary",
"highway=primary_link",
"highway=secondary",
"highway=secondary_link"
]
},
"tags":"highway"
"tags": "highway"
}
},
"SuddenHighwayTypeChangeCheck":{
"challenge": {
"description": "Identifies ways that have suspicious highway tag jumps.",
"blurb": "Sudden Highway Type Change",
"instruction": "Check if way has suspicious highway jump and make necessary adjust to tag.",
"difficulty": "MEDIUM",
"defaultPriority": "LOW"
},
"minHighwayType": "tertiary"
},
"UnusualLayerTagsCheck": {
"challenge": {
"description": "Tunnels (negative), junctions (zero) and bridges (zero or positive) should have meaningful layer tags attached to them. A missing layer tag implies layer value 0. If there is an explicit layer tag, then it must be between -5 and 5.",
Expand Down
1 change: 1 addition & 0 deletions docs/available_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This document is a list of tables with a description and link to documentation f
| [SingleSegmentMotorwayCheck](checks/singleSegmentMotorwayCheck.md) | The purpose of this check is to identify ways tagged with highway=motorway that are not connected to any ways tagged the same. |
| [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. |
| [SuddenHighwayTypeChangeCheck](checks/suddenHighwayTypeChangeCheck.md) | The purpose of this check is to identify roads that jump to much different highway classifications. |
| UnwalkableWaysCheck | The purpose of this check is to identify any non-motorway single carriageway edges with no foot tags that cross any high-priority roads that are dual carriageways. |
| ValenceOneImportantRoadCheck | This check identifies important roads that either start or end with valance-1 nodes. |

Expand Down
40 changes: 40 additions & 0 deletions docs/checks/suddenHighwayTypeChangeCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SuddenHighwayTypeChangeCheck

#### Description

The purpose of this check is to identify ways that have sudden highway tag jumps based on 3 different classes.

#### Live Examples
Sudden Highway Type Changes
1. The way [id:698449634](https://www.openstreetmap.org/way/698449634) jumps from primary road to tertiary road. Flagged edge even needs to be a link.

#### Code Review

This check evaluates [Edges](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Edge.java)
, it attempts to find large jumps in highway classifications.

##### Validating the Object
We first validate that the incoming object is:
* An Edge
* A Main edge
* The Edge is Car Navigable
* The Edge is of a specified minimum highway type (tertiary)
* The Edge is not a roundabout or circular

##### Flagging the Edge
Gather the ways' in and out edges. Iterate over these edges and determining if they fit within the 3 classifications of this check.

##### Three classifications of Sudden Highway Tag Changes
###### Class 1
* Way with following classification: **Motorway, Trunk, or Primary**
* Above way terminates and connects to following classification: **Tertiary, Unclassified, Residential, or Service**
###### Class 2
* Way with following classification: **Motorway_Link, Trunk_Link, Primary_Link, Secondary_Link, or Secondary**
* Above way terminates and connects to following classification: **Unclassified, Residential, or Service**
###### Class 3
* Way with following classification: **Tertiary or Tertiary_Link**
* Above way terminates and connects to following classification: **Living_Street, Service, or Track**


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

0 comments on commit 05112bd

Please sign in to comment.