public final class Bounds extends Geometry implements AutoCloseable
GeometryFactory#createBounds
,
Bounds#Bounds
Constructor and Description |
---|
Bounds(Bounds other) |
Bounds(CoordinateReference reference,
Coordinate lowerLeft,
Coordinate upperRight)
Creates a new
Bounds instance based on lower left and upper right corners. |
Bounds(CoordinateReference reference,
Coordinate location,
double width,
double height,
double depth)
Creates a new
Bounds instance based on a point, and the width, height and depth with respect to that point. |
Modifier and Type | Method and Description |
---|---|
static Bounds |
boundsUnion(Bounds bounds1,
Bounds bounds2)
Returns the union of the two bounds objects, provided they are defined in the same coordinate reference.
|
void |
close() |
static boolean |
contains2D(Bounds bounds1,
Bounds bounds2) |
static boolean |
contains2D(Bounds bounds1,
Bounds bounds2,
double eps) |
static boolean |
contains2D(Bounds bounds,
Coordinate coordinate) |
static boolean |
contains2D(Bounds bounds,
Coordinate coordinate,
double eps) |
static boolean |
contains3D(Bounds bounds,
Coordinate coordinate) |
static boolean |
contains3D(Bounds bounds,
Coordinate coordinate,
double eps) |
boolean |
equals(Object other) |
protected void |
finalize() |
Coordinate |
getCenter() |
double |
getDepth() |
double |
getHeight() |
Coordinate |
getLocation() |
Coordinate |
getLowerLeftCorner() |
Coordinate |
getLowerRightCorner() |
Coordinate |
getUpperLeftCorner() |
Coordinate |
getUpperRightCorner() |
double |
getWidth() |
int |
hashCode() |
static boolean |
interacts2D(Bounds bounds1,
Bounds bounds2) |
static boolean |
interacts2D(Bounds bounds1,
Bounds bounds2,
double eps) |
static Bounds |
intersection2D(Bounds bounds1,
Bounds bounds2)
Returns the intersection of the two given bounds geometries.
|
getBounds, getReference
public Bounds(@NotNull Bounds other)
public Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate location, double width, double height, double depth)
Bounds
instance based on a point, and the width, height and depth with respect to that point.reference
- the coordinate referencelocation
- the lower left location of the boundswidth
- the widthheight
- the heightdepth
- the depthpublic Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate lowerLeft, @NotNull Coordinate upperRight)
Bounds
instance based on lower left and upper right corners.
This method will take wrap-around the 180° meridian into account when the coordinate reference is geodetic.
reference
- the coordinate referencelowerLeft
- the lower left corner of the boundsupperRight
- the upper right corner of the boundspublic void close()
close
in interface AutoCloseable
close
in class Geometry
@NotNull public Coordinate getLocation()
Bounds
instance.public double getWidth()
public double getHeight()
public double getDepth()
@NotNull public Coordinate getCenter()
Bounds
instance. When this bounds uses a geodetic reference, this method normalizes the result.@NotNull public Coordinate getLowerLeftCorner()
Bounds
instance. When this bounds uses a geodetic reference, this method normalizes the result.@NotNull public Coordinate getLowerRightCorner()
Bounds
instance. When this bounds uses a geodetic reference, this method normalizes the result.@NotNull public Coordinate getUpperLeftCorner()
Bounds
instance. When this bounds uses a geodetic reference, this method normalizes the result.@NotNull public Coordinate getUpperRightCorner()
Bounds
instance. When this bounds uses a geodetic reference, this method normalizes the result.@NotNull public static Bounds boundsUnion(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
bounds1
- the first bounds.bounds2
- the second bounds.IllegalArgumentException
- if the bounds are not defined in the same coordinate reference.@Nullable public static Bounds intersection2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2)
bounds1
- a bounds instancebounds2
- an other bounds instancepublic static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException
bounds1
- the first bounds.bounds2
- the second bounds.eps
- a tolerance for the interaction check.IllegalArgumentException
- if the bounds are not defined in the same coordinate reference.public static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
bounds1
- the first bounds.bounds2
- the second bounds.IllegalArgumentException
- if the bounds are not defined in the same coordinate reference.public static boolean contains2D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps)
public static boolean contains2D(@NotNull Bounds bounds, @NotNull Coordinate coordinate)
public static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException
bounds1
- a bounds instance.bounds2
- an other bounds instance.eps
- a tolerance for the contains check.IllegalArgumentException
- if the bounds are not defined in the same coordinate reference.public static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
bounds1
- a bounds instance.bounds2
- an other bounds instance.IllegalArgumentException
- if the bounds are not defined in the same coordinate reference.public static boolean contains3D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps)
bounds
- a bounds instance.coordinate
- a coordinate.eps
- a tolerance for the contains check.public static boolean contains3D(@NotNull Bounds bounds, @NotNull Coordinate coordinate)
bounds
- a bounds instance.coordinate
- a coordinate.