org.geotoolkit.geometry
Class Envelope2D

Object
  extended by RectangularShape
      extended by Rectangle2D
          extended by Rectangle2D.Double
              extended by Envelope2D
                  extended by Envelope2D
All Implemented Interfaces:
Shape, Serializable, Cloneable, Envelope

Deprecated. Moved to Apache SIS as Envelope2D.

@Deprecated
public class Envelope2D
extends Envelope2D
implements Cloneable

A two-dimensional envelope on top of Rectangle2D. This implementation is provided for inter-operability between Java2D and GeoAPI.

This class inherits x and y fields. But despite their names, they don't need to be oriented toward East and North respectively. The (x,y) axis can have any orientation and should be understood as "ordinate 0" and "ordinate 1" values instead. This is not specific to this implementation; in Java2D too, the visual axis orientation depend on the affine transform in the graphics context.


Spanning the anti-meridian of a Geographic CRS
The Web Coverage Service (WCS) specification authorizes (with special treatment) cases where upper < lower at least in the longitude case. They are envelopes spanning the anti-meridian, like the red box below (the green box is the usual case). For Envelope2D objects, they are rectangle with negative width or height field values. The default implementation of methods listed in the right column can handle such cases.

Supported methods:
  • Envelope2D.getMinimum(int)
  • Envelope2D.getMaximum(int)
  • Envelope2D.getSpan(int)
  • Envelope2D.getMedian(int)
  • Envelope2D.isEmpty()
  • Envelope2D.contains(double,double)
  • Envelope2D.contains(Rectangle2D) and its variant receiving double arguments
  • Envelope2D.intersects(Rectangle2D) and its variant receiving double arguments
  • createIntersection(Rectangle2D)
  • createUnion(Rectangle2D)
  • Envelope2D.add(Rectangle2D)
  • Envelope2D.add(double,double)
The Envelope2D.getMinX(), Envelope2D.getMinY(), Envelope2D.getMaxX(), Envelope2D.getMaxY(), Envelope2D.getCenterX(), Envelope2D.getCenterY(), Envelope2D.getWidth() and Envelope2D.getHeight() methods delegate to the above-cited methods.

Since:
2.1
Version:
3.20
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
GeneralEnvelope, org.geotoolkit.geometry.jts.ReferencedEnvelope, GeographicBoundingBox, Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
 
Field Summary
 
Fields inherited from class Rectangle2D.Double
height, width, x, y
 
Fields inherited from class Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
Envelope2D()
          Deprecated. Constructs an initially empty envelope with no CRS.
Envelope2D(CoordinateReferenceSystem crs, double x, double y, double width, double height)
          Deprecated. Constructs two-dimensional envelope defined by the specified coordinates.
Envelope2D(CoordinateReferenceSystem crs, Rectangle2D rect)
          Deprecated. Constructs two-dimensional envelope defined by an other Rectangle2D.
Envelope2D(DirectPosition lower, DirectPosition upper)
          Deprecated. Constructs two-dimensional envelope defined by the specified coordinates.
Envelope2D(Envelope envelope)
          Deprecated. Constructs two-dimensional envelope defined by an other Envelope.
Envelope2D(GeographicBoundingBox box)
          Deprecated. Constructs a new envelope with the same data than the specified geographic bounding box.
 
Method Summary
 Envelope2D createIntersection(Rectangle2D rect)
          Deprecated. Returns the intersection of this envelope with the specified rectangle.
 Envelope2D createUnion(Rectangle2D rect)
          Deprecated. Returns the union of this envelope with the specified rectangle.
 DirectPosition2D getLowerCorner()
          Deprecated. A coordinate position consisting of all the starting ordinates for each dimension for all points within the Envelope.
 DirectPosition2D getUpperCorner()
          Deprecated. A coordinate position consisting of all the ending ordinates for each dimension for all points within the Envelope.
 void setEnvelope(Envelope envelope)
          Deprecated. Sets this envelope to the same values than the given Envelope.
 
Methods inherited from class Envelope2D
add, add, boundsEquals, contains, contains, contains, equals, getCenterX, getCenterY, getCoordinateReferenceSystem, getDimension, getHeight, getMaximum, getMaxX, getMaxY, getMedian, getMinimum, getMinX, getMinY, getSpan, getWidth, intersects, intersects, isEmpty, setCoordinateReferenceSystem, toString
 
Methods inherited from class Rectangle2D.Double
getBounds2D, getX, getY, outcode, setRect, setRect
 
Methods inherited from class Rectangle2D
add, getPathIterator, getPathIterator, hashCode, intersect, intersectsLine, intersectsLine, outcode, setFrame, union
 
Methods inherited from class RectangularShape
clone, contains, getBounds, getFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Cloneable
clone
 

Constructor Detail

Envelope2D

public Envelope2D()
Deprecated. 
Constructs an initially empty envelope with no CRS.

Since:
2.5

Envelope2D

public Envelope2D(Envelope envelope)
           throws MismatchedDimensionException
Deprecated. 
Constructs two-dimensional envelope defined by an other Envelope.

Parameters:
envelope - The envelope to copy.
Throws:
MismatchedDimensionException - If the given envelope is not two-dimensional.
See Also:
GeneralEnvelope.GeneralEnvelope(Envelope)

Envelope2D

