public class ProjectionBounds extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
maxEast
The maximum east coordinate.
|
double |
maxNorth
The minimum north coordinate.
|
double |
minEast
The minimum east coordinate.
|
double |
minNorth
The minimum north coordinate.
|
Constructor and Description |
---|
ProjectionBounds()
Construct uninitialized bounds.
|
ProjectionBounds(double minEast,
double minNorth,
double maxEast,
double maxNorth)
Construct bounds out of two points.
|
ProjectionBounds(EastNorth p)
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(EastNorth en)
Check, if a point is within the bounds.
|
void |
extend(EastNorth e)
Extends bounds to include point
e . |
void |
extend(ProjectionBounds b)
Extends bounds to include bounds
b . |
EastNorth |
getCenter()
Returns the center east/north.
|
private double |
getDeltaEast() |
private double |
getDeltaNorth() |
EastNorth |
getMax()
Returns the max east/north.
|
EastNorth |
getMin()
Returns the min east/north.
|
double |
getScale(int width,
int height)
Computes the scale of this bounds with respect to the given width/height.
|
boolean |
hasExtend()
Determines if the bounds area is not null
|
boolean |
intersects(ProjectionBounds b)
The two bounds intersect? Compared to java Shape.intersects, if does not use
the interior but the closure.
|
java.lang.String |
toString() |
public double minEast
public double minNorth
public double maxEast
public double maxNorth
public ProjectionBounds(EastNorth min, EastNorth max)
min
- min east/northmax
- max east/northpublic ProjectionBounds(EastNorth p)
p
- east/northpublic ProjectionBounds(EastNorth center, double east, double north)
center
- center east/northeast
- east dimensionnorth
- north dimensionpublic ProjectionBounds(double minEast, double minNorth, double maxEast, double maxNorth)
minEast
- min eastminNorth
- min northmaxEast
- max eastmaxNorth
- max northpublic ProjectionBounds()
At least one call to extend(EastNorth)
or extend(ProjectionBounds)
is required immediately after construction to initialize the ProjectionBounds
instance and make it valid.
Uninitialized ProjectionBounds
must not be passed to other methods
or used in any way other than initializing it.
public void extend(EastNorth e)
e
.e
- east/north to includepublic void extend(ProjectionBounds b)
b
.b
- bounds to includepublic EastNorth getCenter()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean intersects(ProjectionBounds b)
b
- projection boundstrue
if the two bounds intersectpublic boolean contains(EastNorth en)
en
- the pointen
is within the boundspublic boolean hasExtend()
true
if the area is not nullpublic double getScale(int width, int height)
width
- the widthheight
- the heightprivate double getDeltaNorth()
private double getDeltaEast()