public class Envelope extends Geometry implements Serializable
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type
Constructor and Description |
---|
Envelope()
Constructs an empty envelope.
|
Envelope(double xmin,
double ymin,
double xmax,
double ymax)
Constructs an envelope with the specified X and Y extents.
|
Envelope(Envelope2D env2D) |
Envelope(Point point)
Constructs an envelope that covers the given point.
|
Envelope(Point center,
double width,
double height)
Creates an envelope by defining its center, width, and height.
|
Envelope(VertexDescription vd) |
Envelope(VertexDescription vd,
Envelope2D env2D) |
Modifier and Type | Method and Description |
---|---|
protected void |
_assignVertexDescriptionImpl(VertexDescription newDescription) |
void |
applyTransformation(Transformation2D transform)
Applies 2D affine transformation in XY plane.
|
double |
calculateArea2D()
Calculates the area of the geometry.
|
double |
calculateLength2D()
Calculates the length of the geometry.
|
void |
centerAt(Point c)
Centers the envelope around the specified point preserving the envelope's
width and height.
|
void |
centerAt(Point c,
double w,
double h)
Sets the envelope's corners to be centered around the specified point,
using its center, width, and height.
|
boolean |
contains(Envelope env)
Checks if this envelope contains (covers) other envelope.
|
boolean |
contains(Point p)
Checks if this envelope contains (covers) the specified point.
|
void |
copyTo(Geometry dst)
Copies this geometry to another geometry of the same type.
|
Geometry |
createInstance()
Creates an instance of an empty geometry of the same type.
|
boolean |
equals(Object _other)
Returns TRUE when this geometry has exactly same type, properties, and
coordinates as the other geometry.
|
long |
estimateMemorySize()
Returns an estimate of this object size in bytes.
|
Geometry |
getBoundary()
Returns boundary of this geometry.
|
Point |
getCenter()
Returns the center point of the envelope.
|
void |
getCenter(Point point_out) |
Point2D |
getCenter2D()
Gets the center point of the envelope.
|
double |
getCenterX()
The x-coordinate of the center of the envelope.
|
Point2D |
getCenterXY()
The x and y-coordinates of the center of the envelope.
|
double |
getCenterY()
The y-coordinate of center of the envelope.
|
int |
getDimension()
Returns the topological dimension of the geometry object based on the
geometry's type.
|
double |
getHeight()
The height of the envelope.
|
Point |
getLowerLeft()
Returns the envelope's lower left corner point.
|
Point |
getLowerRight()
Returns the envelope's lower right corner point.
|
Geometry.Type |
getType()
Returns the geometry type.
|
Point |
getUpperLeft()
Returns the envelope's upper left corner point.
|
Point |
getUpperRight()
Returns the envelope's upper right corner point.
|
double |
getWidth()
The width of the envelope.
|
double |
getXMax()
Returns the X coordinate of the right corners of the envelope.
|
double |
getXMin()
Returns the X coordinate of the left corners of the envelope.
|
double |
getYMax()
Returns the Y coordinate of the top corners of the envelope.
|
double |
getYMin()
Returns the Y coordinate of the bottom corners of the envelope.
|
int |
hashCode()
Returns a hash code value for this envelope.
|
void |
inflate(double dx,
double dy)
Changes the dimensions of the envelope while preserving the center.
|
boolean |
intersect(Envelope other)
Changes this envelope to be the intersection of itself with the other
envelope.
|
boolean |
isEmpty()
Indicates whether this envelope contains any points.
|
boolean |
isIntersecting(Envelope other)
Returns true if the envelope and the other given envelope intersect.
|
boolean |
isIntersecting(Envelope2D other) |
void |
merge(Envelope other)
Merges this envelope with the extent of the given envelope.
|
void |
merge(Envelope2D other) |
void |
merge(Point point)
Merges this envelope with the point.
|
void |
merge(Point2D pt) |
void |
normalize()
Normalizes envelopes if the minimum dimension is larger than the
maximum dimension.
|
void |
offset(double dx,
double dy)
Offsets the envelope by the specified distances along x and y-coordinates.
|
void |
queryCoordinates(Point2D[] dst) |
void |
queryCorner(int index,
Point2D ptDst) |
void |
queryCornerByVal(int index,
Point ptDst)
Sets the point's coordinates to the coordinates of the envelope at the
given corner.
|
void |
queryEnvelope(Envelope env)
Returns the axis aligned bounding box of the geometry.
|
void |
queryEnvelope2D(Envelope2D env)
Returns tight bbox of the Geometry in X, Y plane.
|
Envelope1D |
queryInterval(int semantics,
int ordinate)
Returns the min and max attribute values at the ordinate of the Geometry.
|
void |
reaspect(double arWidth,
double arHeight)
Re-aspects this envelope to fit within the specified width and height.
|
void |
replaceNaNs(int semantics,
double value)
Replaces NaNs in the attribute with the given value.
|
void |
setCoords(double xmin,
double ymin,
double xmax,
double ymax)
Sets the 2-dimensional extents of the envelope.
|
void |
setEmpty()
Removes all points from this geometry.
|
void |
setInterval(int semantics,
int ordinate,
double vmin,
double vmax) |
void |
setInterval(int semantics,
int ordinate,
Envelope1D env) |
void |
setXMax(double x)
Sets the right X coordinate.
|
void |
setXMin(double x)
Sets the left X coordinate.
|
void |
setYMax(double y)
Sets the top Y coordinate.
|
void |
setYMin(double y)
Sets the bottom Y coordinate.
|
String |
toString()
The output of this method can be only used for debugging.
|
_getImpl, addAttribute, addID, addM, assignVertexDescription, copy, dropAllAttributes, dropAttribute, estimateMemorySize, getDescription, getDimensionFromType, getStateFlag, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, queryLooseEnvelope2D, vertex_count
public Envelope(Point center, double width, double height)
center
- The center point of the envelope.width
- The width of the envelope.height
- The height of the envelope.public Envelope(Envelope2D env2D)
public Envelope(VertexDescription vd)
public Envelope(VertexDescription vd, Envelope2D env2D)
public Envelope()
public Envelope(Point point)
point
- The point that the envelope covers.public Envelope(double xmin, double ymin, double xmax, double ymax)
xmin
- The minimum x-coordinate of the envelope.ymin
- The minimum y-coordinate of the envelope.xmax
- The maximum x-coordinate of the envelope.ymax
- The maximum y-coordinate of the envelope.public void setCoords(double xmin, double ymin, double xmax, double ymax)
xmin
- The minimum x-coordinate of the envelope.ymin
- The minimum y-coordinate of the envelope.xmax
- The maximum x-coordinate of the envelope.ymax
- The maximum y-coordinate of the envelope.public void setEmpty()
public boolean isEmpty()
public double getWidth()
public double getHeight()
public double getCenterX()
public double getCenterY()
public Point2D getCenterXY()
public void getCenter(Point point_out)
public void merge(Point2D pt)
public void merge(Envelope other)
other
- The envelope to merge.public void merge(Point point)
point
- The point to be merged.public void merge(Envelope2D other)
public void setInterval(int semantics, int ordinate, double vmin, double vmax)
public void reaspect(double arWidth, double arHeight)
arWidth
- The width within which to fit the envelope.arHeight
- The height within which to fit the envelope.public void inflate(double dx, double dy)
dx
- The inflation along the x-axis.dy
- The inflation along the y-axis.public void applyTransformation(Transformation2D transform)
Geometry
applyTransformation
in class Geometry
transform
- The affine transformation to be applied to this geometry.public void copyTo(Geometry dst)
Geometry
public Geometry createInstance()
Geometry
createInstance
in class Geometry
public double calculateArea2D()
Geometry
calculateArea2D
in class Geometry
public double calculateLength2D()
Geometry
GeometryEngine
calculateLength2D
in class Geometry
public Geometry.Type getType()
Geometry
public int getDimension()
Geometry
Returns 0 for point and multipoint.
Returns 1 for lines and polylines.
Returns 2 for polygons and envelopes
Returns 3 for objects with volume
getDimension
in class Geometry
public long estimateMemorySize()
Geometry
This estimate doesn't include the size of the VertexDescription
object
because instances of VertexDescription
are shared among
geometry objects.
estimateMemorySize
in class Geometry
public void queryEnvelope(Envelope env)
Geometry
queryEnvelope
in class Geometry
env
- The envelope to return the result in.public void queryEnvelope2D(Envelope2D env)
Geometry
queryEnvelope2D
in class Geometry
env
- The envelope to return the result in.public Envelope1D queryInterval(int semantics, int ordinate)
Geometry
queryInterval
in class Geometry
semantics
- The semantics of the interval.ordinate
- The ordinate of the interval.public void setInterval(int semantics, int ordinate, Envelope1D env)
public void queryCoordinates(Point2D[] dst)
public void queryCornerByVal(int index, Point ptDst)
index
- The index of the envelope's corners from 0 to 3.
0 = lower left corner
1 = top-left corner
2 = top right corner
3 = bottom right corner
ptDst
- The point whose coordinates are used to set the envelope's
coordinate at a specified corner.public void queryCorner(int index, Point2D ptDst)
protected void _assignVertexDescriptionImpl(VertexDescription newDescription)
_assignVertexDescriptionImpl
in class Geometry
public boolean isIntersecting(Envelope2D other)
public boolean intersect(Envelope other)
other
- The envelope to intersect.public boolean isIntersecting(Envelope other)
other
- The envelope to with which to test intersection.public void centerAt(Point c, double w, double h)
c
- The point around which to center the envelope.w
- The width to be set for the envelope.h
- The height to be set for this envelope.public void offset(double dx, double dy)
dx
- The X offset to be applied.dy
- The Y offset to be applied.public void normalize()
public Point2D getCenter2D()
public Point getCenter()
public void centerAt(Point c)
c
- The new center point.public Point getLowerLeft()
public Point getUpperRight()
public Point getLowerRight()
public Point getUpperLeft()
public boolean contains(Point p)
p
- The Point to be tested for coverage.public boolean contains(Envelope env)
env
- The envelope to be tested for coverage.public boolean equals(Object _other)
public int hashCode()
public final double getXMin()
public final double getYMin()
public final double getXMax()
public final double getYMax()
public void setXMin(double x)
x
- The X coordinate of the left cornerpublic void setXMax(double x)
x
- The X coordinate of the right corner.public void setYMin(double y)
y
- the Y coordinate of the bottom corner.public void setYMax(double y)
y
- The Y coordinate of the top corner.public Geometry getBoundary()
Geometry
getBoundary
in class Geometry
public void replaceNaNs(int semantics, double value)
Geometry
replaceNaNs
in class Geometry
semantics
- The semantics for which to replace the NaNs.value
- The value to replace NaNs with.Copyright © 2018. All rights reserved.