org.openstreetmap.josm.data.osm.visitor
Class BoundingXYVisitor

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
ValidatorDialog.ValidatorBoundingXYVisitor

public class BoundingXYVisitor
extends AbstractVisitor

Calculates the total bounding rectangle of a series of OsmPrimitive objects, using the EastNorth values as reference.


Field Summary
private  ProjectionBounds bounds
           
 
Constructor Summary
BoundingXYVisitor()
           
 
Method Summary
 void computeBoundingBox(java.util.Collection<? extends OsmPrimitive> primitives)
           
 void enlargeBoundingBox()
          Enlarges the calculated bounding box by 0.002 degrees.
 void enlargeBoundingBox(double enlargeDegree)
          Enlarges the calculated bounding box by the specified number of degrees.
 ProjectionBounds getBounds()
           
 boolean hasExtend()
           
 java.lang.String toString()
           
 void visit(Bounds b)
           
 void visit(EastNorth eastNorth)
           
 void visit(LatLon latlon)
           
 void visit(Node n)
          Visiting call for points.
 void visit(ProjectionBounds b)
           
 void visit(Relation e)
          Visiting call for relations.
 void visit(Way w)
          Visiting call for lines.
 
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, wait, wait, wait
 

Field Detail

bounds

private ProjectionBounds bounds
Constructor Detail

BoundingXYVisitor

public BoundingXYVisitor()
Method Detail

visit

public void visit(Node n)
Description copied from interface: Visitor
Visiting call for points.

Parameters:
n - The node to inspect.

visit

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

Parameters:
w - The way to inspect.

visit

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

Parameters:
e - The relation to inspect.

visit

public void visit(Bounds b)

visit

public void visit(ProjectionBounds b)

visit

public void visit(LatLon latlon)

visit

public void visit(EastNorth eastNorth)

hasExtend

public boolean hasExtend()

getBounds

public ProjectionBounds getBounds()
Returns:
The bounding box or null if no coordinates have passed

enlargeBoundingBox

public void enlargeBoundingBox()
Enlarges the calculated bounding box by 0.002 degrees. If the bounding box has not been set (min or max equal null) this method does not do anything.


enlargeBoundingBox

public void enlargeBoundingBox(double enlargeDegree)
Enlarges the calculated bounding box by the specified number of degrees. If the bounding box has not been set (min or max equal null) this method does not do anything.

Parameters:
enlargeDegree -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

computeBoundingBox

public void computeBoundingBox(java.util.Collection<? extends OsmPrimitive> primitives)


JOSM