public class SharpAngles extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
private java.util.Collection<java.lang.String> |
ignoreHighways
Specific highway types to ignore
|
private double |
maxAngle
The maximum angle for sharp angles
|
private double |
maxLength
The length that at least one way segment must be shorter than
|
private static int |
SHARP_ANGLES
The code for a sharp angle
|
private static int |
SHARPANGLESCODE |
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, stopwatch, testBeforeUpload
Constructor and Description |
---|
SharpAngles()
Construct a new
IntersectionIssues object |
Modifier and Type | Method and Description |
---|---|
void |
addIgnoredHighway(java.lang.String highway)
Add a highway to ignore
|
private void |
checkAngle(Node node1,
Node node2,
Node node3,
int i,
Way way,
boolean last) |
void |
checkWayForSharpAngles(Way way)
Check nodes in a way for sharp angles
|
private void |
createNearlyOverlappingError(double angle,
Way way,
OsmPrimitive primitive) |
private Severity |
getSeverity(double angle) |
private void |
processSharpAngleForErrorCreation(double angle,
int i,
Way way,
boolean last,
Node pointNode) |
void |
setMaxAngle(double angle)
Set the maximum angle
|
void |
setMaxLength(double length)
Set the maximum length for the shortest segment
|
boolean |
shouldBeTestedForSharpAngles(Way way)
Check whether or not a way should be checked for sharp angles
|
void |
visit(Way way)
Visiting call for lines.
|
addGui, clear, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, initialize, isBuilding, isCanceled, isFixable, isPrimitiveUsable, isResidentialArea, ok, setBeforeUpload, setPartialSelection, setShowElements, startTest, testBeforeUpload, visit, visit, visit
private static final int SHARPANGLESCODE
private static final int SHARP_ANGLES
private double maxAngle
private double maxLength
private java.util.Collection<java.lang.String> ignoreHighways
public SharpAngles()
IntersectionIssues
objectpublic void visit(Way way)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
visit
in class Test
way
- The way to inspect.public boolean shouldBeTestedForSharpAngles(Way way)
way
- The way that needs to be checkedtrue
if the way should be checked.public void checkWayForSharpAngles(Way way)
way
- A way to check for sharp anglesprivate void checkAngle(Node node1, Node node2, Node node3, int i, Way way, boolean last)
private void processSharpAngleForErrorCreation(double angle, int i, Way way, boolean last, Node pointNode)
private void createNearlyOverlappingError(double angle, Way way, OsmPrimitive primitive)
private Severity getSeverity(double angle)
public void setMaxLength(double length)
length
- The max length in meterspublic void addIgnoredHighway(java.lang.String highway)
highway
- The highway type to ignore (e.g., if you want to ignore residential roads, use "residential")public void setMaxAngle(double angle)
angle
- The maximum angle in degrees.