public class BoundingBoxDoubleGf extends Object implements Serializable, BoundingBox
Geometry,
e.g. the minimum and maximum x and y values of the Coordinatess.
Note that Envelopes support infinite or half-infinite regions, by using the values of
Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY.
When BoundingBoxDoubleGf objects are created or initialized, the supplies extent values are automatically sorted into the correct order.
| Modifier and Type | Field and Description |
|---|---|
static int |
OUT_BOTTOM
The bitmask that indicates that a point lies below
this
Rectangle2D. |
static int |
OUT_LEFT
The bitmask that indicates that a point lies to the left of
this
Rectangle2D. |
static int |
OUT_RIGHT
The bitmask that indicates that a point lies to the right of
this
Rectangle2D. |
static int |
OUT_TOP
The bitmask that indicates that a point lies above
this
Rectangle2D. |
| Constructor and Description |
|---|
BoundingBoxDoubleGf() |
BoundingBoxDoubleGf(GeometryFactory geometryFactory)
Construct a new Bounding Box.
|
BoundingBoxDoubleGf(GeometryFactory geometryFactory,
int axisCount,
double... bounds) |
BoundingBoxDoubleGf(GeometryFactory geometryFactory,
Iterable<? extends Point> points) |
BoundingBoxDoubleGf(GeometryFactory geometryFactory,
LineString points) |
BoundingBoxDoubleGf(GeometryFactory geometryFactory,
Point... points) |
BoundingBoxDoubleGf(int axisCount,
double... bounds) |
BoundingBoxDoubleGf(Iterable<? extends Point> points) |
BoundingBoxDoubleGf(LineString points) |
BoundingBoxDoubleGf(Point... points) |
| Modifier and Type | Method and Description |
|---|---|
BoundingBox |
clipToCoordinateSystem() |
BoundingBox |
clone()
Bounding boxes are immutable so clone returns this.
|
BoundingBox |
convert(GeometryFactory geometryFactory) |
BoundingBox |
convert(GeometryFactory geometryFactory,
int axisCount) |
boolean |
coveredBy(double... bounds) |
boolean |
covers(BoundingBox other)
Tests if the
BoundingBoxDoubleGf other
lies wholely inside this BoundingBoxDoubleGf (inclusive of the boundary). |
boolean |
covers(double x,
double y)
Tests if the given point lies in or on the envelope.
|
boolean |
covers(Geometry geometry) |
boolean |
covers(Point point)
Tests if the given point lies in or on the envelope.
|
static BoundingBox |
create(String wkt) |
double |
distance(BoundingBox boundingBox)
Computes the distance between this and another
BoundingBoxDoubleGf. |
double |
distance(Geometry geometry) |
boolean |
equals(Object other) |
BoundingBox |
expand(double delta)
Return a new bounding box expanded by delta.
|
BoundingBox |
expand(double deltaX,
double deltaY)
Return a new bounding box expanded by deltaX, deltaY.
|
BoundingBox |
expand(Point coordinates) |
BoundingBox |
expandPercent(double factor) |
BoundingBox |
expandPercent(double factorX,
double factorY) |
BoundingBox |
expandToInclude(BoundingBox other) |
BoundingBox |
expandToInclude(double... coordinates) |
BoundingBox |
expandToInclude(Geometry geometry) |
BoundingBox |
expandToInclude(Point point) |
BoundingBox |
expandToInclude(Record object) |
double |
getArea()
Gets the area of this envelope.
|
double |
getAspectRatio()
Get the aspect ratio x:y.
|
int |
getAxisCount() |
Point |
getBottomLeftPoint() |
Point |
getBottomRightPoint() |
double[] |
getBounds() |
double[] |
getBounds(int axisCount) |
Point |
getCentre() |
double |
getCentreX() |
double |
getCentreY() |
CoordinateSystem |
getCoordinateSystem()
Get the geometry factory.
|
Point |
getCornerPoint(int index)
maxX,minY
minX,minY
minX,maxY
maxX,maxY
|
LineString |
getCornerPoints() |
GeometryFactory |
getGeometryFactory() |
double |
getHeight()
Returns the difference between the maximum and minimum y values.
|
javax.measure.Measure<javax.measure.quantity.Length> |
getHeightLength() |
double |
getMax(int axisIndex) |
<Q extends javax.measure.quantity.Quantity> |
getMaximum(int axisIndex) |
<Q extends javax.measure.quantity.Quantity> |
getMaximum(int axisIndex,
javax.measure.unit.Unit convertUnit) |
double |
getMaxX()
Returns the
BoundingBoxDoubleGfs maximum x-value. |
double |
getMaxY()
Returns the
BoundingBoxDoubleGfs maximum y-value. |
double |
getMin(int axisIndex) |
<Q extends javax.measure.quantity.Quantity> |
getMinimum(int axisIndex) |
<Q extends javax.measure.quantity.Quantity> |
getMinimum(int axisIndex,
javax.measure.unit.Unit convertUnit) |
double |
getMinX()
Returns the
BoundingBoxDoubleGfs minimum x-value. |
double |
getMinY()
Returns the
BoundingBoxDoubleGfs minimum y-value. |
Point |
getRandomPointWithin() |
int |
getSrid() |
Point |
getTopLeftPoint() |
Point |
getTopRightPoint() |
double |
getWidth()
Returns the difference between the maximum and minimum x values.
|
javax.measure.Measure<javax.measure.quantity.Length> |
getWidthLength() |
int |
hashCode() |
BoundingBox |
intersection(BoundingBox boundingBox)
Computes the intersection of two
BoundingBoxDoubleGfs. |
boolean |
intersects(BoundingBox other)
Check if the region defined by
other
overlaps (intersects) the region of this BoundingBoxDoubleGf. |
boolean |
intersects(double x,
double y)
Check if the point
(x, y)
overlaps (lies inside) the region of this BoundingBoxDoubleGf. |
boolean |
intersects(double x0,
double y0,
double x1,
double y1)
Check if the line
(x1, y1) -> (x2, y2)
intersects (covered by or crosses) the region of this BoundingBox. |
boolean |
intersects(Geometry geometry) |
boolean |
intersects(Point point)
Check if the point
p
overlaps (lies inside) the region of this BoundingBoxDoubleGf. |
boolean |
isEmpty() |
BoundingBox |
move(double xDisplacement,
double yDisplacement)
Create a new BoundingBox by moving the min/max x coordinates by xDisplacement and
the min/max y coordinates by yDisplacement.
|
Geometry |
toGeometry()
Creates a
Geometry with the same extent as the given envelope. |
Polygon |
toPolygon() |
Polygon |
toPolygon(GeometryFactory factory) |
Polygon |
toPolygon(GeometryFactory factory,
int numSegments) |
Polygon |
toPolygon(GeometryFactory geometryFactory,
int numX,
int numY) |
Polygon |
toPolygon(int numSegments) |
Polygon |
toPolygon(int numX,
int numY) |
String |
toString() |
public static final int OUT_LEFT
Rectangle2D.public static final int OUT_TOP
Rectangle2D.public static final int OUT_RIGHT
Rectangle2D.public static final int OUT_BOTTOM
Rectangle2D.public BoundingBoxDoubleGf()
public BoundingBoxDoubleGf(GeometryFactory geometryFactory)
geometryFactory - The geometry factory.public BoundingBoxDoubleGf(GeometryFactory geometryFactory, int axisCount, double... bounds)
public BoundingBoxDoubleGf(GeometryFactory geometryFactory, Iterable<? extends Point> points)
public BoundingBoxDoubleGf(GeometryFactory geometryFactory, LineString points)
public BoundingBoxDoubleGf(GeometryFactory geometryFactory, Point... points)
public BoundingBoxDoubleGf(int axisCount,
double... bounds)
public BoundingBoxDoubleGf(LineString points)
public BoundingBoxDoubleGf(Point... points)
public static BoundingBox create(String wkt)
public BoundingBox clipToCoordinateSystem()
clipToCoordinateSystem in interface BoundingBoxpublic BoundingBox clone()
Bounding boxes are immutable so clone returns this.
public BoundingBox convert(GeometryFactory geometryFactory)
convert in interface BoundingBoxpublic BoundingBox convert(GeometryFactory geometryFactory, int axisCount)
convert in interface BoundingBoxpublic boolean coveredBy(double... bounds)
coveredBy in interface BoundingBoxpublic boolean covers(BoundingBox other)
BoundingBoxDoubleGf other
lies wholely inside this BoundingBoxDoubleGf (inclusive of the boundary).covers in interface BoundingBoxother - the BoundingBoxDoubleGf to checkBoundingBoxDoubleGf covers the otherpublic boolean covers(double x,
double y)
covers in interface BoundingBoxx - the x-coordinate of the point which this BoundingBoxDoubleGf is
being checked for containingy - the y-coordinate of the point which this BoundingBoxDoubleGf is
being checked for containingtrue if (x, y) lies in the interior or
on the boundary of this BoundingBoxDoubleGf.public boolean covers(Geometry geometry)
covers in interface BoundingBoxpublic boolean covers(Point point)
covers in interface BoundingBoxp - the point which this BoundingBoxDoubleGf is
being checked for containingtrue if the point lies in the interior or
on the boundary of this BoundingBoxDoubleGf.public double distance(BoundingBox boundingBox)
BoundingBoxDoubleGf.
The distance between overlapping Envelopes is 0. Otherwise, the
distance is the Euclidean distance between the closest points.distance in interface BoundingBoxpublic double distance(Geometry geometry)
distance in interface BoundingBoxpublic BoundingBox expand(double delta)
expand in interface BoundingBoxdelta - public BoundingBox expand(double deltaX, double deltaY)
expand in interface BoundingBoxdelta - public BoundingBox expand(Point coordinates)
expand in interface BoundingBoxpublic BoundingBox expandPercent(double factor)
expandPercent in interface BoundingBoxpublic BoundingBox expandPercent(double factorX, double factorY)
expandPercent in interface BoundingBoxpublic BoundingBox expandToInclude(BoundingBox other)
expandToInclude in interface BoundingBoxpublic BoundingBox expandToInclude(double... coordinates)
expandToInclude in interface BoundingBoxpublic BoundingBox expandToInclude(Geometry geometry)
expandToInclude in interface BoundingBoxpublic BoundingBox expandToInclude(Point point)
public BoundingBox expandToInclude(Record object)
expandToInclude in interface BoundingBoxpublic double getArea()
getArea in interface BoundingBoxpublic double getAspectRatio()
getAspectRatio in interface BoundingBoxpublic int getAxisCount()
getAxisCount in interface BoundingBoxpublic Point getBottomLeftPoint()
public Point getBottomRightPoint()
public double[] getBounds()
getBounds in interface BoundingBoxpublic double[] getBounds(int axisCount)
getBounds in interface BoundingBoxpublic Point getCentre()
getCentre in interface BoundingBoxpublic double getCentreX()
getCentreX in interface BoundingBoxpublic double getCentreY()
getCentreY in interface BoundingBoxpublic CoordinateSystem getCoordinateSystem()
getCoordinateSystem in interface BoundingBoxpublic Point getCornerPoint(int index)
getCornerPoint in interface BoundingBoxpublic LineString getCornerPoints()
getCornerPoints in interface BoundingBoxpublic GeometryFactory getGeometryFactory()
getGeometryFactory in interface BoundingBoxpublic double getHeight()
getHeight in interface BoundingBoxBoundingBoxDoubleGfpublic javax.measure.Measure<javax.measure.quantity.Length> getHeightLength()
getHeightLength in interface BoundingBoxpublic double getMax(int axisIndex)
getMax in interface BoundingBoxpublic <Q extends javax.measure.quantity.Quantity> javax.measure.Measurable<Q> getMaximum(int axisIndex)
getMaximum in interface BoundingBoxpublic <Q extends javax.measure.quantity.Quantity> double getMaximum(int axisIndex,
javax.measure.unit.Unit convertUnit)
getMaximum in interface BoundingBoxpublic double getMaxX()
BoundingBoxDoubleGfs maximum x-value. min x > max x
indicates that this is a null BoundingBoxDoubleGf.getMaxX in interface BoundingBoxpublic double getMaxY()
BoundingBoxDoubleGfs maximum y-value. min y > max y
indicates that this is a null BoundingBoxDoubleGf.getMaxY in interface BoundingBoxpublic double getMin(int axisIndex)
getMin in interface BoundingBoxpublic <Q extends javax.measure.quantity.Quantity> javax.measure.Measurable<Q> getMinimum(int axisIndex)
getMinimum in interface BoundingBoxpublic <Q extends javax.measure.quantity.Quantity> double getMinimum(int axisIndex,
javax.measure.unit.Unit convertUnit)
getMinimum in interface BoundingBoxpublic double getMinX()
BoundingBoxDoubleGfs minimum x-value. min x > max x
indicates that this is a null BoundingBoxDoubleGf.getMinX in interface BoundingBoxpublic double getMinY()
BoundingBoxDoubleGfs minimum y-value. min y > max y
indicates that this is a null BoundingBoxDoubleGf.getMinY in interface BoundingBoxpublic Point getRandomPointWithin()
getRandomPointWithin in interface BoundingBoxpublic int getSrid()
getSrid in interface BoundingBoxpublic Point getTopLeftPoint()
getTopLeftPoint in interface BoundingBoxpublic Point getTopRightPoint()
public double getWidth()
getWidth in interface BoundingBoxBoundingBoxDoubleGfpublic javax.measure.Measure<javax.measure.quantity.Length> getWidthLength()
getWidthLength in interface BoundingBoxpublic BoundingBox intersection(BoundingBox boundingBox)
BoundingBoxDoubleGfs.intersection in interface BoundingBoxenv - the envelope to intersect withpublic boolean intersects(BoundingBox other)
other
overlaps (intersects) the region of this BoundingBoxDoubleGf.intersects in interface BoundingBoxother - the BoundingBoxDoubleGf which this BoundingBoxDoubleGf is
being checked for overlappingtrue if the BoundingBoxDoubleGfs overlappublic boolean intersects(double x,
double y)
(x, y)
overlaps (lies inside) the region of this BoundingBoxDoubleGf.intersects in interface BoundingBoxx - the x-ordinate of the pointy - the y-ordinate of the pointtrue if the point overlaps this BoundingBoxDoubleGfpublic boolean intersects(double x0,
double y0,
double x1,
double y1)
BoundingBox(x1, y1) -> (x2, y2)
intersects (covered by or crosses) the region of this BoundingBox.intersects in interface BoundingBoxtrue if the line overlaps this BoundingBoxpublic boolean intersects(Geometry geometry)
public boolean intersects(Point point)
p
overlaps (lies inside) the region of this BoundingBoxDoubleGf.intersects in interface BoundingBoxp - the Coordinate to be testedtrue if the point overlaps this BoundingBoxDoubleGfpublic boolean isEmpty()
isEmpty in interface BoundingBoxpublic BoundingBox move(double xDisplacement, double yDisplacement)
Create a new BoundingBox by moving the min/max x coordinates by xDisplacement and the min/max y coordinates by yDisplacement. If the bounding box is null or the xDisplacement and yDisplacement are 0 then this bounding box will be returned.
move in interface BoundingBoxxDisplacement - The distance to move the min/max x coordinates.yDisplacement - The distance to move the min/max y coordinates.public Geometry toGeometry()
BoundingBoxGeometry with the same extent as the given envelope.
The Geometry returned is guaranteed to be valid.
To provide this behaviour, the following cases occur:
If the BoundingBoxDoubleGf is:
Point
Point
LineString
Polygon> whose points are (minx, miny),
(minx, maxy), (maxx, maxy), (maxx, miny), (minx, miny).
toGeometry in interface BoundingBoxPoint (for null BoundingBoxDoubleGfs),
a Point (when min x = max x and min y = max y) or a
Polygon (in all other cases)public Polygon toPolygon()
toPolygon in interface BoundingBoxpublic Polygon toPolygon(GeometryFactory factory)
toPolygon in interface BoundingBoxpublic Polygon toPolygon(GeometryFactory factory, int numSegments)
toPolygon in interface BoundingBoxpublic Polygon toPolygon(GeometryFactory geometryFactory, int numX, int numY)
toPolygon in interface BoundingBoxpublic Polygon toPolygon(int numSegments)
toPolygon in interface BoundingBoxpublic Polygon toPolygon(int numX, int numY)
toPolygon in interface BoundingBoxCopyright © 2015 Revolution Systems Inc.. All rights reserved.