public Envelope2D(GeographicBoundingBox box)
Deprecated. 
Constructs a new envelope with the same data than the specified geographic bounding box. The coordinate reference system is set to WGS84.

Parameters:
box - The bounding box to copy.
Since:
3.11
See Also:
GeneralEnvelope.GeneralEnvelope(GeographicBoundingBox)

Envelope2D

public Envelope2D(CoordinateReferenceSystem crs,
                  Rectangle2D rect)
Deprecated. 
Constructs two-dimensional envelope defined by an other Rectangle2D. If the given rectangle has negative width or height, they will be interpreted as envelope spanning the anti-meridian.

Parameters:
crs - The coordinate reference system, or null.
rect - The rectangle to copy.
See Also:
GeneralEnvelope.GeneralEnvelope(Rectangle2D)

Envelope2D

public Envelope2D(CoordinateReferenceSystem crs,
                  double x,
                  double y,
                  double width,
                  double height)
Deprecated. 
Constructs two-dimensional envelope defined by the specified coordinates. Despite their name, the (x,y) coordinates don't need to be oriented toward (East, North). Those parameter names simply match the x and y fields. The actual axis orientations are determined by the specified CRS. See the class javadoc for details.

Parameters:
crs - The coordinate reference system, or null.
x - The x minimal value.
y - The y minimal value.
width - The envelope width. May be negative for envelope spanning the anti-meridian.
height - The envelope height. May be negative for envelope spanning the anti-meridian.

Envelope2D

public Envelope2D(DirectPosition lower,
                  DirectPosition upper)
           throws MismatchedReferenceSystemException
Deprecated. 
Constructs two-dimensional envelope defined by the specified coordinates. Despite their name, the (x,y) coordinates don't need to be oriented toward (East, North). Those parameter names simply match the x and y fields. The actual axis orientations are determined by the specified CRS. See the class javadoc for details.

Spanning the anti-meridian of a Geographic CRS
This minDP and maxDP arguments may not be really minimal or maximal values if the rectangle cross the anti-meridian. The given arguments are rather the values to be returned by getLowerCorner() and getUpperCorner() methods, which may have an extended interpretation. See the javadoc of above-cited methods for more details.

Parameters:
lower - The fist position.
upper - The second position.
Throws:
MismatchedReferenceSystemException - if the two positions don't use the same CRS.
Since:
2.4
See Also:
GeneralEnvelope.GeneralEnvelope(GeneralDirectPosition, GeneralDirectPosition)
Method Detail

setEnvelope

public void setEnvelope(Envelope envelope)
                 throws MismatchedDimensionException
Deprecated. 
Sets this envelope to the same values than the given Envelope.

Parameters:
envelope - The envelope to copy.
Throws:
MismatchedDimensionException - If the given envelope is not two-dimensional.
Since:
3.09

getLowerCorner

public DirectPosition2D getLowerCorner()
Deprecated. 
A coordinate position consisting of all the starting ordinates for each dimension for all points within the Envelope.
Note: The Web Coverage Service (WCS) 1.1 specification uses an extended interpretation of the bounding box definition. In a WCS 1.1 data structure, the lower corner defines the edges region in the directions of decreasing coordinate values in the envelope CRS. This is usually the algebraic minimum coordinates, but not always. For example, an envelope spanning the anti-meridian could have a lower corner longitude greater than the upper corner longitude. Such extended interpretation applies mostly to axes having WRAPAROUND range meaning.

Specified by:
getLowerCorner in interface Envelope
Overrides:
getLowerCorner in class Envelope2D
Returns:
The lower corner, typically (but not necessarily) containing minimal ordinate values.

getUpperCorner

public DirectPosition2D getUpperCorner()
Deprecated. 
A coordinate position consisting of all the ending ordinates for each dimension for all points within the Envelope.
Note: The Web Coverage Service (WCS) 1.1 specification uses an extended interpretation of the bounding box definition. In a WCS 1.1 data structure, the upper corner defines the edges region in the directions of increasing coordinate values in the envelope CRS. This is usually the algebraic maximum coordinates, but not always. For example, an envelope spanning the anti-meridian could have an upper corner longitude less than the lower corner longitude. Such extended interpretation applies mostly to axes having WRAPAROUND range meaning.

Specified by:
getUpperCorner in interface Envelope
Overrides:
getUpperCorner in class Envelope2D
Returns:
The upper corner, typically (but not necessarily) containing maximal ordinate values.

createIntersection

public Envelope2D createIntersection(Rectangle2D rect)
Deprecated. 
Returns the intersection of this envelope with the specified rectangle. If this envelope or the given rectangle have at least one NaN values, then this method returns an empty envelope.

Spanning the anti-meridian of a Geographic CRS
This method supports anti-meridian spanning in the same way than GeneralEnvelope.intersect(Envelope).

Overrides:
createIntersection in class Envelope2D
Parameters:
rect - The rectangle to be intersected with this envelope.
Returns:
The intersection of the given rectangle with this envelope.

createUnion

public Envelope2D createUnion(Rectangle2D rect)
Deprecated. 
Returns the union of this envelope with the specified rectangle. The default implementation clones this envelope, then delegates to Envelope2D.add(Rectangle2D).

Overrides:
createUnion in class Envelope2D
Parameters:
rect - The rectangle to add to this envelope.
Returns:
The union of the given rectangle with this envelope.


Copyright © 2009-2013 Geotoolkit.org. All Rights Reserved.