Package org.geotools.ows.wms
Class CRSEnvelope
- Object
- 
- CRSEnvelope
 
- 
- All Implemented Interfaces:
- Bounds
 
 public class CRSEnvelope extends Object implements Bounds A pair of coordinates and a reference system that represents a section of the Earth.Represents one of the following: - EX_GeographicBoundingBox: (implicit CRS:84) limits of the enclosing rectangle in longitude and latitude decimal degrees
- BoundingBox: The BoundingBox attributes indicate the limits of the bounding box in units of the specified coordinate reference system.
 - After WMS 1.3.0: axis order be returned with forceXY=false
- Before WMS 1.3.0: axis order defined using forceXY=true
 - Author:
- Richard Gould
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected doublemaxXMax of axis 0 as specified by CRSprotected doublemaxYMax of axis 1 as specified by CRSprotected doubleminXMin of axis 0 as specified by CRSprotected doubleminYMin of axis 1 as specified by CRSprotected doubleresXoptional spatial resolution in the units of crsprotected doubleresYoptional spatial resolution in the units of crs
 - 
Constructor SummaryConstructors Constructor Description CRSEnvelope()Construct an empty BoundingBoxCRSEnvelope(String epsgCode, double minX, double minY, double maxX, double maxY)Create a bounding box with the specified propertiesCRSEnvelope(Bounds envelope)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCenter(int dimension)CoordinateReferenceSystemgetCoordinateReferenceSystem()Returns the coordinate reference system for this envelope (if known). return CoordinateReferenceSystem if known, ornullintgetDimension()The length of coordinate sequence (the number of entries) in this envelope.StringgetEPSGCode()doublegetLength(int dimension)PositiongetLowerCorner()A coordinate position consisting of all the minimal ordinates for each dimension for all points within theEnvelope.doublegetMaximum(int dimension)Returns the maximal ordinate along the specified dimension.doublegetMaxX()The maxX value is the higher X coordinate valuedoublegetMaxY()The maxY value is the higher Y coordinate valuedoublegetMedian(int dimension)Returns the median ordinate along the specified dimension.doublegetMinimum(int dimension)Returns the minimal ordinate along the specified dimension.doublegetMinX()The minX value is the lower X coordinate valuedoublegetMinY()The minY value is the lower Y coordinate valuedoublegetResX()Optional spatial resolution in the units of crs.doublegetResY()Optional spatial resolution in the units of crs.doublegetSpan(int dimension)Returns the envelope span (typically width or height) along the specified dimension.StringgetSRSName()The CRS is bounding box's Coordinate Reference System.PositiongetUpperCorner()A coordinate position consisting of all the maximal ordinates for each dimension for all points within theEnvelope.voidsetEPSGCode(String epsgCode)Helper method to set srsName.voidsetMaxX(double maxX)The maxX value is the higher X coordinate valuevoidsetMaxY(double maxY)The maxY value is the higher Y coordinate valuevoidsetMinX(double minX)The minX value is the lower X coordinate valuevoidsetMinY(double minY)The minY value is the lower Y coordinate valuevoidsetResX(double resX)Optional spatial resolution in the units of crs.voidsetResY(double resY)Optional spatial resolution in the units of crs.voidsetSRSName(String srsName, boolean forceXY)The CRS is bounding box's Coordinate Reference System.StringtoString()
 
- 
- 
- 
Field Detail- 
minXprotected double minX Min of axis 0 as specified by CRS
 - 
minYprotected double minY Min of axis 1 as specified by CRS
 - 
maxXprotected double maxX Max of axis 0 as specified by CRS
 - 
maxYprotected double maxY Max of axis 1 as specified by CRS
 - 
resXprotected double resX optional spatial resolution in the units of crs
 - 
resYprotected double resY optional spatial resolution in the units of crs
 
- 
 - 
Constructor Detail- 
CRSEnvelopepublic CRSEnvelope() Construct an empty BoundingBox
 - 
CRSEnvelopepublic CRSEnvelope(String epsgCode, double minX, double minY, double maxX, double maxY) Create a bounding box with the specified properties- Parameters:
- epsgCode- The Coordinate Reference System this bounding box is in
 
 - 
CRSEnvelopepublic CRSEnvelope(Bounds envelope) 
 
- 
 - 
Method Detail- 
getCoordinateReferenceSystempublic CoordinateReferenceSystem getCoordinateReferenceSystem() Returns the coordinate reference system for this envelope (if known). return CoordinateReferenceSystem if known, ornull- Specified by:
- getCoordinateReferenceSystemin interface- Bounds
- Returns:
- The envelope CRS, or nullif unknown.
 
 - 
getSRSNamepublic String getSRSName() The CRS is bounding box's Coordinate Reference System.- Returns:
- the CRS/SRS value, or null for implicit CRS:84
 
 - 
setEPSGCodepublic void setEPSGCode(String epsgCode) Helper method to set srsName.- See Also:
- setSRSName(java.lang.String)
 
 - 
getEPSGCodepublic String getEPSGCode() - See Also:
- getSRSName()
 
 - 
