public final class

Envelope

extends Geometry
implements Serializable
java.lang.Object
   ↳ com.esri.core.geometry.Geometry
     ↳ com.esri.core.geometry.Envelope

Class Overview

Envelopes are the rectangular window that contain a specific element.

Summary

[Expand]
Inherited Fields
From class com.esri.core.geometry.Geometry
Public Constructors
Envelope(Point center, double width, double height)
Creates an envelope by defining its center, width, and height.
Envelope()
Constructs an empty envelope.
Envelope(Point point)
Constructs an envelope that covers the given point.
Envelope(double xmin, double ymin, double xmax, double ymax)
Constructs an envelope with the specified X and Y extents.
Public Methods
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, double w, double h)
Sets the envelope's corners to be centered around the specified point, using it's center, width, and height.
void centerAt(Point c)
Centers the envelope around the specified point preserving the envelope's 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.
Point getCenter()
Returns the center point of the envelope.
double getCenterX()
The X coordinate of center of the envelope.
double getCenterY()
The Y coordinate fo the 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.
final double getXMax()
Returns the X coordinate of the right corners of the envelope.
final double getXMin()
Returns the X coordinate of the left corners of the envelope.
final double getYMax()
Returns the Y coordinate of the top corners of the envelope.
final 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, 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 isValid()
Checks whether the envelope is valid (xmin, xmax, ymin, ymax all a valid double, i.e.
void merge(Envelope other)
Merges this envelope with the extent of the given envelope.
void merge(Point point)
Merges this envelope with the point.
void normalize()
Normalizes envelopes if the minimum dimension is larger then then the maximum dimension.
void offset(double dx, double dy)
Offsets the envelope by the specified distances along x and y coordinates.
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)
Gets the axis aligned bounding box of the geometry.
void reaspect(double arWidth, double arHeight)
Re-aspects this envelope to fit within the specified width and height.
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 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()
Returns string representation of the class for debugging purposes.
[Expand]
Inherited Methods
From class com.esri.core.geometry.Geometry
From class java.lang.Object

Public Constructors

public Envelope (Point center, double width, double height)

Creates an envelope by defining its center, width, and height.

Parameters
center Point: The center point of the envelope.
width double: The width of the envelope.
height double: The height of the envelope.

public Envelope ()

Constructs an empty envelope.

public Envelope (Point point)

Constructs an envelope that covers the given point. The coordinates of the point are used to set the envelope's extent.

Parameters
point Point: - The point that the envelope covers.

public Envelope (double xmin, double ymin, double xmax, double ymax)

Constructs an envelope with the specified X and Y extents.

Parameters
xmin double: The minimum X coordinate of the envelope.
ymin double: The minimum Y coordinate of the envelope.
xmax double: The maximum X coordinate of the envelope.
ymax double: The maximum Y coordinate of the envelope.

Public Methods

public void applyTransformation (Transformation2D transform)

Applies 2D affine transformation in XY plane.

Parameters
transform Transformation2D: The affine transformation to be applied to this geometry.

public double calculateArea2D ()

Calculates the area of the geometry. If the spatial reference is a Geographic Coordinate System (WGS84) then the 2D area calculation is defined in angular units.

Returns
double A double value representing the 2D area of the geometry.

public double calculateLength2D ()

Calculates the length of the geometry. If the spatial reference is a Geographic Coordinate System (a system where coordinates are defined using angular units such as longitude and latitude) then the 2D distance calculation is returned in angular units. In cases where length must be calculated on a Geographic Coordinate System consider the using the geodeticLength method in GeometryEngine.

Returns
double A double value representing the 2D length of the geometry.

public void centerAt (Point c, double w, double h)

Sets the envelope's corners to be centered around the specified point, using it's center, width, and height.

Parameters
c Point: The point around which to center the envelope.
w double: The width to be set for the envelope.
h double: The height to be set for this envelope.

public void centerAt (Point c)

Centers the envelope around the specified point preserving the envelope's width and height.

Parameters
c Point: The new center point.

public boolean contains (Envelope env)

Checks if this envelope contains (covers) other envelope.

Parameters
env Envelope: The envelope to be tested for coverage.
Returns
boolean TRUE if this envelope contains (covers) the specified envelope.

public boolean contains (Point p)

Checks if this envelope contains (covers) the specified point.

Parameters
p Point: The Point to be tested for coverage.
Returns
boolean TRUE if this envelope contains (covers) the specified point.

public void copyTo (Geometry dst)

Copies this geometry to another geometry of the same type. The result geometry is an exact copy.

Parameters
dst Geometry

public Geometry createInstance ()

Creates an instance of an empty geometry of the same type.

Returns
Geometry

public boolean equals (Object _other)

Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.

Parameters
_other Object
Returns
boolean

public Point getCenter ()

Returns the center point of the envelope.

Returns
Point The center point of the envelope.

public double getCenterX ()

The X coordinate of center of the envelope.

Returns
double The center's X coordinate of the envelope.

public double getCenterY ()

The Y coordinate fo the center of the envelope.

Returns
double The center's Y coordinate of the envelope.

public int getDimension ()

Returns the topological dimension of the geometry object based on the geometry's type.

Returns 0 for point and multipoint.

