public class BoundingXYVisitor extends java.lang.Object implements OsmPrimitiveVisitor, PrimitiveVisitor
OsmPrimitive objects, using the
EastNorth values as reference.| Modifier and Type | Field and Description |
|---|---|
private ProjectionBounds |
bounds |
private static double |
ENLARGE_DEFAULT
default value for setting "edit.zoom-enlarge-bbox"
|
| Constructor and Description |
|---|
BoundingXYVisitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
computeBoundingBox(java.util.Collection<? extends IPrimitive> primitives)
Compute the bounding box of a collection of primitives.
|
void |
enlargeBoundingBox()
Enlarges the calculated bounding box by 0.0002 degrees or user value
given in edit.zoom-enlarge-bbox.
|
void |
enlargeBoundingBox(double enlargeDegreeX,
double enlargeDegreeY)
Enlarges the calculated bounding box by the specified number of degrees.
|
void |
enlargeBoundingBoxLogarithmically()
Enlarges the bounding box up to 0.0002 degrees, depending on its size and user
settings in edit.zoom-enlarge-bbox.
|
ProjectionBounds |
getBounds() |
boolean |
hasExtend()
Determines if the visitor has a non null bounds area.
|
java.lang.String |
toString() |
void |
visit(Bounds b)
Visiting call for bounds.
|
void |
visit(EastNorth eastNorth)
Visiting call for east/north.
|
void |
visit(ILatLon latlon)
Visiting call for lat/lon.
|
void |
visit(INode n)
Visiting call for nodes.
|
void |
visit(IRelation<?> r)
Visiting call for relations.
|
void |
visit(IWay<?> w)
Visiting call for ways.
|
void |
visit(LatLon latlon)
Visiting call for lat/lon.
|
void |
visit(Node n)
Visiting call for points.
|
void |
visit(ProjectionBounds b)
Visiting call for projection bounds.
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
private static final double ENLARGE_DEFAULT
private ProjectionBounds bounds
public BoundingXYVisitor()
public void visit(Node n)
OsmPrimitiveVisitorvisit in interface OsmPrimitiveVisitorn - The node to inspect.public void visit(Way w)
OsmPrimitiveVisitorvisit in interface OsmPrimitiveVisitorw - The way to inspect.public void visit(Relation r)
OsmPrimitiveVisitorvisit in interface OsmPrimitiveVisitorr - The relation to inspect.public void visit(INode n)
PrimitiveVisitorvisit in interface PrimitiveVisitorn - The node to inspect.public void visit(IWay<?> w)
PrimitiveVisitorvisit in interface PrimitiveVisitorw - The way to inspect.public void visit(IRelation<?> r)
PrimitiveVisitorvisit in interface PrimitiveVisitorr - The relation to inspect.public void visit(ProjectionBounds b)
b - projection boundspublic void visit(ILatLon latlon)
latlon - lat/lonpublic void visit(EastNorth eastNorth)
eastNorth - east/northpublic boolean hasExtend()
true if the visitor has a non null bounds areaProjectionBounds.hasExtend()public ProjectionBounds getBounds()
null if no coordinates have passedpublic void enlargeBoundingBox()
min or max
equal null) this method does not do anything.public void enlargeBoundingBox(double enlargeDegreeX, double enlargeDegreeY)
min or max
equal null) this method does not do anything.enlargeDegreeX - number of degrees to enlarge on each side along XenlargeDegreeY - number of degrees to enlarge on each side along Ypublic void enlargeBoundingBoxLogarithmically()
min or max
equal null) this method does not do anything.public java.lang.String toString()
toString in class java.lang.Objectpublic void computeBoundingBox(java.util.Collection<? extends IPrimitive> primitives)
primitives - the collection of primitives