setSRSNamepublic void setSRSName(String srsName, boolean forceXY) The CRS is bounding box's Coordinate Reference System.Examples from WMS specification: - CRS:84: default in lon / lat order
 - Parameters:
- srsName- The SRSName for this envelope; usually an EPSG code
- forceXY- True to forceXY axis order (used prior to WMS 1.3.0), False to use provided axis order (WMS 1.3.0 and later )
 
 - 
getDimensionpublic int getDimension() Description copied from interface:BoundsThe length of coordinate sequence (the number of entries) in this envelope. Mandatory even when the coordinate reference system is unknown.- Specified by:
- getDimensionin interface- Bounds
- Returns:
- The dimensionality of this envelope.
 
 - 
getMinimumpublic double getMinimum(int dimension) Description copied from interface:BoundsReturns the minimal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryPositionobject:Bounds.getLowerCorner().getOrdinate(dimension)- Specified by:
- getMinimumin interface- Bounds
- Parameters:
- dimension- The dimension for which to obtain the ordinate value.
- Returns:
- The minimal ordinate at the given dimension.
- See Also:
- RectangularShape.getMinX(),- RectangularShape.getMinY()
 
 - 
getMaximumpublic double getMaximum(int dimension) Description copied from interface:BoundsReturns the maximal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryPositionobject:Bounds.getUpperCorner().getOrdinate(dimension)- Specified by:
- getMaximumin interface- Bounds
- Parameters:
- dimension- The dimension for which to obtain the ordinate value.
- Returns:
- The maximal ordinate at the given dimension.
- See Also:
- RectangularShape.getMaxX(),- RectangularShape.getMaxY()
 
 - 
getCenterpublic double getCenter(int dimension) 
 - 
getMedianpublic double getMedian(int dimension) Description copied from interface:BoundsReturns the median ordinate along the specified dimension. The result should be equals (minus rounding error) to:(getMinimum(dimension) + getMaximum(dimension)) / 2- Specified by:
- getMedianin interface- Bounds
- Parameters:
- dimension- The dimension for which to obtain the ordinate value.
- Returns:
- The median ordinate at the given dimension.
- See Also:
- RectangularShape.getCenterX(),- RectangularShape.getCenterY()
 
 - 
getLengthpublic double getLength(int dimension) 
 - 
getSpanpublic double getSpan(int dimension) Description copied from interface:BoundsReturns the envelope span (typically width or height) along the specified dimension. The result should be equals (minus rounding error) to:getMaximum(dimension) - getMinimum(dimension)- Specified by:
- getSpanin interface- Bounds
- Parameters:
- dimension- The dimension for which to obtain the ordinate value.
- Returns:
- The span (typically width or height) at the given dimension.
- See Also:
- RectangularShape.getWidth(),- RectangularShape.getHeight()
 
 - 
getUpperCornerpublic Position getUpperCorner() Description copied from interface:BoundsA coordinate position consisting of all the maximal ordinates for each dimension for all points within theEnvelope.- Specified by:
- getUpperCornerin interface- Bounds
- Returns:
- The upper corner.
 
 - 
getLowerCornerpublic Position getLowerCorner() Description copied from interface:BoundsA coordinate position consisting of all the minimal ordinates for each dimension for all points within theEnvelope.- Specified by:
- getLowerCornerin interface- Bounds
- Returns:
- The lower corner.
 
 - 
getMaxXpublic double getMaxX() The maxX value is the higher X coordinate value- Returns:
- the bounding box's maxX value
 
 - 
setMaxXpublic void setMaxX(double maxX) The maxX value is the higher X coordinate value- Parameters:
- maxX- the new value for maxX. Should be greater than minX.
 
 - 
getMaxYpublic double getMaxY() The maxY value is the higher Y coordinate value- Returns:
- the bounding box's maxY value
 
 - 
setMaxYpublic void setMaxY(double maxY) The maxY value is the higher Y coordinate value- Parameters:
- maxY- the new value for maxY. Should be greater than minY.
 
 - 
getMinXpublic double getMinX() The minX value is the lower X coordinate value- Returns:
- the bounding box's minX value
 
 - 
setMinXpublic void setMinX(double minX) The minX value is the lower X coordinate value- Parameters:
- minX- the new value for minX. Should be less than maxX.
 
 - 
getMinYpublic double getMinY() The minY value is the lower Y coordinate value- Returns:
- the bounding box's minY value
 
 - 
setMinYpublic void setMinY(double minY) The minY value is the lower Y coordinate value- Parameters:
- minY- the new value for minY. Should be less than maxY.
 
 - 
getResXpublic double getResX() Optional spatial resolution in the units of crs.- Returns:
- spatial resolutionm, or Double.NaN if not provided
 
 - 
setResXpublic void setResX(double resX) Optional spatial resolution in the units of crs.- Parameters:
- resX- spatial resolutionm, or Double.NaN if not provided
 
 - 
getResYpublic double getResY() Optional spatial resolution in the units of crs.- Returns:
- spatial resolutionm, or Double.NaN if not provided
 
 - 
setResYpublic void setResY(double resY) Optional spatial resolution in the units of crs.- Parameters:
- resY- spatial resolutionm, or Double.NaN if not provided
 
 
- 
 
-