Returns 1 for lines and polylines.

Returns 2 for polygons and envelopes

Returns 3 for objects with volume

Returns
int Returns the integer value of the dimension of geometry.

public double getHeight ()

The height of the envelope.

Returns
double The height of the envelope.

public Point getLowerLeft ()

Returns the envelope's lower left corner point.

Returns
Point Returns the lower left corner point.

public Point getLowerRight ()

Returns the envelope's lower right corner point.

Returns
Point Returns the lower right corner point.

public Geometry.Type getType ()

Returns the geometry type.

Returns
Geometry.Type Returns the geometry type.

public Point getUpperLeft ()

Returns the envelope's upper left corner point.

Returns
Point Returns the upper left corner point.

public Point getUpperRight ()

Returns the envelope's upper right corner point.

Returns
Point Returns the upper right corner point.

public double getWidth ()

The width of the envelope.

Returns
double The width of the envelope.

public final double getXMax ()

Returns the X coordinate of the right corners of the envelope.

Returns
double The X coordinate of the right corners.

public final double getXMin ()

Returns the X coordinate of the left corners of the envelope.

Returns
double The X coordinate of the left corners.

public final double getYMax ()

Returns the Y coordinate of the top corners of the envelope.

Returns
double The Y coordinate of the top corners.

public final double getYMin ()

Returns the Y coordinate of the bottom corners of the envelope.

Returns
double The Y coordinate of the bottom corners.

public int hashCode ()

Returns a hash code value for this envelope.

Returns
int A hash code value for this envelope.

public void inflate (double dx, double dy)

Changes the dimensions of the envelope, preserving the center. New width is Width + 2 * dx, new height is Height + 2 * dy. If the result envelope width or height becomes negative, the envelope is set to be empty.

Parameters
dx double: The inflation along the X axis.
dy double: The inflation along the Y axis.

public boolean intersect (Envelope other)

Changes this envelope to be the intersection of itself with the other envelope.

Parameters
other Envelope: The envelope to intersect with.
Returns
boolean Returns true if the result is not empty.

public boolean isEmpty ()

Indicates whether this envelope contains any points.

Returns
boolean boolean Returns true if the envelope is empty.

public boolean isIntersecting (Envelope other)

Returns true if the envelope and the other given envelope intersect.

Parameters
other Envelope: The envelope to test intersection with.
Returns
boolean Returns true if the two envelopes are intersecting.

public boolean isValid ()

Checks whether the envelope is valid (xmin, xmax, ymin, ymax all a valid double, i.e. not NaN, and xmin <= xmax, and ymin <= ymax).

Returns
boolean true if Envelope is valid

public void merge (Envelope other)

Merges this envelope with the extent of the given envelope. If the original envelope is empty, the coordinates of the envelope to merge with are assigned. If the envelope to merge with is empty, the original envelope stays unchanged.

Parameters
other Envelope: The envelope to merge with.

public void merge (Point point)

Merges this envelope with the point. The boundary of the envelope is increased to include the point. If the envelope is empty, the coordinates of the point to merge are assigned. If the point is empty, the original envelope stays unchanged.

Parameters
point Point: The point to be merged with.

public void normalize ()

Normalizes envelopes if the minimum dimension is larger then then the maximum dimension.

public void offset (double dx, double dy)

Offsets the envelope by the specified distances along x and y coordinates.

Parameters
dx double: The X offset to be applied.
dy double: The Y offset to be applied.

public void queryCornerByVal (int index, Point ptDst)

Sets the point's coordinates to the coordinates of the envelope at the given corner.

Parameters
index int: The index of the envlope's corners from 0 to 3.

0 = lower left corner

1 = top-left corner

2 = top right corner

3 = bottom right corner

ptDst Point: The point whose coordinates are used to set the envelope's coordinate at a specified corner.

public void queryEnvelope (Envelope env)

Gets the axis aligned bounding box of the geometry.

Parameters
env Envelope: The envelope to return the result in.

public void reaspect (double arWidth, double arHeight)

Re-aspects this envelope to fit within the specified width and height.

Parameters
arWidth double: The width within which to fit the envelope.
arHeight double: The height within which to fit the envelope.

public void setCoords (double xmin, double ymin, double xmax, double ymax)

Sets the 2 dimensional extents of the envelope.

Parameters
xmin double: The minimum X coordinate of the envelope.
ymin double: The minimum Y coordinate of the envelope.
xmax double: The maximum X coordinate of the envelope.
ymax double: The maximum Y coordinate of the envelope.

public void setEmpty ()

Removes all points from this geometry.

public void setXMax (double x)

Sets the right X coordinate.

Parameters
x double: The X coordinate of the right corner.

public void setXMin (double x)

Sets the left X coordinate.

Parameters
x double: The X coordinate of the left corner

public void setYMax (double y)

Sets the top Y coordinate.

Parameters
y double: The Y coordinate of the top corner.

public void setYMin (double y)

Sets the bottom Y coordinate.

Parameters
y double: the Y coordinate of the bottom corner.

public String toString ()

Returns string representation of the class for debugging purposes. The format and content of the returned string is not part of the contract of the method and is subject to change in any future release or patch without further notice.

Returns
String