Skip to content

Commit

Permalink
tollValidationCheck (#432)
Browse files Browse the repository at this point in the history
* new atlas check for tollescape

* tollEscapeCheck first iteration

* 3 case toll validation check

* 3 case check, finishing unit tests.

* spotless apply

* removing dockerfile to exclude it

* updated instructions, status: in false positive analysis phase.

* integration test fixes

* integration test fixes

* spotless apply and successful test.

* removing prints

* updating equals --> equalsIgnoreCase

* code smell cleanup

* code smells continued

* code smells continued

* code smells continued

* code smells continued

* code smells continued

* code smells continued

* code smells continued

* fixing config

* addressed comments regarding tollValidationCheck and added serislVersionUID for suddenHighwayTypeChangeCheck

* applied all rcommendations successfully.

* updated naming convention for angle related variables.

* had to update config variable and test config value to reflect updated variable names.

* new config value for limiting recursion while searching for nearby toll features and added more documentation for the config values..

* Fixed naming of angle difference function and addressed comments

* spotless apply

* Added auto fix suggestions for case 1 and 2
  • Loading branch information
reichg authored Dec 2, 2020
1 parent b8e8502 commit e9d14f8
Show file tree
Hide file tree
Showing 7 changed files with 841 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,17 @@
},
"minHighwayType": "tertiary"
},
"TollValidationCheck": {
"minimumHighwayType": "tertiary",
"maxAngleDiffForContiguousWays": 40.0,
"minInAndOutEdges": 1.0,
"maxIterationForNearbySearch": 15.0,
"challenge": {
"description": "Toll tags might be incorrect since tolls could possibly be avoided",
"blurb": "Toll Escape",
"instruction": "Please see instructions per feature for actions to take."
}
},
"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 @@ -85,6 +85,7 @@ This document is a list of tables with a description and link to documentation f
| [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. |
| ShortNameCheck | The short name check will validate that any and all names contain at least 2 letters in the name. |
| [StreetNameIntegersOnlyCheck](checks/streetNameIntegersOnlyCheck.md) | The purpose of this check is to identify streets whose names contain integers only. |
| [TollValidationCheck](checks/tollValidationCheck) | The purpose of this check is to identify ways that need to have their toll tags investigated/added/removed.
| [TunnelBridgeHeightLimitCheck](checks/tunnelBridgeHeightLimitCheck.md) | The purpose of this check is to identify roads with limited vertical clearance which do not have a maxheight tag. |
| [UnusualLayerTagsCheck](checks/unusualLayerTagsCheck.md) | The purpose of this check is to identify layer tag values when accompanied by invalid tunnel and bridge tags. |
| [ConditionalRestrictionCheck](checks/conditionalRestrictionCheck.md) | The purpose of this check is to identify elements that have a :conditional tag that does not respect the established format. |
Expand Down
46 changes: 46 additions & 0 deletions docs/checks/tollValidationCheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# TollValidationCheck

#### Description
The purpose of this check is to identify ways that need to have their toll tags investigated/added/removed.

#### Configurables
- ***minimumHighwayType***: minimum highway type to include in this check. Tolls mainly reside on highways.
- ***maxAngleDiffForContiguousWays***: maximum angle difference between edges to be considered contiguous ways. This is important since most of the toll related investigation is on highways with small angle turns.
- ***minInAndOutEdges***: minimum count of Main in AND out edges from given way. This is important because there is logic that relies on an edge that does have at least one edge on the downstream and upstream side.
- ***maxIterationForNearbySearch***: maximum amount of iterations to complete while searching for nearby toll features.

#### Live Examples
Way Intersects Toll Feature - Missing toll tag
1. The way [id:824285021](https://www.openstreetmap.org/way/824285021) intersects a toll feature and needs a toll=yes tag.

Inconsistent Toll Tags - way sandwiched between 2 toll=yes ways but does not have a toll tag
1. The way [id:498038529](https://www.openstreetmap.org/way/498038529) is inconsistent with its surrounding toll tags.

Escapable Toll - Way has routes that escape toll feature so toll should be investigated for removal
1. The way [id:2039409](https://www.openstreetmap.org/way/546540482) is deemed "escapable" since on either side of it there are ways with toll=no or no toll tag at all before
intersecting a toll feature. There needs to be an investigation as to if the way in question or the surrounding ways have been modeled properly.

#### 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)
* is not private access

##### Flagging the Edge
##### Three scenarios of TollValidationCheck
###### Scenario 1
* Way intersects toll feature but does not have a toll tag.
###### Scenario 2
* Way has inconsistent toll tagging compared to surrounding ways.
###### Scenario 3
* Toll is escapable so the edge in question should not have toll tag since a toll is not required to drive on the road.


To learn more about the code, please look at the comments in the source code for the check.
[TollValidationCheck.java](../../src/main/java/org/openstreetmap/atlas/checks/validation/tag/TollValidationCheck.java)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class SuddenHighwayTypeChangeCheck extends BaseCheck<Long>
private static final List<String> FALLBACK_INSTRUCTIONS = Collections
.singletonList(SUDDEN_HIGHWAY_TYPE_CHANGE_INSTRUCTION);
private static final String HIGHWAY_MINIMUM_DEFAULT = HighwayTag.RESIDENTIAL.toString();
private static final long serialVersionUID = -4091313755808560402L;
private final HighwayTag minHighwayType;

/**
Expand Down
Loading

0 comments on commit e9d14f8

Please sign in to comment.