Class Highways
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.Test
-
- org.openstreetmap.josm.data.validation.tests.Highways
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
public class Highways extends Test
Test that performs semantic checks on highways.- Since:
- 5902
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest
-
-
Field Summary
Fields Modifier and Type Field Description private int
carsWays
(package private) static List<String>
CLASSIFIED_HIGHWAYS
Classified highways in order of importanceprivate int
cyclistWays
private static Set<String>
ISO_COUNTRIES
private static Set<String>
KNOWN_SOURCE_MAXSPEED_CONTEXTS
private boolean
leftByCars
private boolean
leftByCyclists
private boolean
leftByPedestrians
protected static int
MISSING_PEDESTRIAN_CROSSING
private int
pedestrianWays
protected static String
SOURCE_MAXSPEED
protected static int
SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_HIGHWAY
protected static int
SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_MAXSPEED
protected static int
SOURCE_MAXSPEED_UNKNOWN_CONTEXT
protected static int
SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE
protected static int
SOURCE_WRONG_LINK
protected static int
WRONG_ROUNDABOUT_HIGHWAY
-
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, stopwatch, testBeforeUpload
-
-
Constructor Summary
Constructors Constructor Description Highways()
Constructs a newHighways
test.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
handleCarWay(Node n, Way w)
private void
handleCyclistWay(Node n, Way w)
private void
handlePedestrianWay(Node n, Way w)
static boolean
isHighwayLinkOkay(Way way)
Determines if the given link road is correct, see https://wiki.openstreetmap.org/wiki/Highway_link.private void
testHighwayLink(Way way)
private void
testMissingPedestrianCrossing(Node n)
private void
testSourceMaxspeed(OsmPrimitive p, boolean testContextHighway)
private void
testWrongRoundabout(Way w)
void
visit(Node n)
Visiting call for points.void
visit(Way w)
Visiting call for lines.-
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, clear, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, startTest, testBeforeUpload, visit, visit
-
-
-
-
Field Detail
-
WRONG_ROUNDABOUT_HIGHWAY
protected static final int WRONG_ROUNDABOUT_HIGHWAY
- See Also:
- Constant Field Values
-
MISSING_PEDESTRIAN_CROSSING
protected static final int MISSING_PEDESTRIAN_CROSSING
- See Also:
- Constant Field Values
-
SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE
protected static final int SOURCE_MAXSPEED_UNKNOWN_COUNTRY_CODE
- See Also:
- Constant Field Values
-
SOURCE_MAXSPEED_UNKNOWN_CONTEXT
protected static final int SOURCE_MAXSPEED_UNKNOWN_CONTEXT
- See Also:
- Constant Field Values
-
SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_MAXSPEED
protected static final int SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_MAXSPEED
- See Also:
- Constant Field Values
-
SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_HIGHWAY
protected static final int SOURCE_MAXSPEED_CONTEXT_MISMATCH_VS_HIGHWAY
- See Also:
- Constant Field Values
-
SOURCE_WRONG_LINK
protected static final int SOURCE_WRONG_LINK
- See Also:
- Constant Field Values
-
SOURCE_MAXSPEED
protected static final String SOURCE_MAXSPEED
- See Also:
- Constant Field Values
-
CLASSIFIED_HIGHWAYS
static final List<String> CLASSIFIED_HIGHWAYS
Classified highways in order of importance
-
KNOWN_SOURCE_MAXSPEED_CONTEXTS
private static final Set<String> KNOWN_SOURCE_MAXSPEED_CONTEXTS
-
ISO_COUNTRIES
private static final Set<String> ISO_COUNTRIES
-
leftByPedestrians
private boolean leftByPedestrians
-
leftByCyclists
private boolean leftByCyclists
-
leftByCars
private boolean leftByCars
-
pedestrianWays
private int pedestrianWays
-
cyclistWays
private int cyclistWays
-
carsWays
private int carsWays
-
-
Constructor Detail
-
Highways
public Highways()
Constructs a newHighways
test.
-
-
Method Detail
-
visit
public void visit(Node n)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for points.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
n
- The node to inspect.
-
visit
public void visit(Way w)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for lines.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Overrides:
visit
in classTest
- Parameters:
w
- The way to inspect.
-
testWrongRoundabout
private void testWrongRoundabout(Way w)
-
isHighwayLinkOkay
public static boolean isHighwayLinkOkay(Way way)
Determines if the given link road is correct, see https://wiki.openstreetmap.org/wiki/Highway_link.- Parameters:
way
- link road- Returns:
true
if the link road is correct or if the check cannot be performed due to missing data
-
testHighwayLink
private void testHighwayLink(Way way)
-
testMissingPedestrianCrossing
private void testMissingPedestrianCrossing(Node n)
-
handleCarWay
private void handleCarWay(Node n, Way w)
-
handleCyclistWay
private void handleCyclistWay(Node n, Way w)
-
handlePedestrianWay
private void handlePedestrianWay(Node n, Way w)
-
testSourceMaxspeed
private void testSourceMaxspeed(OsmPrimitive p, boolean testContextHighway)
-
-