public class MultipolygonTest extends Test
Test.TagTest
Modifier and Type | Field and Description |
---|---|
static int |
CROSSING_WAYS
Intersection between multipolygon ways
|
static int |
INNER_STYLE_MISMATCH
With the currently used mappaint style the style for inner way equals the multipolygon style
|
static int |
INNER_WAY_OUTSIDE
Multipolygon inner way is outside
|
private java.util.Set<java.lang.String> |
keysCheckedByAnotherTest |
static int |
MISSING_OUTER_WAY
No outer way for multipolygon
|
static int |
NO_STYLE
No area style for multipolygon
|
static int |
NO_STYLE_POLYGON
Multipolygon relation should be tagged with area tags and not the outer way(s)
|
static int |
NON_CLOSED_WAY
Multipolygon is not closed
|
static int |
NOT_CLOSED
Area style way is not closed
|
static int |
OUTER_STYLE
Area style on outer way
|
static int |
OUTER_STYLE_MISMATCH
Style for outer way mismatches / With the currently used mappaint style(s) the style for outer way mismatches the area style
|
private static ElemStyles |
styles |
static int |
WRONG_MEMBER_ROLE
No useful role for multipolygon member
|
static int |
WRONG_MEMBER_TYPE
Non-Way in multipolygon
|
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
MultipolygonTest()
Constructs a new
MultipolygonTest . |
Modifier and Type | Method and Description |
---|---|
private void |
addError(Relation r,
TestError error) |
private static void |
addRelationIfNeeded(TestError error,
Relation r) |
private Multipolygon.PolyData.Intersection |
checkCrossingWays(Relation r,
java.util.List<Multipolygon.PolyData> polygons,
java.util.List<java.awt.geom.GeneralPath> polygonsPaths,
Multipolygon.PolyData pd,
int idx) |
private void |
checkGeometry(Relation r,
Multipolygon polygon)
Various geometry-related checks:
NON_CLOSED_WAY : Multipolygon is not closed
INNER_WAY_OUTSIDE : Multipolygon inner way is outside
CROSSING_WAYS : Intersection between multipolygon ways
|
private void |
checkMemberRoleCorrectness(Relation r)
Create new multipolygon using the logics from CreateMultipolygonAction and see if roles match:
WRONG_MEMBER_ROLE : Role for ''{0}'' should be ''{1}''
|
private void |
checkMembersAndRoles(Relation r)
Check for:
WRONG_MEMBER_ROLE : No useful role for multipolygon member
WRONG_MEMBER_TYPE : Non-Way in multipolygon
|
private void |
checkOuterWay(Relation r)
Checks that multipolygon has at least an outer way:
MISSING_OUTER_WAY : No outer way for multipolygon
|
private void |
checkStyleConsistency(Relation r,
Multipolygon polygon)
Various style-related checks:
NO_STYLE_POLYGON : Multipolygon relation should be tagged with area tags and not the outer way
INNER_STYLE_MISMATCH : With the currently used mappaint style the style for inner way equals the multipolygon style
OUTER_STYLE_MISMATCH : Style for outer way mismatches
OUTER_STYLE : Area style on outer way
|
private static java.awt.geom.GeneralPath |
createPath(java.util.List<Node> nodes) |
private java.util.List<java.awt.geom.GeneralPath> |
createPolygons(java.util.List<Multipolygon.PolyData> joinedWays) |
void |
endTest()
Notification of the end of the test.
|
private static Multipolygon.PolyData.Intersection |
getPolygonIntersection(java.awt.geom.GeneralPath outer,
java.util.List<Node> inner) |
void |
initialize()
Initializes any global data used this tester.
|
void |
startTest(ProgressMonitor progressMonitor)
Start the test using a given progress monitor
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
addGui, deletePrimitivesIfNeeded, equals, fixError, getErrors, getName, hashCode, isBuilding, isCanceled, isFixable, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, testBeforeUpload, visit, visit
visit
public static final int WRONG_MEMBER_TYPE
public static final int WRONG_MEMBER_ROLE
public static final int NON_CLOSED_WAY
public static final int MISSING_OUTER_WAY
public static final int INNER_WAY_OUTSIDE
public static final int CROSSING_WAYS
public static final int OUTER_STYLE_MISMATCH
public static final int INNER_STYLE_MISMATCH
public static final int NOT_CLOSED
public static final int NO_STYLE
public static final int NO_STYLE_POLYGON
public static final int OUTER_STYLE
private static volatile ElemStyles styles
private final java.util.Set<java.lang.String> keysCheckedByAnotherTest
public MultipolygonTest()
MultipolygonTest
.public void initialize()
Test
initialize
in class Test
public void startTest(ProgressMonitor progressMonitor)
Test
public void endTest()
Test
If you override this method, don't forget to cleanup progressMonitor
(most overrides call super.endTest()
to do this).
private static java.awt.geom.GeneralPath createPath(java.util.List<Node> nodes)
private java.util.List<java.awt.geom.GeneralPath> createPolygons(java.util.List<Multipolygon.PolyData> joinedWays)
private static Multipolygon.PolyData.Intersection getPolygonIntersection(java.awt.geom.GeneralPath outer, java.util.List<Node> inner)
public void visit(Relation r)
Visitor
private void checkOuterWay(Relation r)
MISSING_OUTER_WAY
: No outer way for multipolygonr
- relationprivate void checkMemberRoleCorrectness(Relation r)
WRONG_MEMBER_ROLE
: Role for ''{0}'' should be ''{1}''r
- relationprivate void checkStyleConsistency(Relation r, Multipolygon polygon)
NO_STYLE_POLYGON
: Multipolygon relation should be tagged with area tags and not the outer wayINNER_STYLE_MISMATCH
: With the currently used mappaint style the style for inner way equals the multipolygon styleOUTER_STYLE_MISMATCH
: Style for outer way mismatchesOUTER_STYLE
: Area style on outer wayr
- relationpolygon
- multipolygonprivate void checkGeometry(Relation r, Multipolygon polygon)
NON_CLOSED_WAY
: Multipolygon is not closedINNER_WAY_OUTSIDE
: Multipolygon inner way is outsideCROSSING_WAYS
: Intersection between multipolygon waysr
- relationpolygon
- multipolygonprivate Multipolygon.PolyData.Intersection checkCrossingWays(Relation r, java.util.List<Multipolygon.PolyData> polygons, java.util.List<java.awt.geom.GeneralPath> polygonsPaths, Multipolygon.PolyData pd, int idx)
private void checkMembersAndRoles(Relation r)
WRONG_MEMBER_ROLE
: No useful role for multipolygon memberWRONG_MEMBER_TYPE
: Non-Way in multipolygonr
- relationprivate static void addRelationIfNeeded(TestError error, Relation r)