Package org.openstreetmap.josm.data
Class ProjectionBounds
java.lang.Object
org.openstreetmap.josm.data.ProjectionBounds
This is a simple data class for "rectangular" areas of the world, given in
east/north min/max values.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct uninitialized bounds.ProjectionBounds(double minEast, double minNorth, double maxEast, double maxNorth) Construct bounds out of two points.Construct bounds out of a single point.ProjectionBounds(EastNorth center, double east, double north) Construct bounds out of a center point and east/north dimensions.ProjectionBounds(EastNorth min, EastNorth max) Construct bounds out of two points. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck, if a point is within the bounds.voidExtends bounds to include pointe.voidExtends bounds to include boundsb.Returns the center east/north.private doubleprivate doublegetMax()Returns the max east/north.getMin()Returns the min east/north.doublegetScale(int width, int height) Computes the scale of this bounds with respect to the given width/height.booleanDetermines if the bounds area is not nullbooleanThe two bounds intersect? Compared to java Shape.intersects, if does not use the interior but the closure.toString()
-
Field Details
-
minEast
The minimum east coordinate. -
minNorth
The minimum north coordinate. -
maxEast
The maximum east coordinate. -
maxNorth
The minimum north coordinate.
-
-
Constructor Details
-
ProjectionBounds
Construct bounds out of two points.- Parameters:
min- min east/northmax- max east/north
-
ProjectionBounds
Construct bounds out of a single point.- Parameters:
p- east/north
-
ProjectionBounds
Construct bounds out of a center point and east/north dimensions.- Parameters:
center- center east/northeast- east dimensionnorth- north dimension
-
ProjectionBounds
Construct bounds out of two points.- Parameters:
minEast- min eastminNorth- min northmaxEast- max eastmaxNorth- max north
-
ProjectionBounds
public ProjectionBounds()Construct uninitialized bounds.At least one call to
extend(EastNorth)orextend(ProjectionBounds)is required immediately after construction to initialize theProjectionBoundsinstance and make it valid.Uninitialized
ProjectionBoundsmust not be passed to other methods or used in any way other than initializing it.
-
-
Method Details
-
extend
Extends bounds to include pointe.- Parameters:
e- east/north to include
-
extend
Extends bounds to include boundsb.- Parameters:
b- bounds to include- Since:
- 11774
-
getCenter
Returns the center east/north.- Returns:
- the center east/north
-
toString
-
intersects
The two bounds intersect? Compared to java Shape.intersects, if does not use the interior but the closure. (">=" instead of ">")- Parameters:
b- projection bounds- Returns:
trueif the two bounds intersect
-
contains
Check, if a point is within the bounds.- Parameters:
en- the point- Returns:
- true, if
enis within the bounds
-
getMin
Returns the min east/north.- Returns:
- the min east/north
-
getMax
Returns the max east/north.- Returns:
- the max east/north
-
hasExtend
Determines if the bounds area is not null- Returns:
trueif the area is not null
-
getScale
Computes the scale of this bounds with respect to the given width/height.- Parameters:
width- the widthheight- the height- Returns:
- the computed scale
-
getDeltaNorth
-
getDeltaEast
-