Search in sources :

Example 1 with FlaggedObject

use of org.openstreetmap.atlas.checks.flag.FlaggedObject in project atlas-checks by osmlab.

the class SignPostCheckTest method primaryLinkTrunkMissingJunctionAndDestinationAtlas.

@Test
public void primaryLinkTrunkMissingJunctionAndDestinationAtlas() {
    this.verifier.actual(this.setup.primaryLinkTrunkMissingJunctionAndDestinationAtlas(), CHECK);
    this.verifier.verifyExpectedSize(1);
    this.verifier.verify(flag -> verify(flag, 2, true, true));
    // Verify that we flagged starting node of the ramp (formed by 2 edges)
    this.verifier.verify(flag -> {
        final FlaggedObject flaggedPoint = flag.getFlaggedObjects().stream().filter(object -> object instanceof FlaggedPoint).findFirst().get();
        final Location flaggedLocation = flaggedPoint.getGeometry().iterator().next();
        Assert.assertEquals(Location.forString(SignPostCheckTestRule.LINK_1), flaggedLocation);
    });
}
Also used : FlaggedObject(org.openstreetmap.atlas.checks.flag.FlaggedObject) FlaggedPoint(org.openstreetmap.atlas.checks.flag.FlaggedPoint) Location(org.openstreetmap.atlas.geography.Location) Test(org.junit.Test)

Example 2 with FlaggedObject

use of org.openstreetmap.atlas.checks.flag.FlaggedObject in project atlas-checks by osmlab.

the class SignPostCheckTest method motorwayLinkMotorwayMissingJunctionAndDestinationAtlas.

@Test
public void motorwayLinkMotorwayMissingJunctionAndDestinationAtlas() {
    this.verifier.actual(this.setup.motorwayLinkMotorwayMissingJunctionAndDestinationAtlas(), CHECK);
    this.verifier.verifyExpectedSize(1);
    this.verifier.verify(flag -> verify(flag, 2, true, true));
    // Verify that we flagged starting node of the ramp (formed by single edge)
    this.verifier.verify(flag -> {
        final FlaggedObject flaggedPoint = flag.getFlaggedObjects().stream().filter(object -> object instanceof FlaggedPoint).findFirst().get();
        final Location flaggedLocation = flaggedPoint.getGeometry().iterator().next();
        Assert.assertEquals(Location.forString(SignPostCheckTestRule.LINK_1), flaggedLocation);
    });
}
Also used : FlaggedObject(org.openstreetmap.atlas.checks.flag.FlaggedObject) FlaggedPoint(org.openstreetmap.atlas.checks.flag.FlaggedPoint) Location(org.openstreetmap.atlas.geography.Location) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 FlaggedObject (org.openstreetmap.atlas.checks.flag.FlaggedObject)2 FlaggedPoint (org.openstreetmap.atlas.checks.flag.FlaggedPoint)2 Location (org.openstreetmap.atlas.geography.Location)2