From 5be577e407c3433cabc5868f998b46f2ee98c09c Mon Sep 17 00:00:00 2001 From: jwpgage Date: Fri, 4 Sep 2020 10:55:41 -0700 Subject: [PATCH] Replace some non-inclusive language (#354) * replaced master * changed whitelist/blacklist * fixed travis.yml * fixed circleci --- .circleci/config.yml | 2 +- .travis.yml | 6 +- .travis/deploy.sh | 2 +- .travis/install.sh | 2 +- ...ster-gate.sh => merge-dev-to-main-gate.sh} | 2 +- ...-dev-to-master.sh => merge-dev-to-main.sh} | 4 +- .../{tag-master-gate.sh => tag-main-gate.sh} | 2 +- .travis/{tag-master.sh => tag-main.sh} | 2 +- .travis/trigger-release.sh | 4 +- README.md | 4 +- config/configuration.json | 2 +- dependencies.gradle | 4 +- .../RoadNameSpellingConsistencyCheck.md | 2 +- docs/checks/approximateWayCheck.md | 2 +- docs/checks/bridgeDetailedInfoCheck.md | 2 +- docs/checks/duplicateWaysCheck.md | 10 +- docs/checks/highwayToFerryTagCheck.md | 2 +- docs/checks/invalidAccessTagCheck.md | 2 +- docs/checks/invalidLanesTagCheck.md | 4 +- docs/checks/invalidMiniRoundaboutCheck.md | 2 +- docs/checks/malformedRoundaboutCheck.md | 2 +- docs/checks/roundaboutMissingTagCheck.md | 2 +- docs/checks/roundaboutValenceCheck.md | 2 +- docs/checks/singleSegmentMotorwayCheck.md | 2 +- docs/debugging.md | 2 +- docs/shardedchecks.md | 2 +- docs/standalone.md | 2 +- gradle.properties | 7 +- .../atlas/checks/base/BaseCheck.java | 45 ++--- .../checks/base/CheckResourceLoader.java | 39 ++--- .../database/FlagDatabaseSubCommand.java | 18 +- .../distributed/IntegrityCheckSparkJob.java | 7 +- .../ShardedIntegrityChecksSparkJob.java | 7 +- .../areas/AreasWithHighwayTagCheck.java | 5 +- .../PedestrianAreaOverlappingEdgeCheck.java | 2 +- .../intersections/AtGradeSignPostCheck.java | 10 +- .../intersections/EdgeCrossingEdgeCheck.java | 2 +- .../LineCrossingWaterBodyCheck.java | 31 ++-- .../SelfIntersectingPolylineCheck.java | 7 +- .../intersections/UnwalkableWaysCheck.java | 4 +- .../linear/MalformedPolyLineCheck.java | 2 +- .../linear/edges/ApproximateWayCheck.java | 19 +- .../linear/edges/DuplicateWaysCheck.java | 8 +- .../linear/edges/FloatingEdgeCheck.java | 16 +- .../InconsistentRoadClassificationCheck.java | 28 +-- .../linear/edges/InvalidPiersCheck.java | 14 +- .../linear/edges/LongSegmentCheck.java | 4 +- .../edges/MalformedRoundaboutCheck.java | 6 +- .../linear/edges/OverlappingEdgeCheck.java | 12 +- .../linear/edges/RoadLinkCheck.java | 6 +- .../edges/RoundaboutClosedLoopCheck.java | 8 +- .../edges/RoundaboutMissingTagCheck.java | 9 +- .../linear/edges/RoundaboutValenceCheck.java | 8 +- .../linear/edges/ShortSegmentCheck.java | 20 +-- .../linear/edges/SignPostCheck.java | 4 +- .../edges/SingleSegmentMotorwayCheck.java | 4 +- .../linear/edges/SnakeRoadCheck.java | 8 +- .../linear/edges/SnakeRoadNetworkWalk.java | 22 +-- .../points/AddressStreetNameCheck.java | 2 +- .../validation/points/ConnectivityCheck.java | 25 ++- .../points/InvalidMiniRoundaboutCheck.java | 14 +- .../validation/points/NodeValenceCheck.java | 2 +- .../InvalidSignBoardRelationCheck.java | 10 +- .../tag/BridgeDetailedInfoCheck.java | 4 +- .../tag/ConflictingTagCombinationCheck.java | 6 +- .../tag/HighwayToFerryTagCheck.java | 2 +- .../tag/ImproperAndUnknownRoadNameCheck.java | 2 +- .../validation/tag/InvalidAccessTagCheck.java | 2 +- .../validation/tag/InvalidLanesTagCheck.java | 4 +- .../validation/tag/MixedCaseNameCheck.java | 4 +- .../validation/tag/RoadNameGapCheck.java | 6 +- .../tag/RoadNameSpellingConsistencyCheck.java | 2 +- ...oadNameSpellingConsistencyCheckWalker.java | 9 +- .../tag/StreetNameIntegersOnlyCheck.java | 2 +- .../validation/tag/UnusualLayerTagsCheck.java | 2 +- .../atlas/checks/vectortiles/README.md | 2 +- .../checks/base/CheckResourceLoaderTest.java | 162 +++++++++--------- .../atlas/checks/base/CountryTest.java | 52 +++--- .../atlas/checks/base/TagTest.java | 10 +- .../checks/base/checks/BaseTestRule.java | 4 +- .../database/FlagDatabaseSubCommandTest.java | 17 +- .../ShardedIntegrityChecksSparkJobTest.java | 2 +- .../EdgeCrossingEdgeCheckTest.java | 4 +- .../EdgeCrossingEdgeCheckTestRule.java | 6 +- .../LineCrossingWaterBodyCheckTestRule.java | 6 +- .../edges/RoundaboutClosedLoopCheckTest.java | 36 ++-- .../RoundaboutClosedLoopCheckTestRule.java | 54 +++--- .../points/ConnectivityCheckTest.java | 10 +- ...InvalidSignBoardRelationCheckTestRule.java | 4 +- .../tag/BridgeDetailedInfoCheckTest.java | 4 +- .../tag/BridgeDetailedInfoCheckTestRule.java | 6 +- 91 files changed, 462 insertions(+), 473 deletions(-) rename .travis/{merge-dev-to-master-gate.sh => merge-dev-to-main-gate.sh} (81%) rename .travis/{merge-dev-to-master.sh => merge-dev-to-main.sh} (96%) rename .travis/{tag-master-gate.sh => tag-main-gate.sh} (85%) rename .travis/{tag-master.sh => tag-main.sh} (98%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5da06a664..be6eb50b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2 general: branches: only: - - master + - main - dev jobs: build: diff --git a/.travis.yml b/.travis.yml index 9005eeb73..7b997cb14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - ENCRYPTED_GPG_KEY_LOCATION=".travis/secring.gpg.enc" branches: only: - - master + - main - dev language: java dist: xenial @@ -31,6 +31,6 @@ script: - chmod -R ug+x .travis - .travis/build.sh - .travis/sonar-gate.sh - - .travis/merge-dev-to-master-gate.sh + - .travis/merge-dev-to-main-gate.sh - .travis/deploy-gate.sh - - .travis/tag-master-gate.sh + - .travis/tag-main-gate.sh diff --git a/.travis/deploy.sh b/.travis/deploy.sh index 7a4a557e6..4cb5aa74b 100644 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; +if [ "$TRAVIS_BRANCH" = "main" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then if [ "$MANUAL_RELEASE_TRIGGERED" = "true" ]; then diff --git a/.travis/install.sh b/.travis/install.sh index cdfcfa76d..182ae8712 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; +if [ "$TRAVIS_BRANCH" = "main" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_2214f55a5f38_key -iv $encrypted_2214f55a5f38_iv -in $ENCRYPTED_GPG_KEY_LOCATION -out $GPG_KEY_LOCATION -d fi diff --git a/.travis/merge-dev-to-master-gate.sh b/.travis/merge-dev-to-main-gate.sh similarity index 81% rename from .travis/merge-dev-to-master-gate.sh rename to .travis/merge-dev-to-main-gate.sh index 7710552be..f20cfefd2 100644 --- a/.travis/merge-dev-to-master-gate.sh +++ b/.travis/merge-dev-to-main-gate.sh @@ -2,7 +2,7 @@ if [ $TRAVIS_TEST_RESULT -eq 0 ]; then - .travis/merge-dev-to-master.sh + .travis/merge-dev-to-main.sh RETURN_VALUE=$? if [ "$RETURN_VALUE" != "0" ]; then diff --git a/.travis/merge-dev-to-master.sh b/.travis/merge-dev-to-main.sh similarity index 96% rename from .travis/merge-dev-to-master.sh rename to .travis/merge-dev-to-main.sh index 9d40c6fb0..97cd27c98 100644 --- a/.travis/merge-dev-to-master.sh +++ b/.travis/merge-dev-to-main.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh GITHUB_REPO="osmlab/atlas-checks" -MERGE_BRANCH=master +MERGE_BRANCH=main SOURCE_BRANCH=dev FUNCTION_NAME="merge-$SOURCE_BRANCH-to-$MERGE_BRANCH" @@ -23,7 +23,7 @@ then fi : ${GITHUB_SECRET_TOKEN:?"GITHUB_SECRET_TOKEN needs to be set in .travis.yml!"} -: ${TRAVIS_COMMIT:?"TRAVIS_COMMIT needs to be available to merge the right commit to master!"} +: ${TRAVIS_COMMIT:?"TRAVIS_COMMIT needs to be available to merge the right commit to main!"} TEMPORARY_REPOSITORY=$(mktemp -d) git clone "https://github.com/$GITHUB_REPO" "$TEMPORARY_REPOSITORY" diff --git a/.travis/tag-master-gate.sh b/.travis/tag-main-gate.sh similarity index 85% rename from .travis/tag-master-gate.sh rename to .travis/tag-main-gate.sh index 97dbba9c8..f949b4a02 100644 --- a/.travis/tag-master-gate.sh +++ b/.travis/tag-main-gate.sh @@ -2,7 +2,7 @@ if [ $TRAVIS_TEST_RESULT -eq 0 ]; then - .travis/tag-master.sh + .travis/tag-main.sh RETURN_VALUE=$? if [ "$RETURN_VALUE" != "0" ]; then diff --git a/.travis/tag-master.sh b/.travis/tag-main.sh similarity index 98% rename from .travis/tag-master.sh rename to .travis/tag-main.sh index 1d4ecf52c..07daf51ef 100644 --- a/.travis/tag-master.sh +++ b/.travis/tag-main.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh GITHUB_REPO="osmlab/atlas-checks" -RELEASE_BRANCH=master +RELEASE_BRANCH=main FUNCTION_NAME="tag-$RELEASE_BRANCH" diff --git a/.travis/trigger-release.sh b/.travis/trigger-release.sh index 06662b74f..aab65d4d2 100755 --- a/.travis/trigger-release.sh +++ b/.travis/trigger-release.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# Use Travis to trigger a release from Master +# Use Travis to trigger a release from Main GITHUB_ORGANIZATION=osmlab GITHUB_REPOSITORY_NAME=atlas-checks @@ -18,7 +18,7 @@ body=' { "request": { - "branch": "master", + "branch": "main", "config": { "before_script": "export MANUAL_RELEASE_TRIGGERED=true" diff --git a/README.md b/README.md index f280f27c5..aaf021b50 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Atlas Checks -[![Build Status](https://travis-ci.org/osmlab/atlas-checks.svg?branch=master)](https://travis-ci.org/osmlab/atlas-checks) +[![Build Status](https://travis-ci.org/osmlab/atlas-checks.svg?branch=main)](https://travis-ci.org/osmlab/atlas-checks) [![quality gate](https://sonarcloud.io/api/project_badges/measure?project=org.openstreetmap.atlas%3Aatlas-checks&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.openstreetmap.atlas%3Aatlas-checks) [![Maven Central](https://img.shields.io/maven-central/v/org.openstreetmap.atlas/atlas-checks.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.openstreetmap.atlas%22%20AND%20a:%22atlas-checks%22) -[![CircleCI](https://circleci.com/gh/osmlab/atlas-checks/tree/master.svg?style=svg)](https://circleci.com/gh/osmlab/atlas-checks/tree/master) +[![CircleCI](https://circleci.com/gh/osmlab/atlas-checks/tree/main.svg?style=svg)](https://circleci.com/gh/osmlab/atlas-checks/tree/main) --- diff --git a/config/configuration.json b/config/configuration.json index 8826bce59..cf49c83cc 100644 --- a/config/configuration.json +++ b/config/configuration.json @@ -161,7 +161,7 @@ }, "ConnectivityCheck": { "nearby.edge.distance.meters": 2.0, - "blacklisted.highway.filter": "highway->no", + "denylisted.highway.filter": "highway->no", "challenge": { "description": "Checks if a node should be connected to a nearby node or edge.", "blurb": "Connectivity Check", diff --git a/dependencies.gradle b/dependencies.gradle index a02dc1715..88af77aa5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,9 @@ project.ext.versions = [ checkstyle: '8.18', jacoco: '0.8.3', - atlas: '6.2.4', + atlas: '6.2.8', commons:'2.6', - atlas_generator: '5.0.3', + atlas_generator: '5.1.6', atlas_checkstyle: '5.6.9', postgis: '2.1.7.2', postgres: '42.2.6', diff --git a/docs/checks/RoadNameSpellingConsistencyCheck.md b/docs/checks/RoadNameSpellingConsistencyCheck.md index 86b96acd9..064f13805 100644 --- a/docs/checks/RoadNameSpellingConsistencyCheck.md +++ b/docs/checks/RoadNameSpellingConsistencyCheck.md @@ -17,7 +17,7 @@ The check provides the user with a collection of flagged road segments and their ### Code Review -The check starts by ensuring a given AtlasObject is a named Master Edge that has not been flagged and is of a high enough HighwayTag priority. The check then collects all Edges that have a common connection to the starting Edge and are also within a configurable search area. The collected Edges are filtered for those that have names that are at an edit distance of 1 from the starting Edge's name. However, there are exceptions in this process. If two Edges' names contain different numbers or space-delimited characters, they are not considered to have inconsistent spelling with one another and are not flagged. +The check starts by ensuring a given AtlasObject is a named Main Edge that has not been flagged and is of a high enough HighwayTag priority. The check then collects all Edges that have a common connection to the starting Edge and are also within a configurable search area. The collected Edges are filtered for those that have names that are at an edit distance of 1 from the starting Edge's name. However, there are exceptions in this process. If two Edges' names contain different numbers or space-delimited characters, they are not considered to have inconsistent spelling with one another and are not flagged. Any Edges whose names are within 1 edit distance of each other are flagged. For the source code for this check, please refer to [RoadNameSpellingConsistencyCheck](../../src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheck.java) diff --git a/docs/checks/approximateWayCheck.md b/docs/checks/approximateWayCheck.md index 6cbfba3be..7f28ddb36 100644 --- a/docs/checks/approximateWayCheck.md +++ b/docs/checks/approximateWayCheck.md @@ -19,7 +19,7 @@ This check evaluates [Edges](https://github.com/osmlab/atlas/blob/dev/src/main/j ##### Validating the Object We first validate that the incoming object is: * An Edge -* A Master edge +* A Main edge * The Edge is Car Navigable * The Edge is of a specified minimum highway type diff --git a/docs/checks/bridgeDetailedInfoCheck.md b/docs/checks/bridgeDetailedInfoCheck.md index d05aa871d..d3793ce66 100644 --- a/docs/checks/bridgeDetailedInfoCheck.md +++ b/docs/checks/bridgeDetailedInfoCheck.md @@ -17,7 +17,7 @@ Way [id:4407849](https://www.openstreetmap.org/way/4407849) represents a promine The validation section ensures that the Atlas object being evaluated is an [Edge](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Edge.java) with the following tags: * `bridge=yes` * `railway` -or- `highway` with one of the values: `motorway`, `trunk`, `primary`, `secondary`. -Only _master_ Edges are valid candidates for this check, to avoid duplicate flags on a single bi-directional Way. +Only _main_ Edges are valid candidates for this check, to avoid duplicate flags on a single bi-directional Way. The check section flags a valid candidate Edge if it is longer than the configurable minimum but does not have a `bridge:structure` tag. diff --git a/docs/checks/duplicateWaysCheck.md b/docs/checks/duplicateWaysCheck.md index 7bccb807c..b9a1c330b 100644 --- a/docs/checks/duplicateWaysCheck.md +++ b/docs/checks/duplicateWaysCheck.md @@ -21,7 +21,7 @@ We’ll use this information to filter our potential flag candidates. Our first goal is to validate the incoming Atlas Object. We know two things about roundabouts: * Must be a valid Edge -* Must be a master Edge +* Must be a main Edge * Must be car-navigable * Must not be part of an area * Must have not already been flagged @@ -32,8 +32,8 @@ Our first goal is to validate the incoming Atlas Object. We know two things abou public boolean validCheckForObject(final AtlasObject object) { return object instanceof Edge - // Check to see that the Edge is a master Edge - && Edge.isMasterEdgeIdentifier(object.getIdentifier()) + // Check to see that the Edge is a main Edge + && Edge.isMainEdgeIdentifier(object.getIdentifier()) // Check to see that the edge has not already been seen && !this.isFlagged(object.getIdentifier()) // Check to see that the edge is car navigable @@ -55,9 +55,9 @@ statements to validate whether we do in fact want to flag the feature for inspec final Rectangle bounds = edge.asPolyLine().bounds(); // Get Edges which are contained by or intersect the bounds, and then filter - // Out the non-master Edges as the bounds Edges are not guaranteed to be uni-directional + // Out the non-main Edges as the bounds Edges are not guaranteed to be uni-directional final Iterable edgesInBounds = edge.getAtlas().edgesIntersecting(bounds, - Edge::isMasterEdge); + Edge::isMainEdge); for (final Edge edgeInBounds : edgesInBounds) { diff --git a/docs/checks/highwayToFerryTagCheck.md b/docs/checks/highwayToFerryTagCheck.md index 06f17d0a1..9219d0c22 100644 --- a/docs/checks/highwayToFerryTagCheck.md +++ b/docs/checks/highwayToFerryTagCheck.md @@ -22,7 +22,7 @@ has *route=FERRY* and *highway=TERTIARY* Tags. Since this is a ferry route, the In Atlas, OSM elements are represented as Points, Lines, Edges, Areas and Relations. In our case, we're looking at edges. The incoming Atlas object must meet the following criteria to be considered for flagging: -* Has to be a Master Edge and its OSM id should not have already been flagged +* Has to be a Main Edge and its OSM id should not have already been flagged * Has a *route=FERRY* Tag * Has a highway Tag with priority greater than or equal to a minimum highway type. The default minimum highway type is PATH which includes MOTORWAY, MOTORWAY_LINK, TRUNK,TRUNK_LINK, PRIMARY, diff --git a/docs/checks/invalidAccessTagCheck.md b/docs/checks/invalidAccessTagCheck.md index b0ef91f6e..e84b3765f 100644 --- a/docs/checks/invalidAccessTagCheck.md +++ b/docs/checks/invalidAccessTagCheck.md @@ -33,7 +33,7 @@ In [Atlas](https://github.com/osmlab/atlas) roads can only be Edges and Lines, a public boolean validCheckForObject(final AtlasObject object) { return AccessTag.isNo(object) && ((object instanceof Edge) || (object instanceof Line)) - && Edge.isMasterEdgeIdentifier(object.getIdentifier()) + && Edge.isMainEdgeIdentifier(object.getIdentifier()) && !this.isFlagged(object.getOsmIdentifier()) && isMinimumHighway(object); } ``` diff --git a/docs/checks/invalidLanesTagCheck.md b/docs/checks/invalidLanesTagCheck.md index 15055db3f..6be960029 100644 --- a/docs/checks/invalidLanesTagCheck.md +++ b/docs/checks/invalidLanesTagCheck.md @@ -31,7 +31,7 @@ public boolean validCheckForObject(final AtlasObject object) { return Validators.hasValuesFor(object, LanesTag.class) && HighwayTag.isCarNavigableHighway(object) && object instanceof Edge - && ((Edge) object).isMasterEdge() && !this.lanesFilter.test(object) + && ((Edge) object).isMainEdge() && !this.lanesFilter.test(object) && !this.isFlagged(object.getOsmIdentifier()); } ``` @@ -103,7 +103,7 @@ private HashSet connectedInvalidLanes(final AtlasObject object) polledEdge = toProcess.poll(); for (final Edge edge : polledEdge.connectedEdges()) { - if (!connectedEdges.contains(edge) && ((Edge) object).isMasterEdge() + if (!connectedEdges.contains(edge) && ((Edge) object).isMainEdge() && Validators.hasValuesFor(edge, LanesTag.class) && HighwayTag.isCarNavigableHighway(edge) && !this.lanesFilter.test(edge)) { diff --git a/docs/checks/invalidMiniRoundaboutCheck.md b/docs/checks/invalidMiniRoundaboutCheck.md index 7da0912be..3346b1be9 100644 --- a/docs/checks/invalidMiniRoundaboutCheck.md +++ b/docs/checks/invalidMiniRoundaboutCheck.md @@ -7,7 +7,7 @@ meet the following conditions: - Is a `Node` object - Has the tag `highway=MINI_ROUNDABOUT` - Has less than `valence.minimum` number of car-navigable connecting edges AND - - Has exactly two connecting edges and exactly one of those edges is a master edge OR + - Has exactly two connecting edges and exactly one of those edges is a main edge OR - The node has neither `direction=CLOCKWISE` nor `direction=ANTICLOCKWISE` values After performing sensitivity analysis, the best value for `valence.minimum` was determined to be 6, diff --git a/docs/checks/malformedRoundaboutCheck.md b/docs/checks/malformedRoundaboutCheck.md index 41f425584..bfb6b2e7b 100644 --- a/docs/checks/malformedRoundaboutCheck.md +++ b/docs/checks/malformedRoundaboutCheck.md @@ -32,7 +32,7 @@ Our first goal is to validate the incoming Atlas Object. We know two things abou * Must have an `iso_country_code` tag * Must have not already been flagged * Must have `junction=roundabout` tag -* Must be master edge +* Must be main edge * Must not have a highway tag value of `cycleway`, `footway`, or `pedestrian` After the preliminary filtering of features, we need to get all the roundabout's edges. We use a diff --git a/docs/checks/roundaboutMissingTagCheck.md b/docs/checks/roundaboutMissingTagCheck.md index 16bb2c020..902045acc 100644 --- a/docs/checks/roundaboutMissingTagCheck.md +++ b/docs/checks/roundaboutMissingTagCheck.md @@ -18,7 +18,7 @@ In OpenStreetMap, roundabouts are [Ways](https://wiki.openstreetmap.org/wiki/Way the `junction=roundabout` tag. We’ll identify ways that are roundabouts without `junction=roundabout` tag. Our first goal is to validate the incoming Atlas Object. -* Must be a first section of valid master Edge +* Must be a first section of valid main Edge * Must have not already been flagged * Must be car navigable * Must have not `junction` and `area` tag diff --git a/docs/checks/roundaboutValenceCheck.md b/docs/checks/roundaboutValenceCheck.md index 6d2001be6..62777b668 100644 --- a/docs/checks/roundaboutValenceCheck.md +++ b/docs/checks/roundaboutValenceCheck.md @@ -23,7 +23,7 @@ In OpenStreetMap, roundabouts are [Ways](https://wiki.openstreetmap.org/wiki/Way the `junction=roundabout` tag. We’ll use this information to filter our potential flag candidates. Our first goal is to validate the incoming Atlas Object. We know two things about roundabouts: -* Must be a valid master Edge +* Must be a valid main Edge * Must have not already been flagged * Must have `junction=roundabout` tag * Must be car navigable diff --git a/docs/checks/singleSegmentMotorwayCheck.md b/docs/checks/singleSegmentMotorwayCheck.md index 920cfa857..8a19cc791 100644 --- a/docs/checks/singleSegmentMotorwayCheck.md +++ b/docs/checks/singleSegmentMotorwayCheck.md @@ -13,7 +13,7 @@ It is also connected to a roundabout tagged as motorway, but this is ignored (se In [Atlas](https://github.com/osmlab/atlas), OSM elements are represented as Edges, Points, Lines, Nodes, Areas & Relations; in our case, we’re are looking at [Edges](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Edge.java). -This check first validates object by checking that they are master Edges, tagged as motorways, not roundabouts, and their OSM id has not already been flagged. +This check first validates object by checking that they are main Edges, tagged as motorways, not roundabouts, and their OSM id has not already been flagged. Next the valid objects have their connected edges checked to see if there are any tagged with motorway that are not roundabouts. If none are found the edge is flagged. diff --git a/docs/debugging.md b/docs/debugging.md index e9da81372..6e1636c78 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -43,7 +43,7 @@ In Intellij, a configuration is used to run a project. With the setup above you - countries=[ISO3 country code comma separated list] - maproulette=[Maproulette configuration in format "server:host:project:api_key"] - saveCheckOutput=false - - master=local + - cluster=local - configFiles=[Points to the configuration file, should be something like file:/atlas_checks_root_dir/config/configuration.json] - sparkOptions=spark.executor.memory->4g,spark.driver.memory->4g,spark.rdd.compress->true diff --git a/docs/shardedchecks.md b/docs/shardedchecks.md index 18996d88c..94ea269c5 100644 --- a/docs/shardedchecks.md +++ b/docs/shardedchecks.md @@ -42,7 +42,7 @@ The following are brief descriptions of the parameters that Sharded Atlas Checks | Output Formats | Comma separated list of output types (flags,geojson,metrics,tippecanoe); MapRoulette output is not available in Sharded Checks | | Countries | Comma separated list of ISO3 country codes of countries to run | | Configuration File | Comma separated list of resource URIs for checks configuration json files | -| Master | Spark cluster master URL (just `local` for local environments) | +| Cluster | Spark cluster URL (just `local` for local environments) | ## Limitations diff --git a/docs/standalone.md b/docs/standalone.md index c8386438b..55030cfda 100644 --- a/docs/standalone.md +++ b/docs/standalone.md @@ -92,7 +92,7 @@ Atlas Checks locally. The following variables are set in the [gradle.properties] - checks.local.outputFormat - Which output formats to produced. - checks.local.startedFolder - A folder used for Spark to work in, this should generally remain unchanged. - checks.local.countries - The country that is being used to run the checks over. Currently for local standalone this is limited to a single country. -- checks.local.master - This defines the master URL for the cluster, for running locally this should never be changed and remain "local". +- checks.local.cluster - This defines the URL for the cluster, for running locally this should never be changed and remain "local". - checks.local.sparkOptions - Any custom options that are subsequently sent to Spark. See [Spark Configuration](https://spark.apache.org/docs/1.6.0/configuration.html) for more information. - checks.local.compressOutput - Whether to create compressed output files or not. diff --git a/gradle.properties b/gradle.properties index cf3e895b1..17ab4d5f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,16 @@ group=org.openstreetmap.atlas version=6.0.12-SNAPSHOT - maven2_url=https://oss.sonatype.org/service/local/staging/deploy/maven2/ snapshot_url=https://oss.sonatype.org/content/repositories/snapshots/ project_name="OSM Atlas Checks" project_description="Tool to run data checks over OSM Atlas data" project_url=https://github.com/osmlab/atlas-checks -project_license_url=https://github.com/osmlab/atlas-checks/blob/master/LICENSE +project_license_url=https://github.com/osmlab/atlas-checks/blob/main/LICENSE project_license_slug="BSD 3 Clause" project_developer=matthieun project_scm=scm:git:https://github.com/osmlab/atlas-checks.git - # Run profiles profile=local - ## Local (default) checks.local.sharded=true checks.local.configFiles=file://@ROOTDIR@/config/configuration.json @@ -25,6 +22,6 @@ checks.local.countries=BLZ checks.local.savePbfAtlas=true checks.local.compressOutput=false checks.local.startedFolder=file://@BUILDDIR@/example/tmp/ -checks.local.master=local +checks.local.cluster=local checks.local.multiAtlas=true checks.local.sparkOptions=spark.executor.memory->4g,spark.driver.memory->4g,spark.rdd.compress->true diff --git a/src/main/java/org/openstreetmap/atlas/checks/base/BaseCheck.java b/src/main/java/org/openstreetmap/atlas/checks/base/BaseCheck.java index 5f897b71d..57000c673 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/base/BaseCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/base/BaseCheck.java @@ -45,17 +45,17 @@ public abstract class BaseCheck implements Check, Serializable { public static final String PARAMETER_ACCEPT_PIERS = "accept.piers"; - public static final String PARAMETER_BLACKLIST_COUNTRIES = "countries.blacklist"; + public static final String PARAMETER_DENYLIST_COUNTRIES = "countries.denylist"; public static final String PARAMETER_CHALLENGE = "challenge"; public static final String PARAMETER_FLAG = "flags"; - public static final String PARAMETER_WHITELIST_COUNTRIES = "countries.whitelist"; - public static final String PARAMETER_WHITELIST_TAGS = "tags.filter"; + public static final String PARAMETER_PERMITLIST_COUNTRIES = "countries.permitlist"; + public static final String PARAMETER_PERMITLIST_TAGS = "tags.filter"; private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; private static final String PARAMETER_LOCALE_KEY = "locale"; private static final Logger logger = LoggerFactory.getLogger(BaseCheck.class); private static final long serialVersionUID = 4427673331949586822L; private final boolean acceptPiers; - private final List blacklistCountries; + private final List denylistCountries; private final Challenge challenge; private final List countries; private final Map> flagLanguageMap; @@ -80,11 +80,11 @@ public BaseCheck(final Configuration configuration) { this.acceptPiers = configurationValue(configuration, PARAMETER_ACCEPT_PIERS, false); this.countries = Collections.unmodifiableList(configurationValue(configuration, - PARAMETER_WHITELIST_COUNTRIES, Collections.EMPTY_LIST)); - this.blacklistCountries = Collections.unmodifiableList(configurationValue(configuration, - PARAMETER_BLACKLIST_COUNTRIES, Collections.EMPTY_LIST)); + PARAMETER_PERMITLIST_COUNTRIES, Collections.EMPTY_LIST)); + this.denylistCountries = Collections.unmodifiableList(configurationValue(configuration, + PARAMETER_DENYLIST_COUNTRIES, Collections.EMPTY_LIST)); this.tagFilter = TaggableFilter - .forDefinition(configurationValue(configuration, PARAMETER_WHITELIST_TAGS, "")); + .forDefinition(configurationValue(configuration, PARAMETER_PERMITLIST_TAGS, "")); final Map challengeMap = configurationValue(configuration, PARAMETER_CHALLENGE, Collections.EMPTY_MAP); this.flagLanguageMap = configurationValue(configuration, PARAMETER_FLAG, @@ -161,11 +161,6 @@ public Iterable flags(final Atlas atlas) .translate(new MultiIterable<>(atlas.items(), atlas.relations()), this::check)); } - public List getBlacklistCountries() - { - return this.blacklistCountries; - } - @Override public Challenge getChallenge() { @@ -184,8 +179,8 @@ public AtlasEntityPolygonsFilter getCheckPolygonFilter() } /** - * Gets the whitelisted countries for this check. If an empty list is returned it safe to assume - * this check applies to all countries. + * Gets the permitlisted countries for this check. If an empty list is returned it safe to + * assume this check applies to all countries. * * @return a list of country ISO3 codes */ @@ -194,6 +189,11 @@ public List getCountries() return this.countries; } + public List getDenylistCountries() + { + return this.denylistCountries; + } + public AtlasEntityPolygonsFilter getGlobalPolygonFilter() { return this.globalPolygonFilter; @@ -250,9 +250,9 @@ public void logStatus() } /** - * The country check will first check the country whitelist and if the country is contained in - * the whitelist it is allowed, after that the country is checked it against blacklist and if - * contained in the blacklist will not be allowed. + * The country check will first check the country permitlist and if the country is contained in + * the permitlist it is allowed, after that the country is checked it against denylist and if + * contained in the denylist will not be allowed. * * @param country * country ISO3 code to check @@ -261,8 +261,9 @@ public void logStatus() @Override public boolean validCheckForCountry(final String country) { - // whitelist is valid if country list is empty or country within the country list. It always - // takes precedence over blacklist and blacklist is essentially ignored if whitelist is non + // permitlist is valid if country list is empty or country within the country list. It + // always + // takes precedence over denylist and denylist is essentially ignored if permitlist is non // empty if (!this.getCountries().isEmpty()) { @@ -270,8 +271,8 @@ public boolean validCheckForCountry(final String country) } else { - return this.getBlacklistCountries().isEmpty() - || !this.getBlacklistCountries().contains(country); + return this.getDenylistCountries().isEmpty() + || !this.getDenylistCountries().contains(country); } } diff --git a/src/main/java/org/openstreetmap/atlas/checks/base/CheckResourceLoader.java b/src/main/java/org/openstreetmap/atlas/checks/base/CheckResourceLoader.java index 6f7cebecc..c2d3fb99f 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/base/CheckResourceLoader.java +++ b/src/main/java/org/openstreetmap/atlas/checks/base/CheckResourceLoader.java @@ -55,18 +55,18 @@ public class CheckResourceLoader private static final String DEFAULT_PACKAGE = "org.openstreetmap.atlas.checks"; private static final String DEFAULT_TYPE = Check.class.getName(); private static final Logger logger = LoggerFactory.getLogger(CheckResourceLoader.class); + private static final String COUNTRY_PERMITLIST_TEMPLATE = "%s." + + BaseCheck.PARAMETER_PERMITLIST_COUNTRIES; + private static final String COUNTRY_DENYLIST_TEMPLATE = "%s." + + BaseCheck.PARAMETER_DENYLIST_COUNTRIES; private final Class checkType; private final Configuration configuration; private final MultiMap countryGroups = new MultiMap<>(); private final Boolean enabledByDefault; private final String enabledKeyTemplate; - private static final String COUNTRY_WHITELIST_TEMPLATE = "%s." - + BaseCheck.PARAMETER_WHITELIST_COUNTRIES; - private static final String COUNTRY_BLACKLIST_TEMPLATE = "%s." - + BaseCheck.PARAMETER_BLACKLIST_COUNTRIES; private final Set packages; - private final Optional> checkWhiteList; - private final Optional> checkBlackList; + private final Optional> checkPermitList; + private final Optional> checkDenyList; /** * Default constructor @@ -103,10 +103,9 @@ public CheckResourceLoader(final Configuration configuration) .get("CheckResourceLoader.enabledKeyTemplate", DEFAULT_ENABLED_KEY_TEMPLATE) .value(); this.configuration = configuration; - this.checkWhiteList = configuration.get("CheckResourceLoader.checks.whitelist") - .valueOption(); - this.checkBlackList = configuration.get("CheckResourceLoader.checks.blacklist") + this.checkPermitList = configuration.get("CheckResourceLoader.checks.permitlist") .valueOption(); + this.checkDenyList = configuration.get("CheckResourceLoader.checks.denylist").valueOption(); } public Configuration getConfiguration() @@ -234,11 +233,11 @@ public Set loadChecksUsingConstructors(final Predicate whitelist.contains(checkClass.getSimpleName())) - .orElse(true) - && this.checkBlackList.map(blacklist -> !blacklist - .contains(checkClass.getSimpleName())).orElse(true)) + && this.checkPermitList.map(permitlist -> permitlist + .contains(checkClass.getSimpleName())).orElse(true) + && this.checkDenyList.map( + denylist -> !denylist.contains(checkClass.getSimpleName())) + .orElse(true)) { Streams.zip(Stream.of(constructorArgumentTypes), Stream.of(constructorArguments), @@ -317,16 +316,16 @@ private boolean isEnabledByConfiguration(final Configuration configuration, private boolean isEnabledByConfiguration(final Configuration configuration, final Class checkClass, final String country) { - final List countryWhitelist = configuration - .get(String.format(COUNTRY_WHITELIST_TEMPLATE, checkClass.getSimpleName()), + final List countryPermitlist = configuration + .get(String.format(COUNTRY_PERMITLIST_TEMPLATE, checkClass.getSimpleName()), Collections.emptyList()) .value(); - final List countryBlacklist = configuration - .get(String.format(COUNTRY_BLACKLIST_TEMPLATE, checkClass.getSimpleName()), + final List countryDenylist = configuration + .get(String.format(COUNTRY_DENYLIST_TEMPLATE, checkClass.getSimpleName()), Collections.emptyList()) .value(); return this.isEnabledByConfiguration(configuration, checkClass) - && countryWhitelist.isEmpty() ? !countryBlacklist.contains(country) - : countryWhitelist.contains(country); + && countryPermitlist.isEmpty() ? !countryDenylist.contains(country) + : countryPermitlist.contains(country); } } diff --git a/src/main/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommand.java b/src/main/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommand.java index b51cbfe18..9db59896b 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommand.java +++ b/src/main/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommand.java @@ -74,17 +74,17 @@ public class FlagDatabaseSubCommand extends AbstractAtlasShellToolsCommand private static final Gson gson = new GsonBuilder() .registerTypeAdapter(CheckFlag.class, new CheckFlagDeserializer()).create(); private static final Logger logger = LoggerFactory.getLogger(FlagDatabaseSubCommand.class); - private static final Set blacklistKeys = new HashSet<>(); + private static final Set denylistKeys = new HashSet<>(); static { - blacklistKeys.add("itemType"); - blacklistKeys.add("identifier"); - blacklistKeys.add(OSM_ID_LEGACY); - blacklistKeys.add("osmIdentifier"); - blacklistKeys.add("relations"); - blacklistKeys.add("members"); - blacklistKeys.add(ISO_COUNTRY_CODE); + denylistKeys.add("itemType"); + denylistKeys.add("identifier"); + denylistKeys.add(OSM_ID_LEGACY); + denylistKeys.add("osmIdentifier"); + denylistKeys.add("relations"); + denylistKeys.add("members"); + denylistKeys.add(ISO_COUNTRY_CODE); } private final OptionAndArgumentDelegate optionAndArgumentDelegate; @@ -297,7 +297,7 @@ public Map getTags(final JsonObject properties) { final Map hstore = new HashMap<>(); - properties.entrySet().stream().filter(key -> !blacklistKeys.contains(key.getKey())) + properties.entrySet().stream().filter(key -> !denylistKeys.contains(key.getKey())) .map(Map.Entry::getKey) .forEach(key -> hstore.put(key, properties.get(key).getAsString())); diff --git a/src/main/java/org/openstreetmap/atlas/checks/distributed/IntegrityCheckSparkJob.java b/src/main/java/org/openstreetmap/atlas/checks/distributed/IntegrityCheckSparkJob.java index 827cfe0a0..f6d7dcafa 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/distributed/IntegrityCheckSparkJob.java +++ b/src/main/java/org/openstreetmap/atlas/checks/distributed/IntegrityCheckSparkJob.java @@ -155,10 +155,11 @@ public void start(final CommandMap commandMap) .concat(Stream.of(ConfigurationResolver.loadConfiguration(commandMap, CONFIGURATION_FILES, CONFIGURATION_JSON)), Stream.of(checkFilter - . map(whitelist -> new StandardConfiguration( - "WhiteListConfiguration", + . map(permitlist -> new StandardConfiguration( + "PermitListConfiguration", Collections.singletonMap( - "CheckResourceLoader.checks.whitelist", whitelist))) + "CheckResourceLoader.checks.permitlist", + permitlist))) .orElse(ConfigurationResolver.emptyConfiguration()))) .collect(Collectors.toList())); diff --git a/src/main/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJob.java b/src/main/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJob.java index f6d030765..10ad114b8 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJob.java +++ b/src/main/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJob.java @@ -123,10 +123,11 @@ public void start(final CommandMap commandMap) .concat(Stream.of(ConfigurationResolver.loadConfiguration(commandMap, CONFIGURATION_FILES, CONFIGURATION_JSON)), Stream.of(checkFilter - . map(whitelist -> new StandardConfiguration( - "WhiteListConfiguration", + . map(permitlist -> new StandardConfiguration( + "PermitListConfiguration", Collections.singletonMap( - "CheckResourceLoader.checks.whitelist", whitelist))) + "CheckResourceLoader.checks.permitlist", + permitlist))) .orElse(ConfigurationResolver.emptyConfiguration()))) .collect(Collectors.toList())); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/areas/AreasWithHighwayTagCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/areas/AreasWithHighwayTagCheck.java index 6c07c45fb..5179946df 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/areas/AreasWithHighwayTagCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/areas/AreasWithHighwayTagCheck.java @@ -60,8 +60,7 @@ public AreasWithHighwayTagCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return (object instanceof Area - || (object instanceof Edge && ((Edge) object).isMasterEdge())) + return (object instanceof Area || (object instanceof Edge && ((Edge) object).isMainEdge())) && !this.isFlagged(object.getOsmIdentifier()); } @@ -88,7 +87,7 @@ protected Optional flag(final AtlasObject object) { final EdgeWalker walker = new AreasWithHighwayTagCheckWalker((Edge) object); final Set connectedBadEdges = walker.collectEdges().stream() - .filter(Edge::isMasterEdge).collect(Collectors.toSet()); + .filter(Edge::isMainEdge).collect(Collectors.toSet()); connectedBadEdges .forEach(badEdge -> this.markAsFlagged(badEdge.getOsmIdentifier())); results = new HashSet<>(connectedBadEdges); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/areas/PedestrianAreaOverlappingEdgeCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/areas/PedestrianAreaOverlappingEdgeCheck.java index 4a5bce42f..46ac530f2 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/areas/PedestrianAreaOverlappingEdgeCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/areas/PedestrianAreaOverlappingEdgeCheck.java @@ -229,7 +229,7 @@ private boolean isValidIntersectingEdge(final Edge edge, final Area area) return // We do not want any pedestrian edges that are also pedestrian areas. // Currently, pedestrian ways are ingested as both edges and as areas. - edge.getOsmIdentifier() != area.getOsmIdentifier() && edge.isMasterEdge() + edge.getOsmIdentifier() != area.getOsmIdentifier() && edge.isMainEdge() && !HighwayTag.isPedestrianNavigableHighway(edge) // Valid edge should be a car navigable highway && (HighwayTag.isCarNavigableHighway(edge) diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/AtGradeSignPostCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/AtGradeSignPostCheck.java index 311d9085a..eba36c1d3 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/AtGradeSignPostCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/AtGradeSignPostCheck.java @@ -54,8 +54,8 @@ public class AtGradeSignPostCheck extends BaseCheck */ private class FlaggedIntersection { - private int instructionIndex; - private Set setOfFlaggedItems; + private final int instructionIndex; + private final Set setOfFlaggedItems; FlaggedIntersection(final int instructionIndex, final Set setOfFlaggedItems) { @@ -125,7 +125,7 @@ private Integer getInstructionIndex() LINK_WITH_NO_DESTINATION_SIGN_RELATION); private final Set highwayFilter; - private Map> connectedHighwayTypes; + private final Map> connectedHighwayTypes; /** * The default constructor that must be supplied. The Atlas Checks framework will generate the @@ -341,7 +341,7 @@ private Set getAttachedLinkRoadsForNavigation(final Edge inEdge, final Set validLinkRoads = new HashSet<>(); // Find all connected link roads to the start of the inEdge final Set connectedLinks = inEdge.start().outEdges().stream() - .filter(outEdge -> outEdge.isMasterEdge() + .filter(outEdge -> outEdge.isMainEdge() && outEdge.getIdentifier() != inEdge.getIdentifier() && outEdge.highwayTag().isLink()) .collect(Collectors.toSet()); @@ -631,7 +631,7 @@ private Function> isRoundaboutEdge() */ private boolean isValidIntersectingEdge(final Edge edge) { - return edge.isMasterEdge() && HighwayTag.highwayTag(edge).isPresent() + return edge.isMainEdge() && HighwayTag.highwayTag(edge).isPresent() && this.highwayFilter.contains(edge.highwayTag().getTagValue()); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheck.java index 28831df51..e33a613cc 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheck.java @@ -251,7 +251,7 @@ private Function> getInvalidCrossingEdges() */ private boolean isValidCrossingEdge(final AtlasObject object) { - if (Edge.isMasterEdgeIdentifier(object.getIdentifier()) + if (Edge.isMainEdgeIdentifier(object.getIdentifier()) && !TagPredicates.IS_AREA.test(object)) { final Optional highway = HighwayTag.highwayTag(object); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheck.java index 2d6440a53..e320c19e5 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheck.java @@ -72,10 +72,10 @@ public class LineCrossingWaterBodyCheck extends BaseCheck private static final List FALLBACK_INSTRUCTIONS = Arrays.asList(WATERBODY_INSTRUCTION, LINEAR_INSTRUCTION, BUILDING_INSTRUCTION); private static final String ADDRESS_PREFIX_KEY = "addr"; - // Whitelist for line tags + // Permitlist for line tags private static final Set VALID_LINE_TAGS = Stream.of(NotesTag.KEY, SourceTag.KEY, NaturalTag.KEY, PlaceTag.KEY, AdministrativeLevelTag.KEY).collect(Collectors.toSet()); - // Whitelisted tags filter for multipolygon relations. Multipolygon relations with these tags + // Permitlisted tags filter for multipolygon relations. Multipolygon relations with these tags // are expected to cross water bodies. private static final TaggableFilter VALID_RELATIONS_TAG_FILTER = TaggableFilter .forDefinition("natural->*|place->*|landuse->*|waterway->*|admin_level->*|boundary->*"); @@ -84,26 +84,15 @@ public class LineCrossingWaterBodyCheck extends BaseCheck + "embankment->yes|location->underwater,underground|power->line,minor_line|" + "man_made->pier,breakwater,embankment,groyne,dyke,pipeline|route->ferry|highway->proposed,construction|ice_road->yes|winter_road->yes|snowmobile->yes|ski->yes|" + "ford->!no&ford->*"; - private final TaggableFilter canCrossWaterBodyFilter; - private final TaggableFilter lineItemsOffending; - private final boolean flagBuildings; private static final String DEFAULT_HIGHWAY_MINIMUM = "TOLL_GANTRY"; - private final HighwayTag highwayMinimum; private static final List DEFAULT_HIGHWAYS_EXCLUDE = Collections.emptyList(); - private final List highwaysExclude; private static final String BUILDING_TAGS_DO_NOT_FLAG = "public_transport->station,aerialway=station"; private static final TaggableFilter NONOFFENDING_BUILDINGS = TaggableFilter .forDefinition(BUILDING_TAGS_DO_NOT_FLAG); private static final String DEFAULT_VALID_INTERSECTING_NODE = "ford->!no&ford->*|leisure->slipway|amenity->ferry_terminal"; - private final TaggableFilter intersectingNodesNonoffending; - private static final long SHAPEPOINTS_MIN_DEFAULT = 1; private static final long SHAPEPOINTS_MAX_DEFAULT = 5000; - private final long shapepointsMin; - private final long shapepointsMax; - private static final Logger logger = LoggerFactory.getLogger(LineCrossingWaterBodyCheck.class); - private static final String WATER_BODY_TAGS = // Lakes "natural->spring,hot_spring&name->*" + "|natural->lake,pond" + "|water:type->lake" @@ -137,7 +126,6 @@ public class LineCrossingWaterBodyCheck extends BaseCheck "|waterway->billabong,navigablechannel,river;stream,reservoir"; private static final TaggableFilter VALID_WATER_BODY_TAGS = TaggableFilter .forDefinition(WATER_BODY_TAGS); - private static final String WATER_BODY_EXCLUDE_TAGS = "natural->dock,water_point,floodway,spillway,wastewater,waterhole" + "|waterway->lock_gate,dock,water_point,floodway,spillway,wastewater,waterhole,culvert,dam,waterfall,fish_pass,dry_dock,construction,boat_lift,weir,breakwater,boatyard" + "|water->lock_gate,dock,water_point,floodway,spillway,wastewater,waterhole,pool,reflecting_pool,swimming_pool,salt_pool,fountain,tank,fish_pass" @@ -155,11 +143,18 @@ public class LineCrossingWaterBodyCheck extends BaseCheck + "|water->tank,Earth_Tank_,_Off_Stream_Flow_Dam,treatment_pond,re#,swamp_-_occasional,trough,Trough,waste_water"; private static final TaggableFilter INVALID_WATER_BODY_TAGS = TaggableFilter .forDefinition(WATER_BODY_EXCLUDE_TAGS); - private static final long serialVersionUID = 6048659185833217159L; + private final TaggableFilter canCrossWaterBodyFilter; + private final TaggableFilter lineItemsOffending; + private final boolean flagBuildings; + private final HighwayTag highwayMinimum; + private final List highwaysExclude; + private final TaggableFilter intersectingNodesNonoffending; + private final long shapepointsMin; + private final long shapepointsMax; /** - * Checks if the relation has whitelisted tags that makes its members cross water bodies + * Checks if the relation has permitlisted tags that makes its members cross water bodies * validly. * * @param multipolygonRelations @@ -192,9 +187,9 @@ private static boolean hasOnlyValidCrossingTags(final Map osmTag * checking if any of the following three conditions are met: 1) If the line has no osm tags and * has no relations - if a line meets this criteria, it is essentially a part of boundary * relation and the boundary relation was not ingested into atlas. 2) If it is part of a - * multipolygon relation and the relation has any of the whitelisted tags for multipolygon + * multipolygon relation and the relation has any of the permitlisted tags for multipolygon * relations. 3) If the crossing line has only the white listed tags in the VALID_LINE_TAGS list - * and has no other tags. Whitelisted tags for relations and lines make the line valid to cross + * and has no other tags. Permitlisted tags for relations and lines make the line valid to cross * water body. * * @param crossingLine diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/SelfIntersectingPolylineCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/SelfIntersectingPolylineCheck.java index 39e4266e8..d142596e5 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/SelfIntersectingPolylineCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/SelfIntersectingPolylineCheck.java @@ -35,10 +35,10 @@ */ public class SelfIntersectingPolylineCheck extends BaseCheck { + public static final Integer THREE = 3; private static final String AREA_INSTRUCTION = "Feature {0,number,#} has invalid geometry at {1}"; private static final String POLYLINE_BUILDING_INSTRUCTION = "Feature {0,number,#} is a incomplete " + "building at {1}"; - private static final String DUPLICATE_EDGE_INSTRUCTION = "Feature {0,number,#} has a duplicate " + "Edge at {1}"; private static final String POLYLINE_INSTRUCTION = "Self-intersecting polyline for feature " @@ -48,7 +48,6 @@ public class SelfIntersectingPolylineCheck extends BaseCheck private static final Logger logger = LoggerFactory .getLogger(SelfIntersectingPolylineCheck.class); private static final String MINIMUM_HIGHWAY_TYPE_DEFAULT = "SERVICE"; - public static final Integer THREE = 3; private static final long serialVersionUID = 2722288442633787006L; private final HighwayTag minimumHighwayType; @@ -80,8 +79,8 @@ public SelfIntersectingPolylineCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - // Master edges with building tags or with eligible highway tags - return object instanceof Edge && ((Edge) object).isMasterEdge() + // Main edges with building tags or with eligible highway tags + return object instanceof Edge && ((Edge) object).isMainEdge() && (Validators.hasValuesFor(object, BuildingTag.class) || ((Edge) object) .highwayTag().isMoreImportantThanOrEqualTo(this.minimumHighwayType)) // Areas diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/UnwalkableWaysCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/UnwalkableWaysCheck.java index 1274c5808..37587f452 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/UnwalkableWaysCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/intersections/UnwalkableWaysCheck.java @@ -78,8 +78,8 @@ public boolean validCheckForObject(final AtlasObject object) } final Edge edge = (Edge) object; - // Check that the Edge is a master edge - return edge.isMasterEdge() + // Check that the Edge is a main edge + return edge.isMainEdge() // For all connected nodes to the Edge, check that none of them have // Highway=crossing && edge.connectedNodes().stream().noneMatch( diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/MalformedPolyLineCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/MalformedPolyLineCheck.java index 48109e900..7ab80a434 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/MalformedPolyLineCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/MalformedPolyLineCheck.java @@ -45,7 +45,7 @@ public MalformedPolyLineCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && ((Edge) object).isMasterEdge() || object instanceof Line; + return object instanceof Edge && ((Edge) object).isMainEdge() || object instanceof Line; } @Override diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ApproximateWayCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ApproximateWayCheck.java index ba5c658d7..3a0c8b77f 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ApproximateWayCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ApproximateWayCheck.java @@ -28,17 +28,16 @@ public class ApproximateWayCheck extends BaseCheck { - private static final long serialVersionUID = 125449616392217396L; - private static final String EDGE_DEVIATION_INSTRUCTION = "Way {0,number,#} is crude. Please add more nodes/rearrange current nodes to more closely match the road from imagery"; - private static final List FALLBACK_INSTRUCTIONS = Collections - .singletonList(EDGE_DEVIATION_INSTRUCTION); public static final double DEVIATION_MAXIMUM_RATIO_DEFAULT = 0.04; public static final double DEVIATION_MINIMUM_LENGTH_DEFAULT = 10; - private static final String HIGHWAY_MINIMUM_DEFAULT = HighwayTag.SERVICE.toString(); public static final double MIN_ANGLE_DEFAULT = 60.0; public static final double MAX_ANGLE_DEFAULT = 160.0; public static final double BEZIER_STEP_DEFAULT = 0.01; - + private static final long serialVersionUID = 125449616392217396L; + private static final String EDGE_DEVIATION_INSTRUCTION = "Way {0,number,#} is crude. Please add more nodes/rearrange current nodes to more closely match the road from imagery"; + private static final List FALLBACK_INSTRUCTIONS = Collections + .singletonList(EDGE_DEVIATION_INSTRUCTION); + private static final String HIGHWAY_MINIMUM_DEFAULT = HighwayTag.SERVICE.toString(); private final double maxDeviationRatio; private final Distance minDeviationLength; private final HighwayTag highwayMinimum; @@ -79,7 +78,7 @@ public ApproximateWayCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMasterEdge() + return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMainEdge() && HighwayTag.isCarNavigableHighway(object) && isMinimumHighwayType(object); } @@ -108,14 +107,14 @@ protected Optional flag(final AtlasObject object) final Segment seg2 = segments.get(index + 1); final double angle = findAngle(seg1, seg2); // ignore sharp turns and almost straightaways - if (angle < minAngle || angle > maxAngle) + if (angle < this.minAngle || angle > this.maxAngle) { return false; } final double distance = quadraticBezier(seg1.first(), seg2.first(), seg2.end()); final double legsLength = seg1.length().asMeters() + seg2.length().asMeters(); return distance > this.minDeviationLength.asMeters() - && distance / legsLength > maxDeviationRatio; + && distance / legsLength > this.maxDeviationRatio; }); if (isCrude) @@ -197,7 +196,7 @@ private double quadraticBezier(final Location start, final Location anchor, fina final double endY = end.getLatitude().onEarth().asMeters(); double min = Double.POSITIVE_INFINITY; - for (double step = 0; step <= 1; step += bezierStep) + for (double step = 0; step <= 1; step += this.bezierStep) { // https://stackoverflow.com/questions/5634460/quadratic-b%C3%A9zier-curve-calculate-points final double pointX = (pow(1 - step, 2) * startX) diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/DuplicateWaysCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/DuplicateWaysCheck.java index 0135f38ea..ec21415e9 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/DuplicateWaysCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/DuplicateWaysCheck.java @@ -40,8 +40,8 @@ public DuplicateWaysCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { return object instanceof Edge - // Check to see that the Edge is a master Edge - && Edge.isMasterEdgeIdentifier(object.getIdentifier()) + // Check to see that the Edge is a main Edge + && Edge.isMainEdgeIdentifier(object.getIdentifier()) // Check to see that the edge has not already been seen && !this.isFlagged(object.getIdentifier()) // Check to see that the edge is car navigable @@ -58,9 +58,9 @@ protected Optional flag(final AtlasObject object) final Rectangle bounds = edge.asPolyLine().bounds(); // Get Edges which are contained by or intersect the bounds, and then filter - // Out the non-master Edges as the bounds Edges are not guaranteed to be uni-directional + // Out the non-main Edges as the bounds Edges are not guaranteed to be uni-directional final Iterable edgesInBounds = edge.getAtlas().edgesIntersecting(bounds, - Edge::isMasterEdge); + Edge::isMainEdge); for (final Edge edgeInBounds : edgesInBounds) { diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/FloatingEdgeCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/FloatingEdgeCheck.java index 02c999f31..1b4cab156 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/FloatingEdgeCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/FloatingEdgeCheck.java @@ -95,12 +95,12 @@ public FloatingEdgeCheck(final Configuration configuration) } /** - * Checks if the supplied object is of {@link ItemType} {@link Edge} and that it is the - * MasterEdge and whether a car can navigate on the edge. So we would ignore any pedestrian - * paths in this particular check. An {@link Edge} contains a master edge and a reserve edge, - * unless it is a oneway edge in which case it will only contain the master edge. Either way we - * want to ignore the reverse edge so that we don't produce duplicate flags for what is - * essentially the same feature. + * Checks if the supplied object is of {@link ItemType} {@link Edge} and that it is the MainEdge + * and whether a car can navigate on the edge. So we would ignore any pedestrian paths in this + * particular check. An {@link Edge} contains a main edge and a reserve edge, unless it is a + * oneway edge in which case it will only contain the main edge. Either way we want to ignore + * the reverse edge so that we don't produce duplicate flags for what is essentially the same + * feature. * * @param object * the {@link AtlasObject} you are checking @@ -109,8 +109,8 @@ public FloatingEdgeCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - // Consider navigable master edges - return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMasterEdge() + // Consider navigable main edges + return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMainEdge() && HighwayTag.isCarNavigableHighway(object) && isMinimumHighwayType(object) && !intersectsAirport((Edge) object); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InconsistentRoadClassificationCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InconsistentRoadClassificationCheck.java index 3ae81a4b3..b8f413800 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InconsistentRoadClassificationCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InconsistentRoadClassificationCheck.java @@ -87,7 +87,7 @@ public InconsistentRoadClassificationCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { if (object instanceof Edge && !isFlagged(object.getOsmIdentifier()) - && ((Edge) object).isMasterEdge()) + && ((Edge) object).isMainEdge()) { final Edge edge = (Edge) object; @@ -98,7 +98,7 @@ public boolean validCheckForObject(final AtlasObject object) && edge.overallHeading().isPresent() && // Way must not continue beyond this edge edge.outEdges().stream().noneMatch(connectedEdge -> edge - .getMasterEdgeIdentifier() != connectedEdge.getMasterEdgeIdentifier() + .getMainEdgeIdentifier() != connectedEdge.getMainEdgeIdentifier() && edge.getOsmIdentifier() == connectedEdge.getOsmIdentifier()); } return false; @@ -121,16 +121,16 @@ protected Optional flag(final AtlasObject item) { final Edge inconsistentEdge = inconsistentEdgeTuple.getFirst(); - // Get the incoming and outgoing master edges from each edge + // Get the incoming and outgoing main edges from each edge final Set inEdges = inconsistentEdge.inEdges().stream() - .filter(Edge::isMasterEdge).collect(Collectors.toSet()); + .filter(Edge::isMainEdge).collect(Collectors.toSet()); final Set outEdges = inconsistentEdge.outEdges().stream() - .filter(Edge::isMasterEdge).collect(Collectors.toSet()); + .filter(Edge::isMainEdge).collect(Collectors.toSet()); // Get the length of each edge final Distance edgeLength = inconsistentEdge.asPolyLine().length(); - // If both the incoming and outgoing master edges are less than or equal to 2 or + // If both the incoming and outgoing main edges are less than or equal to 2 or // the length of the edge is less than the maximum allowed edge length configured if ((inEdges.size() <= TWO_CONNECTED_EDGES && outEdges.size() <= TWO_CONNECTED_EDGES) @@ -232,7 +232,7 @@ private boolean areInTheSimilarDirection(final Edge edge, final Edge anotherEdge private Stream connectionsSimilarToReferenceEdge(final HighwayTag referenceHighwayType, final Edge edge) { - return edge.outEdges().stream().filter(Edge::isMasterEdge) + return edge.outEdges().stream().filter(Edge::isMainEdge) .filter(connectedEdge -> referenceHighwayType .isOfEqualClassification(connectedEdge.highwayTag()) && this.areInTheSimilarDirection(edge, connectedEdge)); @@ -251,7 +251,7 @@ private List>> findInconsistentEdges(final Edge referenceE // Split the outEdges into those that are inconsistent links and those that are not final Map> edgesAreProblematicLinks = referenceEdge.outEdges().stream() - .filter(Edge::isMasterEdge) + .filter(Edge::isMainEdge) .filter(this.allConnectedEdgesFilter(referenceEdge, referenceHighwayType)) .collect(Collectors.partitioningBy( edge -> this.isProblematicLink(edge, referenceHighwayType))); @@ -296,9 +296,9 @@ private Function>>> getSimilarEdgesTuple( { return connectedEdge -> { - final Set inEdges = connectedEdge.inEdges().stream().filter(Edge::isMasterEdge) + final Set inEdges = connectedEdge.inEdges().stream().filter(Edge::isMainEdge) .collect(Collectors.toSet()); - final Set outEdges = connectedEdge.outEdges().stream().filter(Edge::isMasterEdge) + final Set outEdges = connectedEdge.outEdges().stream().filter(Edge::isMainEdge) .collect(Collectors.toSet()); // Get similar connections using first edge identifier and type as reference final Set similarConnections = this @@ -328,7 +328,7 @@ private Function>>> getSimilarEdgesTuple( */ private boolean isBypassed(final Edge inconsistency, final HighwayTag referenceHighwayTag) { - return inconsistency.start().outEdges().stream().filter(Edge::isMasterEdge) + return inconsistency.start().outEdges().stream().filter(Edge::isMainEdge) .anyMatch(edge -> !edge.equals(inconsistency) && edge.end().equals(inconsistency.end()) && edge.highwayTag().isIdenticalClassification(referenceHighwayTag)); @@ -343,7 +343,7 @@ private boolean isBypassed(final Edge inconsistency, final HighwayTag referenceH */ private boolean isContinuousOutgoingEdge(final Edge edge) { - return edge.outEdges().stream().filter(Edge::isMasterEdge) + return edge.outEdges().stream().filter(Edge::isMainEdge) .anyMatch(connectedEdge -> edge.highwayTag() .isOfEqualClassification(connectedEdge.highwayTag()) && this.areInTheSimilarDirection(edge, connectedEdge)); @@ -382,8 +382,8 @@ private boolean isPartOfALongerRoad(final Edge edge, final HighwayTag referenceH return edge.highwayTag().isMoreImportantThan(referenceHighwayType) && (edge.length() .isGreaterThanOrEqualTo(this.longEdgeThreshold) || edge.connectedNodes().stream().allMatch(node -> node.connectedEdges().stream() - .anyMatch(connectedEdge -> edge.getMasterEdgeIdentifier() != connectedEdge - .getMasterEdgeIdentifier() + .anyMatch(connectedEdge -> edge.getMainEdgeIdentifier() != connectedEdge + .getMainEdgeIdentifier() && edge.highwayTag() .isOfEqualClassification(connectedEdge.highwayTag())))); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InvalidPiersCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InvalidPiersCheck.java index 1bb269aa2..c901d3ee5 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InvalidPiersCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/InvalidPiersCheck.java @@ -94,7 +94,7 @@ public InvalidPiersCheck(final Configuration configuration) /** * This function will validate if the supplied atlas object is valid for the check. Valid object - * for the check is a master edge with man_made=pier tag and does not have an area=yes tag. + * for the check is a main edge with man_made=pier tag and does not have an area=yes tag. * * @param object * the atlas object supplied by the Atlas-Checks framework for evaluation @@ -103,7 +103,7 @@ public InvalidPiersCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && ((Edge) object).isMasterEdge() && ManMadeTag.isPier(object) + return object instanceof Edge && ((Edge) object).isMainEdge() && ManMadeTag.isPier(object) && HAS_NO_AREA_TAG.test(object) && !this.isFlagged(object.getOsmIdentifier()); } @@ -133,9 +133,9 @@ protected Optional flag(final AtlasObject object) // We will mark the edge as flagged as we will only be looking at all way sectioned edges of // a way once this.markAsFlagged(edge.getOsmIdentifier()); - // Collect all master edges that form the OSM way + // Collect all main edges that form the OSM way final Set edgesFormingOSMWay = new OsmWayWalker(edge).collectEdges().stream() - .filter(Edge::isMasterEdge).collect(Collectors.toSet()); + .filter(Edge::isMainEdge).collect(Collectors.toSet()); final List listOfEdgesFormingOSMWay = new ArrayList<>(edgesFormingOSMWay); // We need to sort the edges to build the geometry of the OSM way in a deterministic manner listOfEdgesFormingOSMWay.sort(Comparator.comparingLong(AtlasObject::getIdentifier)); @@ -221,7 +221,7 @@ private boolean hasPolygonalGeometry(final List edgesFormingOSMWay, { wayIds.add(nextEdge.getIdentifier()); final List nextEdgeList = Iterables.stream(nextEdge.outEdges()) - .filter(outEdge -> outEdge.isMasterEdge() + .filter(outEdge -> outEdge.isMainEdge() && outEdge.getOsmIdentifier() == originalEdge.getOsmIdentifier()) .collectToList(); nextEdge = nextEdgeList.isEmpty() ? null : nextEdgeList.get(0); @@ -307,7 +307,7 @@ private boolean linearPierOverlapsHighway(final Edge intersectingEdge, /** * Checks if the way formed from the input edges overlap a highway or not. We only consider * intersecting edges that have highway tags, are on the same level/layer as the pier and are - * master edges. + * main edges. * * @param originalEdge * input edge @@ -326,7 +326,7 @@ private boolean pierOverlapsHighway(final AtlasObject originalEdge, return Iterables.stream(originalEdge.getAtlas().edgesIntersecting(osmWayAsPolygon)) .filter(intersectingEdge -> intersectingEdge.getOsmIdentifier() != originalEdge .getOsmIdentifier()) - .anyMatch(intersectingEdge -> intersectingEdge.isMasterEdge() + .anyMatch(intersectingEdge -> intersectingEdge.isMainEdge() && HighwayTag.highwayTag(intersectingEdge).isPresent() && HighwayTag.highwayTag(intersectingEdge).get() .isMoreImportantThanOrEqualTo( diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/LongSegmentCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/LongSegmentCheck.java index b9de5c0d3..630af051f 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/LongSegmentCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/LongSegmentCheck.java @@ -36,14 +36,14 @@ public LongSegmentCheck(final Configuration configuration) } /** - * Validate if given {@link AtlasObject} is actually an {@link Edge}, which is a Master Edge and + * Validate if given {@link AtlasObject} is actually an {@link Edge}, which is a Main Edge and * is not a Ferry */ @Override public boolean validCheckForObject(final AtlasObject object) { // TODO replace FERRY check with Predicate - return object instanceof Edge && ((Edge) object).isMasterEdge() + return object instanceof Edge && ((Edge) object).isMainEdge() && !Validators.isOfType(object, RouteTag.class, RouteTag.FERRY); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/MalformedRoundaboutCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/MalformedRoundaboutCheck.java index 469e97210..3b8221a24 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/MalformedRoundaboutCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/MalformedRoundaboutCheck.java @@ -75,8 +75,8 @@ public boolean validCheckForObject(final AtlasObject object) && JunctionTag.isRoundabout(object) // And that the Edge has not already been marked as flagged && !this.isFlagged(object.getIdentifier()) - // Make sure that we are only looking at master edges - && ((Edge) object).isMasterEdge() + // Make sure that we are only looking at main edges + && ((Edge) object).isMainEdge() // Check for excluded highway types && !this.isExcludedHighway(object) // Check if object doesn't contain synthetic node. @@ -225,7 +225,7 @@ private boolean roundaboutEnclosesRoads(final Route roundabout) { final Polygon roundaboutPoly = new Polygon(roundabout.asPolyLine()); return roundabout.start().getAtlas().edgesIntersecting(roundaboutPoly, - edge -> edge.isMasterEdge() && HighwayTag.isCarNavigableHighway(edge) + edge -> edge.isMainEdge() && HighwayTag.isCarNavigableHighway(edge) && !JunctionTag.isRoundabout(edge) && edge.getTag(AreaTag.KEY).isEmpty() && !this.ignoreBridgeTunnelCrossings(edge) && this.intersectsWithEnclosedGeometry(roundaboutPoly, edge)) diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/OverlappingEdgeCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/OverlappingEdgeCheck.java index 9cc83a7fa..4649a80b5 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/OverlappingEdgeCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/OverlappingEdgeCheck.java @@ -28,9 +28,9 @@ /** * Checks that two Edges do not share the same two consecutive geometry points. Each segment of a - * master Edge is checked for overlapping segments of other master edges. If an Edge has previously - * been found to overlap some Edge, it will not be flagged unless it is overlapped by an Edge not - * flagged yet. It ignores edges that are part of pedestrian areas. + * main Edge is checked for overlapping segments of other main edges. If an Edge has previously been + * found to overlap some Edge, it will not be flagged unless it is overlapped by an Edge not flagged + * yet. It ignores edges that are part of pedestrian areas. * * @author brian_l_davis * @author sayana_saithu @@ -71,7 +71,7 @@ public OverlappingEdgeCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && ((Edge) object).isMasterEdge() + return object instanceof Edge && ((Edge) object).isMainEdge() && !(this.filterPedestrianAreas && this.edgeIsArea((Edge) object)); } @@ -91,7 +91,7 @@ protected Optional flag(final AtlasObject object) final Rectangle box = start.boxAround(Distance.meters(0)); // add all overlapping edges not yet flagged and not pedestrian areas overlappingItems.addAll(Iterables - .stream(atlas.edgesIntersecting(box, Edge::isMasterEdge)) + .stream(atlas.edgesIntersecting(box, Edge::isMainEdge)) .filter(notEqual(object).and(notIn(object)) .and(this.overlapsSegment(start, end)) .and(this.filterPedestrianAreas ? edge -> !this.edgeIsArea(edge) @@ -184,7 +184,7 @@ private boolean isPartOfClosedWay(final Edge object) { wayIds.add(nextEdge.getIdentifier()); final List nextEdgeList = Iterables.stream(nextEdge.outEdges()) - .filter(Edge::isMasterEdge) + .filter(Edge::isMainEdge) .filter(outEdge -> outEdge.getOsmIdentifier() == object.getOsmIdentifier()) .collectToList(); nextEdge = nextEdgeList.isEmpty() ? null : nextEdgeList.get(0); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoadLinkCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoadLinkCheck.java index c563369f7..094b08b58 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoadLinkCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoadLinkCheck.java @@ -41,7 +41,7 @@ public RoadLinkCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { return object instanceof Edge && ((Edge) object).highwayTag().isLink() - && ((Edge) object).isMasterEdge() && !this.isFlagged(object.getOsmIdentifier()); + && ((Edge) object).isMainEdge() && !this.isFlagged(object.getOsmIdentifier()); } @Override @@ -54,12 +54,12 @@ protected Optional flag(final AtlasObject object) return Optional.of(this.createFlag(new OsmWayWalker(edge).collectEdges(), this.getLocalizedInstruction(0, edge.length(), this.maximumLength))); } - else if (edge.connectedEdges().stream().filter(Edge::isMasterEdge).noneMatch( + else if (edge.connectedEdges().stream().filter(Edge::isMainEdge).noneMatch( connected -> connected.highwayTag().isOfEqualClassification(edge.highwayTag()))) { final Set geometry = new HashSet<>(); geometry.add(edge); - geometry.addAll(edge.connectedEdges().stream().filter(Edge::isMasterEdge) + geometry.addAll(edge.connectedEdges().stream().filter(Edge::isMainEdge) .collect(Collectors.toSet())); final Set flagEdges = geometry.stream() .flatMap(obj -> new OsmWayWalker((Edge) obj).collectEdges().stream()) diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheck.java index bfb31a32d..50960b03e 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheck.java @@ -46,8 +46,8 @@ private static boolean aConnectedNodeHasValenceLessThan(final Edge edge, final i .connectedNodes().stream() // check if any of them has less than given valence value .anyMatch(node -> node.connectedEdges().stream() - // counting only master edge connections - .filter(Edge::isMasterEdge).count() < valence); + // counting only main edge connections + .filter(Edge::isMainEdge).count() < valence); } /** @@ -100,10 +100,10 @@ protected Optional flag(final AtlasObject object) // Rule: a roundabout edge must be one-way // Since Atlas creates two edges for a bidirectional in OSM, - // a one-way road must be the master edge + // a one-way road must be the main edge // Rule: a roundabout is assumed to be one-way by default // If a one-way tag explicitly says otherwise, then flag it - if (!edge.isMasterEdge() || OneWayTag.isExplicitlyTwoWay(edge)) + if (!edge.isMainEdge() || OneWayTag.isExplicitlyTwoWay(edge)) { this.markAsFlagged(object.getOsmIdentifier()); return Optional.of(createFlag(new OsmWayWalker(edge).collectEdges(), diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutMissingTagCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutMissingTagCheck.java index e61b754e6..8507871f1 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutMissingTagCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutMissingTagCheck.java @@ -43,6 +43,7 @@ public class RoundaboutMissingTagCheck extends BaseCheck .singletonList(MISSING_JUNCTION_TAG_INSTRUCTION); private static final double MAX_THRESHOLD_DEGREES_DEFAULT = 40.0; private static final double MIN_THRESHOLD_DEGREES_DEFAULT = 10.0; + private static final long serialVersionUID = 5171171744111206429L; private final Angle maxAngleThreshold; private final Angle minAngleThreshold; @@ -71,7 +72,7 @@ public boolean validCheckForObject(final AtlasObject object) { return object instanceof Edge && !this.isFlagged(object.getOsmIdentifier()) && object.getIdentifier() % MODULUS == FIRST_EDGE_SECTION - && ((Edge) object).isMasterEdge() && HighwayTag.isCarNavigableHighway(object) + && ((Edge) object).isMainEdge() && HighwayTag.isCarNavigableHighway(object) && object.getTag(JunctionTag.KEY).isEmpty() && object.getTag(AreaTag.KEY).isEmpty() && this.isPartOfClosedWay((Edge) object) && this.intersectingWithMoreThan((Edge) object); @@ -112,7 +113,7 @@ protected List getFallbackInstructions() } /** - * Build original OSW way geometry from all MasterEdge sections + * Build original OSW way geometry from all MainEdge sections * * @param edge * entity to check @@ -145,7 +146,7 @@ private boolean intersectingWithMoreThan(final Edge edge) final Set edgesFormingOSMWay = new HashSet<>(new OsmWayWalker(edge).collectEdges()); final Set connectedEdges = new HashSet<>(); edgesFormingOSMWay.forEach( - connectedEdge -> connectedEdge.connectedEdges().stream().filter(Edge::isMasterEdge) + connectedEdge -> connectedEdge.connectedEdges().stream().filter(Edge::isMainEdge) // intersection with navigable roads .filter(HighwayTag::isCarNavigableHighway) .filter(obj -> obj.getTag(ServiceTag.KEY).isEmpty()) @@ -163,7 +164,7 @@ private boolean intersectingWithMoreThan(final Edge edge) */ private boolean isPartOfClosedWay(final Edge edge) { - return edge.inEdges().stream().filter(Edge::isMasterEdge) + return edge.inEdges().stream().filter(Edge::isMainEdge) .filter(inEdge -> inEdge.getOsmIdentifier() == edge.getOsmIdentifier()) .count() == 1; } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutValenceCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutValenceCheck.java index 054c7971a..238fc3c5b 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutValenceCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutValenceCheck.java @@ -23,7 +23,7 @@ * This check ensures that roundabouts with unreasonable valences are flagged. In reference to OSM * Wiki, each roundabout should have greater than 1 connection as 1 connection should be tagged as a * turning point, and no connections is obviously not a valid way. In addition, no individual Node - * within a roundabout should have more than one master Edge connecting from outside the roundabout. + * within a roundabout should have more than one main Edge connecting from outside the roundabout. * * @author savannahostrowski * @author bbreithaupt @@ -60,8 +60,8 @@ public boolean validCheckForObject(final AtlasObject object) && JunctionTag.isRoundabout(object) // And that the Edge has not already been marked as flagged && !this.isFlagged(object.getIdentifier()) - // Make sure that we are only looking at master edges - && ((Edge) object).isMasterEdge() + // Make sure that we are only looking at main edges + && ((Edge) object).isMainEdge() // Check for excluded highway types && HighwayTag.isCarNavigableHighway(object); } @@ -95,7 +95,7 @@ protected Optional flag(final AtlasObject object) { final int nodeValence = node.connectedEdges().stream() .filter(currentEdge -> HighwayTag.isCarNavigableHighway(currentEdge) - && currentEdge.isMasterEdge() && !JunctionTag.isRoundabout(currentEdge) + && currentEdge.isMainEdge() && !JunctionTag.isRoundabout(currentEdge) && !roundaboutEdges.contains(currentEdge)) .collect(Collectors.toSet()).size(); // If a Node has a valance of more than 1, flag it and the roundabout diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ShortSegmentCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ShortSegmentCheck.java index 9f873f0f6..3348991be 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ShortSegmentCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/ShortSegmentCheck.java @@ -47,7 +47,7 @@ public class ShortSegmentCheck extends BaseCheck * @param edge * {@link Edge} to check the {@link Node}s of * @param valence - * the minimum number of master edges for the node to have an acceptable valence + * the minimum number of main edges for the node to have an acceptable valence * @return an {@link Optional} containing the first low valence node found */ private static Optional getConnectedNodesWithValenceLessThan(final Edge edge, @@ -56,18 +56,18 @@ private static Optional getConnectedNodesWithValenceLessThan(final Edge ed // go through each connected node of given edge for (final Node node : edge.connectedNodes()) { - // Get the connected master edges - final List masterEdges = node.connectedEdges().stream().filter(Edge::isMasterEdge) + // Get the connected main edges + final List mainEdges = node.connectedEdges().stream().filter(Edge::isMainEdge) .collect(Collectors.toList()); // check if any of them has less than given valence value - if (masterEdges.size() < valence + if (mainEdges.size() < valence // Check if the low valence is the result of a closed way being way // sectioned // A short segment at the start or end of a closed way will have a node with - // 2 connected master edges, and they will have the same OSM id - && !(masterEdges.size() == 2 + // 2 connected main edges, and they will have the same OSM id + && !(mainEdges.size() == 2 // - && masterEdges.stream() + && mainEdges.stream() .filter(connectedEdge -> connectedEdge .getOsmIdentifier() == edge.getOsmIdentifier()) .count() > 1)) @@ -99,7 +99,7 @@ public boolean validCheckForObject(final AtlasObject object) return object instanceof Edge && ((Edge) object).highwayTag().isMoreImportantThanOrEqualTo( this.minimumHighwayPriority) - && ((Edge) object).isMasterEdge() + && ((Edge) object).isMainEdge() && ((Edge) object).length().isLessThan(this.maximumLength); } @@ -140,9 +140,9 @@ protected List getFallbackInstructions() */ private boolean isGateLike(final Edge object) { - return (object.start().connectedEdges().stream().filter(Edge::isMasterEdge).count() > 1 + return (object.start().connectedEdges().stream().filter(Edge::isMainEdge).count() > 1 && Validators.hasValuesFor(object.end(), BarrierTag.class)) - || (object.end().connectedEdges().stream().filter(Edge::isMasterEdge).count() > 1 + || (object.end().connectedEdges().stream().filter(Edge::isMainEdge).count() > 1 && Validators.hasValuesFor(object.start(), BarrierTag.class)); } } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SignPostCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SignPostCheck.java index ac3879afc..e628256b8 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SignPostCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SignPostCheck.java @@ -101,8 +101,8 @@ public SignPostCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - // Must be a master Edge, and must not have been flagged already - return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMasterEdge() + // Must be a main Edge, and must not have been flagged already + return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMainEdge() && !this.isFlagged(String.valueOf(object.getOsmIdentifier())) // Must be a link defined in the rampEdgeFilter && this.rampEdgeFilter.test(object) && ((Edge) object).highwayTag().isLink() diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SingleSegmentMotorwayCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SingleSegmentMotorwayCheck.java index 6d1ab8242..eb5edfbc6 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SingleSegmentMotorwayCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SingleSegmentMotorwayCheck.java @@ -52,7 +52,7 @@ public SingleSegmentMotorwayCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && ((Edge) object).isMasterEdge() + return object instanceof Edge && ((Edge) object).isMainEdge() && this.isMotorwayNotRoundabout((Edge) object) && !this.isFlagged(object.getOsmIdentifier()) && ((Edge) object).connectedNodes() .stream().noneMatch(SyntheticBoundaryNodeTag::isBoundaryNode); @@ -69,7 +69,7 @@ public boolean validCheckForObject(final AtlasObject object) protected Optional flag(final AtlasObject object) { final Edge edge = (Edge) object; - if (edge.connectedEdges().stream().filter(Edge::isMasterEdge) + if (edge.connectedEdges().stream().filter(Edge::isMainEdge) .noneMatch(this::isMotorwayNotRoundabout)) { this.markAsFlagged(edge.getOsmIdentifier()); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadCheck.java index 36c98885c..df494f4c4 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadCheck.java @@ -54,7 +54,7 @@ public class SnakeRoadCheck extends BaseCheck *
  • 3) {@link Edge} is not a roundabout *
  • 4) {@link Edge} is not an Open Highway Area *
  • 5) {@link Edge} is way-sectioned - *
  • 6) {@link Edge} is the master edge + *
  • 6) {@link Edge} is the main edge * * * @param candidate @@ -63,7 +63,7 @@ public class SnakeRoadCheck extends BaseCheck */ private static boolean isValidEdgeToConsider(final Edge candidate) { - return candidate.isMasterEdge() + return candidate.isMainEdge() && candidate.highwayTag().isMoreImportantThanOrEqualTo(HighwayTag.RESIDENTIAL) && candidate.highwayTag().isLessImportantThan(HighwayTag.TRUNK_LINK) && !JunctionTag.isRoundabout(candidate) @@ -131,7 +131,7 @@ private SnakeRoadNetworkWalk initializeNetworkWalk(final Edge edge) { final SnakeRoadNetworkWalk walk = new SnakeRoadNetworkWalk(edge, EDGE_HEADING_DIFFERENCE_THRESHOLD); - walk.addDirectConnections(walk.getConnectedMasterEdgeOfTheSameWay(edge)); + walk.addDirectConnections(walk.getConnectedMainEdgeOfTheSameWay(edge)); return walk; } @@ -170,7 +170,7 @@ private void walkNetwork(final Edge current, final SnakeRoadNetworkWalk walk) walk.visitEdge(current, connection); final Set oneLayerRemovedConnections = walk - .getConnectedMasterEdgeOfTheSameWay(connection); + .getConnectedMainEdgeOfTheSameWay(connection); oneLayerRemovedConnections.forEach( onceRemovedConnection -> walk.checkIfEdgeHeadingDifferenceExceedsThreshold( connection, onceRemovedConnection)); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadNetworkWalk.java b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadNetworkWalk.java index 82fb4bb60..85e257b6c 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadNetworkWalk.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/SnakeRoadNetworkWalk.java @@ -107,10 +107,10 @@ protected void filterFalsePositives() { // Gather all connected edges for the first and last edge of this road final Set connections = new HashSet<>(); - connections.addAll(getMasterEdgesForConnectedEdgesOfDifferentWays( - (Edge) getVisitedEdges().first())); - connections.addAll(getMasterEdgesForConnectedEdgesOfDifferentWays( - (Edge) getVisitedEdges().last())); + connections.addAll( + getMainEdgesForConnectedEdgesOfDifferentWays((Edge) getVisitedEdges().first())); + connections.addAll( + getMainEdgesForConnectedEdgesOfDifferentWays((Edge) getVisitedEdges().last())); // Check their connections for connected names and ref tags for (final Edge connection : connections) @@ -127,17 +127,17 @@ protected void filterFalsePositives() } /** - * Returns all connected master, non-visited {@link Edge}s that are a continuation of the same - * OSM way + * Returns all connected main, non-visited {@link Edge}s that are a continuation of the same OSM + * way * * @param edge * the {@link Edge} from which we're seeking connections * @return a set of {@link Edge}s */ - protected Set getConnectedMasterEdgeOfTheSameWay(final Edge edge) + protected Set getConnectedMainEdgeOfTheSameWay(final Edge edge) { return edge.connectedEdges().stream() - .filter(connection -> connection.isMasterEdge() + .filter(connection -> connection.isMainEdge() && connection.getOsmIdentifier() == edge.getOsmIdentifier() && !this.visitedEdges.contains(connection)) .collect(Collectors.toSet()); @@ -189,16 +189,16 @@ protected void visitEdge(final Edge comingFrom, final Edge comingTo) } /** - * Returns all connected master {@link Edge}s that are NOT part of the same way as the given + * Returns all connected main {@link Edge}s that are NOT part of the same way as the given * target {@link Edge} * * @param edge * the target {@link Edge} for which we're seeking connections * @return the {@link Set} of {@link Edge}s we found */ - private Set getMasterEdgesForConnectedEdgesOfDifferentWays(final Edge edge) + private Set getMainEdgesForConnectedEdgesOfDifferentWays(final Edge edge) { - return Iterables.stream(edge.connectedEdges()).filter(candidate -> candidate.isMasterEdge() + return Iterables.stream(edge.connectedEdges()).filter(candidate -> candidate.isMainEdge() && candidate.getOsmIdentifier() != edge.getOsmIdentifier()).collectToSet(); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/points/AddressStreetNameCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/points/AddressStreetNameCheck.java index 0b101f1c1..b653e47ec 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/points/AddressStreetNameCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/points/AddressStreetNameCheck.java @@ -77,7 +77,7 @@ protected Optional flag(final AtlasObject object) final Set streetNameValues = Iterables .stream(object.getAtlas().edgesIntersecting( ((Point) object).getLocation().boxAround(this.searchDistance), - Edge::isMasterEdge)) + Edge::isMainEdge)) .flatMap(edge -> edge.getTags(tag -> tag.startsWith(NameTag.KEY)).values()) .collectToSet(); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheck.java index db0c4d7e5..1d758798d 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheck.java @@ -35,8 +35,8 @@ /** * Checks for {@link Node}s that should be connected to nearby {@link Node}s or {@link Edge}s. The - * {@link Node}s and {@link Edge}s must be car navigable and not in the blacklisted highway filter - * in the config. + * {@link Node}s and {@link Edge}s must be car navigable and not in the denylisted highway filter in + * the config. * * @author matthieun * @author cuthbertm @@ -51,9 +51,9 @@ public class ConnectivityCheck extends BaseCheck private static final double THRESHOLD_SCALE = 1.5; private static final int MAXIMUM_ANGLE = 180; // Highways to be ignored - private static final String DEFAULT_BLACKLISTED_HIGHWAYS_TAG_FILTER = "highway->no"; + private static final String DEFAULT_DENYLISTED_HIGHWAYS_TAG_FILTER = "highway->no"; private static final long serialVersionUID = -380675222726130708L; - private final TaggableFilter blacklistedHighwaysTaggableFilter; + private final TaggableFilter denylistedHighwaysTaggableFilter; private final Distance threshold; public ConnectivityCheck(final Configuration configuration) @@ -61,9 +61,9 @@ public ConnectivityCheck(final Configuration configuration) super(configuration); this.threshold = configurationValue(configuration, "nearby.edge.distance.meters", NEARBY_EDGE_THRESHOLD_DISTANCE_METERS_DEFAULT, Distance::meters); - this.blacklistedHighwaysTaggableFilter = TaggableFilter - .forDefinition(configurationValue(configuration, "blacklisted.highway.filter", - DEFAULT_BLACKLISTED_HIGHWAYS_TAG_FILTER)); + this.denylistedHighwaysTaggableFilter = TaggableFilter + .forDefinition(configurationValue(configuration, "denylisted.highway.filter", + DEFAULT_DENYLISTED_HIGHWAYS_TAG_FILTER)); } @Override @@ -121,9 +121,9 @@ protected Optional flag(final AtlasObject object) } for (final Edge edgeNearby : nearbyEdges) { - // There is a valid master edge close by that is not validly connected to the start + // There is a valid main edge close by that is not validly connected to the start // node. - if (edgeNearby.isMasterEdge() && validEdgeFilter(edgeNearby) + if (edgeNearby.isMainEdge() && validEdgeFilter(edgeNearby) && !connectedEdges.contains(edgeNearby) && !hasValidConnection(node, connectedEdges, edgeNearby) // Make sure that the spatial index did not over estimate. @@ -342,7 +342,7 @@ && isConverging(node, rootEdge, toFind, checking)) checking.connectedEdges().forEach(edge -> { if (!visitedEdges.contains(edge) && !firstEdges.contains(edge) - && edge.isMasterEdge()) + && edge.isMainEdge()) { edgesToCheck.push(edge); visitedEdges.add(edge); @@ -406,7 +406,7 @@ && isConverging(node, rootEdge, secondEdge ? rootEdge : previousEdge, checking)) checking.connectedEdges().forEach(edge -> { if (!visitedEdges.contains(edge) && !firstEdges.contains(edge) - && edge.isMasterEdge()) + && edge.isMainEdge()) { edgesToCheck.push(edge); visitedEdges.add(edge); @@ -531,7 +531,6 @@ private boolean isConverging(final Node node, final Edge firstEdge, final Edge p private boolean validEdgeFilter(final Edge edge) { return HighwayTag.isCarNavigableHighway(edge) - && !this.blacklistedHighwaysTaggableFilter.test(edge) - && !BarrierTag.isBarrier(edge); + && !this.denylistedHighwaysTaggableFilter.test(edge) && !BarrierTag.isBarrier(edge); } } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/points/InvalidMiniRoundaboutCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/points/InvalidMiniRoundaboutCheck.java index b0108aa45..b5ea5af26 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/points/InvalidMiniRoundaboutCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/points/InvalidMiniRoundaboutCheck.java @@ -82,7 +82,7 @@ else if (!Validators.isOfType(node, DirectionTag.class, VALID_DIRECTIONS) { result = Optional .of(this.flagNode(node, carNavigableEdges, this.getLocalizedInstruction(1, - node.getOsmIdentifier(), getMasterEdgeCount(carNavigableEdges)))); + node.getOsmIdentifier(), getMainEdgeCount(carNavigableEdges)))); } return result; } @@ -128,20 +128,20 @@ private Collection getCarNavigableEdges(final Node node) } /** - * Given a list of carNavigableEdges, get the number of those edges which are master edges. + * Given a list of carNavigableEdges, get the number of those edges which are main edges. * * @param carNavigableEdges * The carNavigable edges we would like to filter. - * @return The number of edges in carNavigableEdges which are master edges. + * @return The number of edges in carNavigableEdges which are main edges. */ - private long getMasterEdgeCount(final Collection carNavigableEdges) + private long getMainEdgeCount(final Collection carNavigableEdges) { - return carNavigableEdges.stream().filter(Edge::isMasterEdge).count(); + return carNavigableEdges.stream().filter(Edge::isMainEdge).count(); } /** * Determines whether or not a set of Edges is a turnaround or not, where a turnaround is - * defined as a collection containing a master Edge and its reverse Edge. This function is only + * defined as a collection containing a main Edge and its reverse Edge. This function is only * guaranteed to return sensible results when carNavigableEdges is a collection of the connected * car-navigable Edges for a single Node. * @@ -152,6 +152,6 @@ private long getMasterEdgeCount(final Collection carNavigableEdges) */ private boolean isTurnaround(final Collection carNavigableEdges) { - return getMasterEdgeCount(carNavigableEdges) == 1 && carNavigableEdges.size() == 2; + return getMainEdgeCount(carNavigableEdges) == 1 && carNavigableEdges.size() == 2; } } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/points/NodeValenceCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/points/NodeValenceCheck.java index 7d54d6ef5..1cdc9ab86 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/points/NodeValenceCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/points/NodeValenceCheck.java @@ -52,7 +52,7 @@ protected Optional flag(final AtlasObject object) // Count car navigable connections final List connectedCarNavigableEdges = node.connectedEdges().stream() - .filter(edge -> edge.isMasterEdge() && HighwayTag.isCarNavigableHighway(edge)) + .filter(edge -> edge.isMainEdge() && HighwayTag.isCarNavigableHighway(edge)) .collect(Collectors.toList()); final int valence = connectedCarNavigableEdges.size(); if (valence > this.maximumConnections) diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheck.java index 218ef1697..abee1d6d3 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheck.java @@ -57,6 +57,7 @@ public class InvalidSignBoardRelationCheck extends BaseCheck private static final int FROM_TO_NO_MEETING_INDEX = 4; private static final int TEMP_RELATION_ID_INDEX = 5; private static final int DISCONNECTED_FROM_INDEX = 6; + private static final long serialVersionUID = 7761409062471623430L; public InvalidSignBoardRelationCheck(final Configuration configuration) { @@ -142,12 +143,12 @@ private boolean fromAndToMeet(final Route fromRoute, final Route toRoute) final Optional fromReversedOptional = fromRoute.reverse().map(Route::end); final Optional toReversedOptional = toRoute.reverse().map(Route::start); - // Both masters meet + // Both mains meet return this.edgesMeet(fromRoute.end(), toRoute.start()) - // From master meets to reversed + // From main meets to reversed || toReversedOptional.map(toReversed -> this.edgesMeet(fromRoute.end(), toReversed)) .orElse(false) - // From reverse meets to master + // From reverse meets to main || fromReversedOptional .map(fromReversed -> this.edgesMeet(fromReversed, toRoute.start())) .orElse(false) @@ -234,8 +235,7 @@ private Optional getNonEdgeReasonFromMembers(final List private Set getOsmEdges(final Edge edge) { final EdgeWalker walker = new OsmWayWalker(edge); - return walker.collectEdges().stream().filter(Edge::isMasterEdge) - .collect(Collectors.toSet()); + return walker.collectEdges().stream().filter(Edge::isMainEdge).collect(Collectors.toSet()); } /** diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheck.java index c3824b279..9f5ab987f 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheck.java @@ -61,8 +61,8 @@ public BridgeDetailedInfoCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - // only master edges shall be flagged to avoid duplicate flags on the same OSM Way - return object instanceof Edge && ((Edge) object).isMasterEdge() + // only main edges shall be flagged to avoid duplicate flags on the same OSM Way + return object instanceof Edge && ((Edge) object).isMainEdge() && Validators.isOfType(object, BridgeTag.class, BridgeTag.YES) && (RailwayTag.isRailway(object) || IS_MAJOR_HIGHWAY.test(object)); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ConflictingTagCombinationCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ConflictingTagCombinationCheck.java index 21812b561..1401d270f 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ConflictingTagCombinationCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ConflictingTagCombinationCheck.java @@ -66,8 +66,8 @@ public class ConflictingTagCombinationCheck extends BaseCheck // ref: http://wiki.openstreetmap.org/wiki/Key:service "service->*&highway->!service&highway->!construction&railway->!&waterway->!canal"); - private List conflictingTagFilters; - private List filterKeys; + private final List conflictingTagFilters; + private final List filterKeys; /** * Gathers the keys from a {@link TaggableFilter} using regex. @@ -98,7 +98,7 @@ public ConflictingTagCombinationCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { return ((object instanceof Edge && HighwayTag.isCarNavigableHighway(object) - && ((Edge) object).isMasterEdge()) || (object instanceof Line)) + && ((Edge) object).isMainEdge()) || (object instanceof Line)) && !this.isFlagged(this.getUniqueOSMIdentifier(object)); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/HighwayToFerryTagCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/HighwayToFerryTagCheck.java index a3a080ce8..b2f34c1ec 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/HighwayToFerryTagCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/HighwayToFerryTagCheck.java @@ -63,7 +63,7 @@ public HighwayToFerryTagCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMasterEdge() + return TypePredicates.IS_EDGE.test(object) && ((Edge) object).isMainEdge() && Validators.isOfType(object, RouteTag.class, RouteTag.FERRY) && this.isMinimumHighwayType(object) && !this.isFlagged(object.getOsmIdentifier()); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ImproperAndUnknownRoadNameCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ImproperAndUnknownRoadNameCheck.java index 0d15d0d68..48ae1fff6 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ImproperAndUnknownRoadNameCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/ImproperAndUnknownRoadNameCheck.java @@ -54,7 +54,7 @@ public ImproperAndUnknownRoadNameCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && ((Edge) object).isMasterEdge(); + return object instanceof Edge && ((Edge) object).isMainEdge(); } @Override diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidAccessTagCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidAccessTagCheck.java index 0c1966ab3..65d40d27c 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidAccessTagCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidAccessTagCheck.java @@ -73,7 +73,7 @@ public InvalidAccessTagCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { return AccessTag.isNo(object) && ((object instanceof Edge) || (object instanceof Line)) - && Edge.isMasterEdgeIdentifier(object.getIdentifier()) + && Edge.isMainEdgeIdentifier(object.getIdentifier()) && !this.isFlagged(object.getOsmIdentifier()) && isMinimumHighway(object); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidLanesTagCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidLanesTagCheck.java index dbf2f474e..b584697af 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidLanesTagCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/InvalidLanesTagCheck.java @@ -67,7 +67,7 @@ public boolean validCheckForObject(final AtlasObject object) { return Validators.hasValuesFor(object, LanesTag.class) && HighwayTag.isCarNavigableHighway(object) && object instanceof Edge - && ((Edge) object).isMasterEdge() && !this.lanesFilter.test(object) + && ((Edge) object).isMainEdge() && !this.lanesFilter.test(object) && !this.isFlagged(object.getOsmIdentifier()); } @@ -125,7 +125,7 @@ private HashSet connectedInvalidLanes(final AtlasObject object) polledEdge = toProcess.poll(); for (final Edge edge : polledEdge.connectedEdges()) { - if (!connectedEdges.contains(edge) && ((Edge) object).isMasterEdge() + if (!connectedEdges.contains(edge) && ((Edge) object).isMainEdge() && Validators.hasValuesFor(edge, LanesTag.class) && HighwayTag.isCarNavigableHighway(edge) && !this.lanesFilter.test(edge)) { diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/MixedCaseNameCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/MixedCaseNameCheck.java index dbe163c4e..68a845031 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/MixedCaseNameCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/MixedCaseNameCheck.java @@ -127,8 +127,8 @@ public boolean validCheckForObject(final AtlasObject object) .contains(object.tag(ISOCountryTag.KEY).toUpperCase()) // And have a name tag && Validators.hasValuesFor(object, NameTag.class) - // And if an Edge, is a master edge - && (!(object instanceof Edge) || ((Edge) object).isMasterEdge()) + // And if an Edge, is a main edge + && (!(object instanceof Edge) || ((Edge) object).isMainEdge()) // Or it must have a specific language name tag from languageNameTags || this.languageNameTags.stream() .anyMatch(key -> object.getOsmTags().containsKey(key))); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameGapCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameGapCheck.java index 22f7a590c..8660318fe 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameGapCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameGapCheck.java @@ -29,8 +29,8 @@ public class RoadNameGapCheck extends BaseCheck */ static class EdgePredicate { - private Edge edge; - private EdgeDirectionComparator edgeDirectionComparator = new EdgeDirectionComparator(); + private final Edge edge; + private final EdgeDirectionComparator edgeDirectionComparator = new EdgeDirectionComparator(); EdgePredicate(final Edge edge) { @@ -80,7 +80,7 @@ public RoadNameGapCheck(final Configuration configuration) @Override public boolean validCheckForObject(final AtlasObject object) { - return object instanceof Edge && Edge.isMasterEdgeIdentifier(object.getIdentifier()) + return object instanceof Edge && Edge.isMainEdgeIdentifier(object.getIdentifier()) && !JunctionTag.isRoundabout(object) && Validators.hasValuesFor(object, HighwayTag.class) && this.validHighwayTag.contains(object.tag(HighwayTag.KEY)); diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheck.java index 1938153bf..da6e1c6ae 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheck.java @@ -55,7 +55,7 @@ public boolean validCheckForObject(final AtlasObject object) return object instanceof Edge && ((Edge) object).highwayTag().isMoreImportantThanOrEqualTo( MINIMUM_NAME_PRIORITY_DEFAULT) - && ((Edge) object).isMasterEdge() && !this.isFlagged(object.getIdentifier()) + && ((Edge) object).isMainEdge() && !this.isFlagged(object.getIdentifier()) && ((Edge) object).getName().isPresent(); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheckWalker.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheckWalker.java index 4ce90bf9a..6e69dfd51 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheckWalker.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/RoadNameSpellingConsistencyCheckWalker.java @@ -68,9 +68,7 @@ public int getValue() // flag for spelling inconsistencies between identifiers. private static final String ALPHANUMERIC_IDENTIFIER_STRING_REGEX = ".*\\p{Nd}+.*"; private static final String CHARACTER_IDENTIFIER_STRING_REGEX = "\\p{P}.\\p{P}|.\\p{P}|\\p{P}.|^.$"; - private static final String WHITESPACE_REGEX = "\\s+"; - private static final Pattern ALPHANUMERIC_IDENTIFIER_STRING_PATTERN = Pattern .compile(ALPHANUMERIC_IDENTIFIER_STRING_REGEX); private static final Pattern CHARACTER_IDENTIFIER_STRING_PATTERN = Pattern @@ -119,8 +117,8 @@ private static Function> edgesWithinMaximumSearchDistance( return incomingEdge -> incomingEdge.end().getLocation().distanceTo(startEdge.start() .getLocation()).isLessThanOrEqualTo(maximumSearchDistance) ? incomingEdge .connectedEdges().stream() - .filter(connectedEdge -> connectedEdge.isMasterEdge() - && !exploredEdges.contains(connectedEdge.getMasterEdgeIdentifier())) + .filter(connectedEdge -> connectedEdge.isMainEdge() + && !exploredEdges.contains(connectedEdge.getMainEdgeIdentifier())) : Stream.empty(); } @@ -273,6 +271,7 @@ private static boolean similarLengthDifferentCharacters(final String incomingEdg final Distance maximumSearchDistance) { super(startEdge, edgesWithinMaximumSearchDistance(startEdge, maximumSearchDistance)); - exploredEdges.add(startEdge.getMasterEdgeIdentifier()); + exploredEdges.add(startEdge.getMainEdgeIdentifier()); } + } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/StreetNameIntegersOnlyCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/StreetNameIntegersOnlyCheck.java index 79600690e..ea4bd1746 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/StreetNameIntegersOnlyCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/StreetNameIntegersOnlyCheck.java @@ -64,7 +64,7 @@ public StreetNameIntegersOnlyCheck(final Configuration configuration) public boolean validCheckForObject(final AtlasObject object) { final Map osmTags = object.getOsmTags(); - return object instanceof Edge && ((Edge) object).isMasterEdge() + return object instanceof Edge && ((Edge) object).isMainEdge() && HighwayTag.isCarNavigableHighway(object) && this.nameKeys.stream().anyMatch(osmTags::containsKey); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/UnusualLayerTagsCheck.java b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/UnusualLayerTagsCheck.java index ecca67e2e..e8add7b68 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/validation/tag/UnusualLayerTagsCheck.java +++ b/src/main/java/org/openstreetmap/atlas/checks/validation/tag/UnusualLayerTagsCheck.java @@ -89,7 +89,7 @@ public boolean validCheckForObject(final AtlasObject object) // and one of the following && ALLOWED_TAGS.test(object) // removes one of two bi-directional edge candidates - && ((Edge) object).isMasterEdge() + && ((Edge) object).isMainEdge() // remove way sectioned duplicates && !this.isFlagged(object.getOsmIdentifier()); } diff --git a/src/main/java/org/openstreetmap/atlas/checks/vectortiles/README.md b/src/main/java/org/openstreetmap/atlas/checks/vectortiles/README.md index 144834e22..db3721d3b 100644 --- a/src/main/java/org/openstreetmap/atlas/checks/vectortiles/README.md +++ b/src/main/java/org/openstreetmap/atlas/checks/vectortiles/README.md @@ -25,7 +25,7 @@ java -Xmx12G -cp ./atlas-checks.jar org.openstreetmap.atlas.checks.distributed.I -compressOutput=false \ -countries=ECU \ -saveCheckOutput=true \ --master=local \ +-cluster=local \ -configFiles=file:/Users/n/code/atlas-checks/config/configuration.json \ -sparkOptions=spark.executor.memory->4g,spark.driver.memory->4g,spark.rdd.compress->true ``` diff --git a/src/test/java/org/openstreetmap/atlas/checks/base/CheckResourceLoaderTest.java b/src/test/java/org/openstreetmap/atlas/checks/base/CheckResourceLoaderTest.java index 80419d754..a2b98a4af 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/base/CheckResourceLoaderTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/base/CheckResourceLoaderTest.java @@ -21,54 +21,9 @@ public class CheckResourceLoaderTest { @Test - public void testBlacklistCountrySpecific() + public void testCheckCountryDenylist() { - final String configSource = "{\"CheckResourceLoader.checks.blacklist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; - final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); - final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); - - // ABC contains nothing, since the whitelist and the enabled countries have no overlap - Assert.assertTrue(checkResourceLoader.loadChecksForCountry("DEF").isEmpty()); - - // DEF contains only CheckResourceLoaderTestCheck, since that is the only overlap between - // enabled countries and the whitelist - Assert.assertTrue(checkResourceLoader.loadChecksForCountry("ABC").stream() - .allMatch(check -> check.getCheckName().startsWith("Base"))); - } - - @Test - public void testBlacklistGeneral() - { - final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"CheckResourceLoader.checks.blacklist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoaderTestCheck\":{\"enabled\": true}, \"BaseTestCheck\":{\"enabled\": false}}"; - final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); - final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); - - Assert.assertEquals(0, checkResourceLoader.loadChecks().size()); - } - - @Test - public void testBlacklistNoOp() - { - // A blacklist containing no checks shouldn't impact the behavior - final String configSource = "{\"CheckResourceLoader.checks.blacklist\": [], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; - final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); - final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); - - Assert.assertEquals(1, checkResourceLoader.loadChecksForCountry("ABC").size()); - Assert.assertEquals(1, - checkResourceLoader.loadChecksForCountry("ABC").stream().map(Check::getCheckName) - .filter(name -> name.startsWith("Base")).distinct().count()); - - Assert.assertEquals(1, checkResourceLoader.loadChecksForCountry("DEF").size()); - Assert.assertEquals(1, - checkResourceLoader.loadChecksForCountry("DEF").stream().map(Check::getCheckName) - .filter(name -> name.startsWith("CheckResource")).distinct().count()); - } - - @Test - public void testCheckCountryBlacklist() - { - final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"countries.blacklist\":[\"ABC\"]}}"; + final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"countries.denylist\":[\"ABC\"]}}"; final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); @@ -78,7 +33,7 @@ public void testCheckCountryBlacklist() } @Test - public void testCheckCountryWhitelist() + public void testCheckCountryPermitlist() { final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"countries\":[\"ABC\"]}}"; @@ -121,6 +76,51 @@ public void testCountryKeywordCheckLoading() Assert.assertEquals(country2Var2, 1); } + @Test + public void testDenylistCountrySpecific() + { + final String configSource = "{\"CheckResourceLoader.checks.denylist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; + final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); + final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); + + // ABC contains nothing, since the permitlist and the enabled countries have no overlap + Assert.assertTrue(checkResourceLoader.loadChecksForCountry("DEF").isEmpty()); + + // DEF contains only CheckResourceLoaderTestCheck, since that is the only overlap between + // enabled countries and the permitlist + Assert.assertTrue(checkResourceLoader.loadChecksForCountry("ABC").stream() + .allMatch(check -> check.getCheckName().startsWith("Base"))); + } + + @Test + public void testDenylistGeneral() + { + final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"CheckResourceLoader.checks.denylist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoaderTestCheck\":{\"enabled\": true}, \"BaseTestCheck\":{\"enabled\": false}}"; + final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); + final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); + + Assert.assertEquals(0, checkResourceLoader.loadChecks().size()); + } + + @Test + public void testDenylistNoOp() + { + // A denylist containing no checks shouldn't impact the behavior + final String configSource = "{\"CheckResourceLoader.checks.denylist\": [], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; + final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); + final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); + + Assert.assertEquals(1, checkResourceLoader.loadChecksForCountry("ABC").size()); + Assert.assertEquals(1, + checkResourceLoader.loadChecksForCountry("ABC").stream().map(Check::getCheckName) + .filter(name -> name.startsWith("Base")).distinct().count()); + + Assert.assertEquals(1, checkResourceLoader.loadChecksForCountry("DEF").size()); + Assert.assertEquals(1, + checkResourceLoader.loadChecksForCountry("DEF").stream().map(Check::getCheckName) + .filter(name -> name.startsWith("CheckResource")).distinct().count()); + } + /** * Test to make sure that if the default behavior (set in configuration) is that checks are * disabled, that no checks are loaded when not setting any explicitly @@ -220,49 +220,25 @@ public void testGroupedCountryCheckLoading() } @Test - public void testSubclassWithSpecialConstructor() - { - final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"BaseTestCheck\":{\"enabled\":true}, \"ContextAwareTestCheck\":{\"enabled\":true}}"; - final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); - final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); - - final Class[][] constructorArgumentTypes = new Class[][] { - { Configuration.class, Integer.TYPE }, { Configuration.class }, {} }; - final Object[][] constructorArguments = new Object[][] { { configuration, 12 }, - { configuration }, {} }; - - final Set checks = checkResourceLoader - .loadChecksUsingConstructors(constructorArgumentTypes, constructorArguments); - Assert.assertEquals(2, checks.size()); - checks.forEach(check -> - { - if (check instanceof ContextAwareTestCheck) - { - Assert.assertEquals(12, ((ContextAwareTestCheck) check).getData()); - } - }); - } - - @Test - public void testWhitelistCountrySpecific() + public void testPermitlistCountrySpecific() { - final String configSource = "{\"CheckResourceLoader.checks.whitelist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; + final String configSource = "{\"CheckResourceLoader.checks.permitlist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); - // ABC contains nothing, since the whitelist and the enabled countries have no overlap + // ABC contains nothing, since the permitlist and the enabled countries have no overlap Assert.assertTrue(checkResourceLoader.loadChecksForCountry("ABC").isEmpty()); // DEF contains only CheckResourceLoaderTestCheck, since that is the only overlap between - // enabled countries and the whitelist + // enabled countries and the permitlist Assert.assertTrue(checkResourceLoader.loadChecksForCountry("DEF").stream() .allMatch(check -> check.getCheckName().startsWith("CheckResource"))); } @Test - public void testWhitelistGeneral() + public void testPermitlistGeneral() { - final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"CheckResourceLoader.checks.whitelist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoaderTestCheck\":{\"enabled\": true}, \"BaseTestCheck\":{\"enabled\": false}}"; + final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"CheckResourceLoader.checks.permitlist\": [\"CheckResourceLoaderTestCheck\"], \"CheckResourceLoaderTestCheck\":{\"enabled\": true}, \"BaseTestCheck\":{\"enabled\": false}}"; final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); @@ -272,10 +248,10 @@ public void testWhitelistGeneral() } @Test - public void testWhitelistNoOp() + public void testPermitlistNoOp() { - // A whitelist containing all checks shouldn't impact the behavior - final String configSource = "{\"CheckResourceLoader.checks.whitelist\": [\"CheckResourceLoaderTestCheck\",\"BaseTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; + // A permitlist containing all checks shouldn't impact the behavior + final String configSource = "{\"CheckResourceLoader.checks.permitlist\": [\"CheckResourceLoaderTestCheck\",\"BaseTestCheck\"], \"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"],\"CheckResourceLoaderTestCheck\":{\"enabled\": true, \"override.ABC.enabled\": false}, \"BaseTestCheck\":{\"enabled\": false, \"override.ABC.enabled\": true}}"; final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); @@ -289,4 +265,28 @@ public void testWhitelistNoOp() checkResourceLoader.loadChecksForCountry("DEF").stream().map(Check::getCheckName) .filter(name -> name.startsWith("CheckResource")).distinct().count()); } + + @Test + public void testSubclassWithSpecialConstructor() + { + final String configSource = "{\"CheckResourceLoader.scanUrls\": [\"org.openstreetmap.atlas.checks.base.checks\"], \"BaseTestCheck\":{\"enabled\":true}, \"ContextAwareTestCheck\":{\"enabled\":true}}"; + final Configuration configuration = ConfigurationResolver.inlineConfiguration(configSource); + final CheckResourceLoader checkResourceLoader = new CheckResourceLoader(configuration); + + final Class[][] constructorArgumentTypes = new Class[][] { + { Configuration.class, Integer.TYPE }, { Configuration.class }, {} }; + final Object[][] constructorArguments = new Object[][] { { configuration, 12 }, + { configuration }, {} }; + + final Set checks = checkResourceLoader + .loadChecksUsingConstructors(constructorArgumentTypes, constructorArguments); + Assert.assertEquals(2, checks.size()); + checks.forEach(check -> + { + if (check instanceof ContextAwareTestCheck) + { + Assert.assertEquals(12, ((ContextAwareTestCheck) check).getData()); + } + }); + } } diff --git a/src/test/java/org/openstreetmap/atlas/checks/base/CountryTest.java b/src/test/java/org/openstreetmap/atlas/checks/base/CountryTest.java index 2f45e536c..561f21078 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/base/CountryTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/base/CountryTest.java @@ -7,17 +7,17 @@ import org.openstreetmap.atlas.utilities.configuration.Configuration; /** - * Test the countries.whitelist and countries.blacklist functionality. This allows users to filter - * checks based on countries, by either allowing only countries in the whitelist or not allowing any - * countries in the blacklist + * Test the countries.permitlist and countries.denylist functionality. This allows users to filter + * checks based on countries, by either allowing only countries in the permitlist or not allowing + * any countries in the denylist * * @author cuthbertm */ public class CountryTest { /** - * Test to make sure both the keys "countries" and "countries.whitelist" work for the whitelist - * option + * Test to make sure both the keys "countries" and "countries.permitlist" work for the + * permitlist option */ @Test public void testBackwardsCompatibility() @@ -27,55 +27,55 @@ public void testBackwardsCompatibility() } /** - * Test that all countries included in the blacklist are ignored, and any countries not included - * in the blacklist are used. + * Two tests: 1. Test that if containing permitlist and denylist, that only countries in the + * permitlist are used and all countries in the denylist are ignored. 2. Test that if a country + * is both in the permitlist and the denylist that the country value in the permitlist takes + * precedence */ @Test - public void testBlacklistCountries() + public void testCombinationCountries() { - final String countryConfig = "{\"BaseTestCheck\":{\"countries.blacklist\":[\"AIA\",\"DOM\"]}}"; + final String countryConfig = "{\"BaseTestCheck\":{\"countries.permitlist\":[\"IRN\",\"IRQ\"],\"countries.denylist\":[\"AIA\",\"DOM\"]}}"; + this.testConfiguration(countryConfig, "IRN", true); + this.testConfiguration(countryConfig, "IRQ", true); this.testConfiguration(countryConfig, "AIA", false); this.testConfiguration(countryConfig, "DOM", false); - this.testConfiguration(countryConfig, "IRN", true); + final String countryConfig2 = "{\"BaseTestCheck\":{\"countries.permitlist\":[\"IRN\"],\"countries.denylist\":[\"IRN\"]}}"; + this.testConfiguration(countryConfig2, "IRN", true); } /** - * Two tests: 1. Test that if containing whitelist and blacklist, that only countries in the - * whitelist are used and all countries in the blacklist are ignored. 2. Test that if a country - * is both in the whitelist and the blacklist that the country value in the whitelist takes - * precedence + * Test that all countries included in the denylist are ignored, and any countries not included + * in the denylist are used. */ @Test - public void testCombinationCountries() + public void testDenylistCountries() { - final String countryConfig = "{\"BaseTestCheck\":{\"countries.whitelist\":[\"IRN\",\"IRQ\"],\"countries.blacklist\":[\"AIA\",\"DOM\"]}}"; - this.testConfiguration(countryConfig, "IRN", true); - this.testConfiguration(countryConfig, "IRQ", true); + final String countryConfig = "{\"BaseTestCheck\":{\"countries.denylist\":[\"AIA\",\"DOM\"]}}"; this.testConfiguration(countryConfig, "AIA", false); this.testConfiguration(countryConfig, "DOM", false); - final String countryConfig2 = "{\"BaseTestCheck\":{\"countries.whitelist\":[\"IRN\"],\"countries.blacklist\":[\"IRN\"]}}"; - this.testConfiguration(countryConfig2, "IRN", true); + this.testConfiguration(countryConfig, "IRN", true); } /** - * Test that if you supply an empty country whitelist, that the option is essentially ignored + * Test that if you supply an empty country permitlist, that the option is essentially ignored * and all countries are allowed. */ @Test public void testNoCountries() { - final String countryConfig = "{\"BaseTestCheck\":{\"countries.whitelist\":[]}}"; + final String countryConfig = "{\"BaseTestCheck\":{\"countries.permitlist\":[]}}"; this.testConfiguration(countryConfig, "AIA", true); } /** - * Test that only countries included in the whitelist are used, and any countries not included - * in the whitelist are ignored. + * Test that only countries included in the permitlist are used, and any countries not included + * in the permitlist are ignored. */ @Test - public void testWhitelistCountries() + public void testPermitlistCountries() { - final String countryConfig = "{\"BaseTestCheck\":{\"countries.whitelist\":[\"AIA\",\"DOM\"]}}"; + final String countryConfig = "{\"BaseTestCheck\":{\"countries.permitlist\":[\"AIA\",\"DOM\"]}}"; this.testConfiguration(countryConfig, "AIA", true); this.testConfiguration(countryConfig, "DOM", true); this.testConfiguration(countryConfig, "IRN", false); diff --git a/src/test/java/org/openstreetmap/atlas/checks/base/TagTest.java b/src/test/java/org/openstreetmap/atlas/checks/base/TagTest.java index 13678a0d0..43ae9b864 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/base/TagTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/base/TagTest.java @@ -28,17 +28,17 @@ public class TagTest /** * Test combination tags. In the two cases first, filter by any features that contain the tag - * and value "whitelist=true" but does not contain the value "blacklist=false". We specifically + * and value "permitlist=true" but does not contain the value "denylist=false". We specifically * used the filter "!true" even though we could have used "false" to test negation in filters. - * Second, Test the OR functionality, process all features that contain "whitelist=true" or + * Second, Test the OR functionality, process all features that contain "permitlist=true" or * "highway=trunk". */ @Test public void testCombinationTags() { - final String config = "{\"BaseTestCheck\":{\"tags.filter\":\"whitelist->true&blacklist->!true\"}}"; + final String config = "{\"BaseTestCheck\":{\"tags.filter\":\"permitlist->true&denylist->!true\"}}"; this.testConfiguration(config, 1); - final String config2 = "{\"BaseTestCheck\":{\"tags.filter\":\"whitelist->true|highway->trunk\"}}"; + final String config2 = "{\"BaseTestCheck\":{\"tags.filter\":\"permitlist->true|highway->trunk\"}}"; this.testConfiguration(config2, 5); } @@ -49,7 +49,7 @@ public void testCombinationTags() @Test public void testNoRestrictions() { - final String config = "{\"BaseTestCheck\":{\"tags.whitelist.filter\":\"\"}}"; + final String config = "{\"BaseTestCheck\":{\"tags.permitlist.filter\":\"\"}}"; this.testConfiguration(config, 8); } diff --git a/src/test/java/org/openstreetmap/atlas/checks/base/checks/BaseTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/base/checks/BaseTestRule.java index 06fbe307e..7946c7b87 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/base/checks/BaseTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/base/checks/BaseTestRule.java @@ -21,9 +21,9 @@ public class BaseTestRule extends CoreTestRule @TestAtlas.Node(id = "2", coordinates = @TestAtlas.Loc(value = TWO), tags = { "test=ignore" }), @TestAtlas.Node(id = "3", coordinates = @TestAtlas.Loc(value = THREE), tags = { - "whitelist=true" }), + "permitlist=true" }), @TestAtlas.Node(id = "4", coordinates = @TestAtlas.Loc(value = FOUR), tags = { - "whitelist=true", "blacklist=true" }), + "permitlist=true", "denylist=true" }), @TestAtlas.Node(id = "5", coordinates = @TestAtlas.Loc(value = FIVE)) }, edges = { diff --git a/src/test/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommandTest.java b/src/test/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommandTest.java index 8c4d2ebaf..4496daa9c 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommandTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/database/FlagDatabaseSubCommandTest.java @@ -36,21 +36,20 @@ */ public class FlagDatabaseSubCommandTest { - private String flag1 = CheckFlagTest.class.getResource("checkflags1.log").getPath(); - private String testDatabaseURI = String.format("localhost/%s", Instant.now().getNano()); private static final Gson gson = new GsonBuilder() .registerTypeAdapter(CheckFlag.class, new CheckFlagDeserializer()).create(); - + private final String flag1 = CheckFlagTest.class.getResource("checkflags1.log").getPath(); + private final String testDatabaseURI = String.format("localhost/%s", Instant.now().getNano()); @Mock - private DatabaseConnection dbConnection = Mockito.mock(DatabaseConnection.class); + private final DatabaseConnection dbConnection = Mockito.mock(DatabaseConnection.class); @Mock - private Connection connection = Mockito.mock(Connection.class); + private final Connection connection = Mockito.mock(Connection.class); @Mock - private Statement statement = Mockito.mock(Statement.class); + private final Statement statement = Mockito.mock(Statement.class); @Mock - private PreparedStatement preparedStatement = Mockito.mock(PreparedStatement.class); + private final PreparedStatement preparedStatement = Mockito.mock(PreparedStatement.class); @Mock - private PreparedStatement preparedStatement2 = Mockito.mock(PreparedStatement.class); + private final PreparedStatement preparedStatement2 = Mockito.mock(PreparedStatement.class); @Test public void batchFeatureStatementTest() throws IOException, SQLException @@ -148,7 +147,7 @@ public void processCheckFlagsTest() throws IOException, SQLException } @Test - public void tagBlacklistTest() throws IOException + public void tagDenylistTest() throws IOException { final FlagDatabaseSubCommand command = new FlagDatabaseSubCommand(); diff --git a/src/test/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJobTest.java b/src/test/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJobTest.java index c9772ea93..4e4d25ab1 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJobTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/distributed/ShardedIntegrityChecksSparkJobTest.java @@ -128,7 +128,7 @@ private void runShardedIntegrityChecksSparkJob() String.format("-sharding=slippy@%s", ZOOM_LEVEL), "-maxShardLoad=1", "-outputFormats=flags,geojson,metrics,tippecanoe", "-compressOutput=false", String.format("-countries=%s", COUNTRY_CODE), "-saveCheckOutput=true", - "-master=local", + "-cluster=local", String.format("-configFiles=file:%s", ShardedIntegrityChecksSparkJobTest.class .getResource("test_configuration.json").getPath()), diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTest.java b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTest.java index 80ed2861f..dadb3a471 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTest.java @@ -56,9 +56,9 @@ public void testInvalidCrossingItemsWithSameLayerTagAtlas() } @Test - public void testInvalidCrossingNonMasterItemsAtlas() + public void testInvalidCrossingNonMainItemsAtlas() { - this.verifier.actual(this.setup.invalidCrossingNonMasterItemsAtlas(), + this.verifier.actual(this.setup.invalidCrossingNonMainItemsAtlas(), new EdgeCrossingEdgeCheck(this.configuration)); this.verifier.verifyNotEmpty(); this.verifier.globallyVerify(flags -> Assert.assertEquals(1, flags.size())); diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTestRule.java index dd4453ba8..13dbcf452 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/EdgeCrossingEdgeCheckTestRule.java @@ -105,7 +105,7 @@ public class EdgeCrossingEdgeCheckTestRule extends CoreTestRule @Loc(value = LOCATION_5) }, tags = { "highway=motorway" }), @Edge(id = "-423456789000000", coordinates = { @Loc(value = LOCATION_1), @Loc(value = LOCATION_4) }, tags = { "highway=motorway" }) }) - private Atlas invalidCrossingNonMasterItemsAtlas; + private Atlas invalidCrossingNonMainItemsAtlas; @TestAtlas( // nodes @@ -204,9 +204,9 @@ public Atlas invalidCrossingItemsWithSameLayerTagAtlas() return this.invalidCrossingItemsWithSameLayerTagAtlas; } - public Atlas invalidCrossingNonMasterItemsAtlas() + public Atlas invalidCrossingNonMainItemsAtlas() { - return this.invalidCrossingNonMasterItemsAtlas; + return this.invalidCrossingNonMainItemsAtlas; } public Atlas noCrossingItemsAtlas() diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheckTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheckTestRule.java index 659617e28..4fb40b4bd 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheckTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheckTestRule.java @@ -334,7 +334,7 @@ public class LineCrossingWaterBodyCheckTestRule extends CoreTestRule // Line crossing waterbody with no tags @Line(id = "2", coordinates = { @Loc(value = LOCATION_OUTSIDE_AREA_2), @Loc(value = LOCATION_OUTSIDE_AREA_4) }), - // Line crossing water body with tags not in whitelist, will be flagged + // Line crossing water body with tags not in permitlist, will be flagged @Line(id = "3", coordinates = { @Loc(value = LOCATION_OUTSIDE_AREA_1), @Loc(value = AREA_LOCATION_5), @Loc(value = LOCATION_OUTSIDE_AREA_3) }, tags = { "route=road" }), @@ -344,12 +344,12 @@ public class LineCrossingWaterBodyCheckTestRule extends CoreTestRule @Loc(value = LOCATION_OUTSIDE_AREA_4) }) }, // Relations relations = { - // Multipolygon relation with no whitelisted tags - will be flagged + // Multipolygon relation with no permitlisted tags - will be flagged @Relation(members = { @Member(id = "1", type = "line", role = RelationTypeTag.MULTIPOLYGON_ROLE_OUTER), @Member(id = "2", type = "line", role = RelationTypeTag.MULTIPOLYGON_ROLE_INNER) }, tags = { "type=multipolygon" }), - // Multipolygon relation with whitelisted tag - will not be flagged + // Multipolygon relation with permitlisted tag - will not be flagged @Relation(members = { @Member(id = "4", type = "line", role = RelationTypeTag.MULTIPOLYGON_ROLE_OUTER) }, tags = { "type=multipolygon", "place=village" }) }) diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTest.java b/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTest.java index f7ccb8772..100cc4992 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTest.java @@ -20,9 +20,9 @@ public class RoundaboutClosedLoopCheckTest public ConsumerBasedExpectedCheckVerifier verifier = new ConsumerBasedExpectedCheckVerifier(); @Test - public void masterRoundaboutEdgeWithValence1NodesAtlas() + public void mainRoundaboutEdgeWithValence1NodesAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgeWithValence1NodesAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgeWithValence1NodesAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyNotNull(); this.verifier.globallyVerify(flags -> Assert.assertEquals(1, flags.size())); @@ -31,41 +31,41 @@ public void masterRoundaboutEdgeWithValence1NodesAtlas() } @Test - public void masterRoundaboutEdgesWithMiniRoundaboutTagAtlas() + public void mainRoundaboutEdgesWithMiniRoundaboutTagAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithMiniRoundaboutTagAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithMiniRoundaboutTagAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } @Test - public void masterRoundaboutEdgesWithTrafficCalmingTagAtlas() + public void mainRoundaboutEdgesWithTrafficCalmingTagAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithTrafficCalmingTagAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithTrafficCalmingTagAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } @Test - public void masterRoundaboutEdgesWithTurningCircleTagAtlas() + public void mainRoundaboutEdgesWithTurningCircleTagAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithTurningCircleTagAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithTurningCircleTagAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } @Test - public void masterRoundaboutEdgesWithTurningLoopTagAtlas() + public void mainRoundaboutEdgesWithTurningLoopTagAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithTurningLoopTagAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithTurningLoopTagAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } @Test - public void testMasterRoundaboutEdgesWithABidirectionalRoadAtlas() + public void testMainRoundaboutEdgesWithABidirectionalRoadAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithABidirectionalRoadAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithABidirectionalRoadAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyNotNull(); this.verifier.globallyVerify(flags -> Assert.assertEquals(1, flags.size())); @@ -74,9 +74,9 @@ public void testMasterRoundaboutEdgesWithABidirectionalRoadAtlas() } @Test - public void testMasterRoundaboutEdgesWithDeadEndNodesAtlas() + public void testMainRoundaboutEdgesWithDeadEndNodesAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithDeadEndNodesAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithDeadEndNodesAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.globallyVerify(flags -> Assert.assertEquals(2, flags.size())); this.verifier.verify(flag -> Assert.assertTrue(flag.getInstructions() @@ -84,17 +84,17 @@ public void testMasterRoundaboutEdgesWithDeadEndNodesAtlas() } @Test - public void testMasterRoundaboutEdgesWithOneMissingOneWayTagAtlas() + public void testMainRoundaboutEdgesWithOneMissingOneWayTagAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithOneMissingOneWayTagAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithOneMissingOneWayTagAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } @Test - public void testMasterRoundaboutEdgesWithValence2NodesAtlas() + public void testMainRoundaboutEdgesWithValence2NodesAtlas() { - this.verifier.actual(this.setup.masterRoundaboutEdgesWithValence2NodesAtlas(), + this.verifier.actual(this.setup.mainRoundaboutEdgesWithValence2NodesAtlas(), new RoundaboutClosedLoopCheck(ConfigurationResolver.emptyConfiguration())); this.verifier.verifyEmpty(); } diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTestRule.java index 35ea1a644..1328d1310 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/linear/edges/RoundaboutClosedLoopCheckTestRule.java @@ -34,7 +34,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule // edges edges = { @Edge(coordinates = { @Loc(value = TEST_1), @Loc(value = TEST_2) }, tags = { "junction=roundabout", "oneway=yes" }) }) - private Atlas masterRoundaboutEdgeWithValence1NodesAtlas; + private Atlas mainRoundaboutEdgeWithValence1NodesAtlas; @TestAtlas( // nodes @@ -52,7 +52,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "junction=roundabout" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "junction=roundabout" }) }) - private Atlas masterRoundaboutEdgesWithValence2NodesAtlas; + private Atlas mainRoundaboutEdgesWithValence2NodesAtlas; @TestAtlas( // nodes @@ -70,7 +70,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "highway=mini_roundabout" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "highway=mini_roundabout" }) }) - private Atlas masterRoundaboutEdgesWithMiniRoundaboutTagAtlas; + private Atlas mainRoundaboutEdgesWithMiniRoundaboutTagAtlas; @TestAtlas( // nodes @@ -88,7 +88,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "highway=turning_circle" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "highway=turning_circle" }) }) - private Atlas masterRoundaboutEdgesWithTurningCircleTagAtlas; + private Atlas mainRoundaboutEdgesWithTurningCircleTagAtlas; @TestAtlas( // nodes @@ -106,7 +106,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "highway=turning_loop" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "highway=turning_loop" }) }) - private Atlas masterRoundaboutEdgesWithTurningLoopTagAtlas; + private Atlas mainRoundaboutEdgesWithTurningLoopTagAtlas; @TestAtlas( // nodes @@ -124,7 +124,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "traffic_calming=island" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "traffic_calming=island" }) }) - private Atlas masterRoundaboutEdgesWithTrafficCalmingTagAtlas; + private Atlas mainRoundaboutEdgesWithTrafficCalmingTagAtlas; @TestAtlas( // nodes @@ -140,7 +140,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule @Loc(value = TEST_3) }, tags = { "junction=roundabout" }), @Edge(id = "3234567891000000", coordinates = { @Loc(value = TEST_3), @Loc(value = TEST_4) }, tags = { "junction=roundabout" }) }) - private Atlas masterRoundaboutEdgesWithDeadEndNodesAtlas; + private Atlas mainRoundaboutEdgesWithDeadEndNodesAtlas; @TestAtlas( // nodes @@ -160,7 +160,7 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule @Loc(value = TEST_1) }, tags = { "junction=roundabout" }), @Edge(id = "-10", coordinates = { @Loc(value = TEST_1), @Loc(value = TEST_4) }, tags = { "junction=roundabout" }) }) - private Atlas masterRoundaboutEdgesWithABidirectionalRoadAtlas; + private Atlas mainRoundaboutEdgesWithABidirectionalRoadAtlas; @TestAtlas( // nodes @@ -178,51 +178,51 @@ public class RoundaboutClosedLoopCheckTestRule extends CoreTestRule "junction=roundabout", "oneway=yes" }), @Edge(coordinates = { @Loc(value = TEST_4), @Loc(value = TEST_1) }, tags = { "junction=roundabout" }) }) - private Atlas masterRoundaboutEdgesWithOneMissingOneWayTagAtlas; + private Atlas mainRoundaboutEdgesWithOneMissingOneWayTagAtlas; - public Atlas masterRoundaboutEdgeWithValence1NodesAtlas() + public Atlas mainRoundaboutEdgeWithValence1NodesAtlas() { - return this.masterRoundaboutEdgeWithValence1NodesAtlas; + return this.mainRoundaboutEdgeWithValence1NodesAtlas; } - public Atlas masterRoundaboutEdgesWithABidirectionalRoadAtlas() + public Atlas mainRoundaboutEdgesWithABidirectionalRoadAtlas() { - return this.masterRoundaboutEdgesWithABidirectionalRoadAtlas; + return this.mainRoundaboutEdgesWithABidirectionalRoadAtlas; } - public Atlas masterRoundaboutEdgesWithDeadEndNodesAtlas() + public Atlas mainRoundaboutEdgesWithDeadEndNodesAtlas() { - return this.masterRoundaboutEdgesWithDeadEndNodesAtlas; + return this.mainRoundaboutEdgesWithDeadEndNodesAtlas; } - public Atlas masterRoundaboutEdgesWithMiniRoundaboutTagAtlas() + public Atlas mainRoundaboutEdgesWithMiniRoundaboutTagAtlas() { - return this.masterRoundaboutEdgesWithMiniRoundaboutTagAtlas; + return this.mainRoundaboutEdgesWithMiniRoundaboutTagAtlas; } - public Atlas masterRoundaboutEdgesWithOneMissingOneWayTagAtlas() + public Atlas mainRoundaboutEdgesWithOneMissingOneWayTagAtlas() { - return this.masterRoundaboutEdgesWithOneMissingOneWayTagAtlas; + return this.mainRoundaboutEdgesWithOneMissingOneWayTagAtlas; } - public Atlas masterRoundaboutEdgesWithTrafficCalmingTagAtlas() + public Atlas mainRoundaboutEdgesWithTrafficCalmingTagAtlas() { - return this.masterRoundaboutEdgesWithTrafficCalmingTagAtlas; + return this.mainRoundaboutEdgesWithTrafficCalmingTagAtlas; } - public Atlas masterRoundaboutEdgesWithTurningCircleTagAtlas() + public Atlas mainRoundaboutEdgesWithTurningCircleTagAtlas() { - return this.masterRoundaboutEdgesWithTurningCircleTagAtlas; + return this.mainRoundaboutEdgesWithTurningCircleTagAtlas; } - public Atlas masterRoundaboutEdgesWithTurningLoopTagAtlas() + public Atlas mainRoundaboutEdgesWithTurningLoopTagAtlas() { - return this.masterRoundaboutEdgesWithTurningLoopTagAtlas; + return this.mainRoundaboutEdgesWithTurningLoopTagAtlas; } - public Atlas masterRoundaboutEdgesWithValence2NodesAtlas() + public Atlas mainRoundaboutEdgesWithValence2NodesAtlas() { - return this.masterRoundaboutEdgesWithValence2NodesAtlas; + return this.mainRoundaboutEdgesWithValence2NodesAtlas; } public Atlas nonRoundaboutEdgeAtlas() diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheckTest.java b/src/test/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheckTest.java index ffe762ccc..b13957b03 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheckTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/points/ConnectivityCheckTest.java @@ -19,15 +19,15 @@ public class ConnectivityCheckTest @Rule public ConsumerBasedExpectedCheckVerifier verifier = new ConsumerBasedExpectedCheckVerifier(); - private Configuration blacklistedHighwayFilterConfig = ConfigurationResolver + private final Configuration denylistedHighwayFilterConfig = ConfigurationResolver .inlineConfiguration( - "{\"ConnectivityCheck\":{\"blacklisted.highway.filter\":\"highway->secondary\"}}"); + "{\"ConnectivityCheck\":{\"denylisted.highway.filter\":\"highway->secondary\"}}"); @Test public void highwayFilterOnInvalidDisconnectedEdgeCrossingTest() { this.verifier.actual(this.setup.invalidDisconnectedEdgesAtlas(), - new ConnectivityCheck(this.blacklistedHighwayFilterConfig)); + new ConnectivityCheck(this.denylistedHighwayFilterConfig)); this.verifier.globallyVerify(flags -> Assert.assertEquals(0, flags.size())); } @@ -35,7 +35,7 @@ public void highwayFilterOnInvalidDisconnectedEdgeCrossingTest() public void highwayFilterOnInvalidDisconnectedNodeOnEdgeTest() { this.verifier.actual(this.setup.invalidDisconnectedNodeOnEdgeAtlas(), - new ConnectivityCheck(this.blacklistedHighwayFilterConfig)); + new ConnectivityCheck(this.denylistedHighwayFilterConfig)); this.verifier.globallyVerify(flags -> Assert.assertEquals(0, flags.size())); } @@ -43,7 +43,7 @@ public void highwayFilterOnInvalidDisconnectedNodeOnEdgeTest() public void highwayFilterOnInvalidDisconnectedNodesTest() { this.verifier.actual(this.setup.invalidDisconnectedNodesAtlas(), - new ConnectivityCheck(this.blacklistedHighwayFilterConfig)); + new ConnectivityCheck(this.denylistedHighwayFilterConfig)); this.verifier.globallyVerify(flags -> Assert.assertEquals(0, flags.size())); } diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheckTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheckTestRule.java index 0f1432fcf..c33f766db 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheckTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/relations/InvalidSignBoardRelationCheckTestRule.java @@ -176,7 +176,7 @@ public class InvalidSignBoardRelationCheckTestRule extends CoreTestRule "destination=Space Needle" })) private Atlas toFromNoMeeting; - // From's reversed meets to's master + // From's reversed meets to's main @TestAtlas(nodes = { @Node(coordinates = @Loc(value = START), id = ONE), @Node(coordinates = @Loc(value = MIDDLE), id = TWO), @Node(coordinates = @Loc(value = END), id = THREE) }, points = { @@ -194,7 +194,7 @@ public class InvalidSignBoardRelationCheckTestRule extends CoreTestRule "destination=Space Needle" })) private Atlas reverseFromMeetsTo; - // From's master meets to's reversed + // From's main meets to's reversed @TestAtlas(nodes = { @Node(coordinates = @Loc(value = START), id = ONE), @Node(coordinates = @Loc(value = MIDDLE), id = TWO), @Node(coordinates = @Loc(value = END), id = THREE) }, points = { diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTest.java b/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTest.java index eabbcd5e1..d85b15b49 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTest.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTest.java @@ -81,9 +81,9 @@ public void longRailwayBridgeWithTypeIsAccepted() } @Test - public void masterAndReversedEdgesAreOnlyFlaggedOnce() + public void mainAndReversedEdgesAreOnlyFlaggedOnce() { - this.verifier.actual(this.setup.masterAndReversedEdges(), + this.verifier.actual(this.setup.mainAndReversedEdges(), new BridgeDetailedInfoCheck(this.inlineConfiguration)); this.verifier.globallyVerify(flags -> Assert.assertEquals(1, flags.size())); } diff --git a/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTestRule.java b/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTestRule.java index e63c5c14f..3894a77ea 100644 --- a/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTestRule.java +++ b/src/test/java/org/openstreetmap/atlas/checks/validation/tag/BridgeDetailedInfoCheckTestRule.java @@ -97,7 +97,7 @@ public class BridgeDetailedInfoCheckTestRule extends CoreTestRule @Loc(value = LOC_4) }, tags = { "railway=rail", "bridge=yes" }), @Edge(id = "-1000000001", coordinates = { @Loc(value = LOC_4), @Loc(value = LOC_3) }, tags = { "railway=rail", "bridge=yes" }) }) - private Atlas masterAndReversedEdges; + private Atlas mainAndReversedEdges; @TestAtlas( // nodes @@ -143,9 +143,9 @@ public Atlas longRailwayBridgeWithType() return this.longRailwayBridgeWithType; } - public Atlas masterAndReversedEdges() + public Atlas mainAndReversedEdges() { - return this.masterAndReversedEdges; + return this.mainAndReversedEdges; } public Atlas shortGenericHighwayBridge()