org.openstreetmap.josm.data.validation.tests
Class MultipolygonTest

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.Test
          extended by org.openstreetmap.josm.data.validation.tests.MultipolygonTest
All Implemented Interfaces:
Visitor

public class MultipolygonTest
extends Test


Field Summary
protected static int CROSSING_WAYS
           
protected static int INNER_STYLE_MISMATCH
           
protected static int INNER_WAY_OUTSIDE
           
protected static int MISSING_OUTER_WAY
           
protected static int NO_STYLE
           
protected static int NO_STYLE_POLYGON
           
protected static int NON_CLOSED_WAY
           
private  java.util.List<java.util.List<Node>> nonClosedWays
           
protected static int NOT_CLOSED
           
protected static int OUTER_STYLE_MISMATCH
           
private  double SCALE
           
private static ElemStyles styles
           
protected static int WRONG_MEMBER_ROLE
           
protected static int WRONG_MEMBER_TYPE
           
 
Fields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, testBeforeUpload
 
Constructor Summary
MultipolygonTest()
           
 
Method Summary
private  void checkMembersAndRoles(Relation r)
           
private  java.awt.geom.GeneralPath createPath(java.util.List<Node> nodes)
           
private  java.util.List<java.awt.geom.GeneralPath> createPolygons(java.util.List<java.util.List<Node>> joinedWays)
           
private  Multipolygon.PolyData.Intersection getPolygonIntersection(java.awt.geom.GeneralPath outer, java.util.List<Node> inner)
           
 void initialize()
          Initializes any global data used this tester.
private  java.util.List<java.util.List<Node>> joinWays(java.util.Collection<Way> ways)
           
 void visit(Relation r)
          Visiting call for relations.
 void visit(Way w)
          Visiting call for lines.
 
Methods inherited from class org.openstreetmap.josm.data.validation.Test
addGui, deletePrimitivesIfNeeded, endTest, fixError, getErrors, getName, isBuilding, isCanceled, isFixable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit, visit
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRONG_MEMBER_TYPE

protected static final int WRONG_MEMBER_TYPE
See Also:
Constant Field Values

WRONG_MEMBER_ROLE

protected static final int WRONG_MEMBER_ROLE
See Also:
Constant Field Values

NON_CLOSED_WAY

protected static final int NON_CLOSED_WAY
See Also:
Constant Field Values

MISSING_OUTER_WAY

protected static final int MISSING_OUTER_WAY
See Also:
Constant Field Values

INNER_WAY_OUTSIDE

protected static final int INNER_WAY_OUTSIDE
See Also:
Constant Field Values

CROSSING_WAYS

protected static final int CROSSING_WAYS
See Also:
Constant Field Values

OUTER_STYLE_MISMATCH

protected static final int OUTER_STYLE_MISMATCH
See Also:
Constant Field Values

INNER_STYLE_MISMATCH

protected static final int INNER_STYLE_MISMATCH
See Also:
Constant Field Values

NOT_CLOSED

protected static final int NOT_CLOSED
See Also:
Constant Field Values

NO_STYLE

protected static final int NO_STYLE
See Also:
Constant Field Values

NO_STYLE_POLYGON

protected static final int NO_STYLE_POLYGON
See Also:
Constant Field Values

styles

private static ElemStyles styles

nonClosedWays

private final java.util.List<java.util.List<Node>> nonClosedWays

SCALE

private final double SCALE
See Also:
Constant Field Values
Constructor Detail

MultipolygonTest

public MultipolygonTest()
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Description copied from class: Test
Initializes any global data used this tester.

Overrides:
initialize in class Test
Throws:
java.lang.Exception - When cannot initialize the test

joinWays

private java.util.List<java.util.List<Node>> joinWays(java.util.Collection<Way> ways)

createPath

private java.awt.geom.GeneralPath createPath(java.util.List<Node> nodes)

createPolygons

private java.util.List<java.awt.geom.GeneralPath> createPolygons(java.util.List<java.util.List<Node>> joinedWays)

getPolygonIntersection

private Multipolygon.PolyData.Intersection getPolygonIntersection(java.awt.geom.GeneralPath outer,
                                                                  java.util.List<Node> inner)

visit

public void visit(Way w)
Description copied from interface: Visitor
Visiting call for lines.

Specified by:
visit in interface Visitor
Overrides:
visit in class Test
Parameters:
w - The way to inspect.

visit

public void visit(Relation r)
Description copied from interface: Visitor
Visiting call for relations.

Specified by:
visit in interface Visitor
Overrides:
visit in class Test
Parameters:
r - The relation to inspect.

checkMembersAndRoles

private void checkMembersAndRoles(Relation r)


JOSM