public class CRSEnvelope extends Object implements Envelope
Represents one of the following:
Modifier and Type | Field and Description |
---|---|
protected double |
maxX
Max of axis 0 as specified by CRS
|
protected double |
maxY
Max of axis 1 as specified by CRS
|
protected double |
minX
Min of axis 0 as specified by CRS
|
protected double |
minY
Min of axis 1 as specified by CRS
|
protected double |
resX
optional spatial resolution in the units of crs
|
protected double |
resY
optional spatial resolution in the units of crs
|
Constructor and Description |
---|
CRSEnvelope()
Construct an empty BoundingBox
|
CRSEnvelope(Envelope envelope) |
CRSEnvelope(String epsgCode,
double minX,
double minY,
double maxX,
double maxY)
Create a bounding box with the specified properties
|
Modifier and Type | Method and Description |
---|---|
double |
getCenter(int dimension) |
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system for this envelope (if known). return
CoordinateReferenceSystem if known, or
null |
int |
getDimension()
The length of coordinate sequence (the number of entries) in this envelope.
|
String |
getEPSGCode() |
double |
getLength(int dimension) |
DirectPosition |
getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all
points within the
Envelope . |
double |
getMaximum(int dimension)
Returns the maximal ordinate along the specified dimension.
|
double |
getMaxX()
The maxX value is the higher X coordinate value
|
double |
getMaxY()
The maxY value is the higher Y coordinate value
|
double |
getMedian(int dimension)
Returns the median ordinate along the specified dimension.
|
double |
getMinimum(int dimension)
Returns the minimal ordinate along the specified dimension.
|
double |
getMinX()
The minX value is the lower X coordinate value
|
double |
getMinY()
The minY value is the lower Y coordinate value
|
double |
getResX()
Optional spatial resolution in the units of crs.
|
double |
getResY()
Optional spatial resolution in the units of crs.
|
double |
getSpan(int dimension)
Returns the envelope span (typically width or height) along the specified dimension.
|
String |
getSRSName()
The CRS is bounding box's Coordinate Reference System.
|
DirectPosition |
getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all
points within the
Envelope . |
void |
setEPSGCode(String epsgCode)
Helper method to set srsName.
|
void |
setMaxX(double maxX)
The maxX value is the higher X coordinate value
|
void |
setMaxY(double maxY)
The maxY value is the higher Y coordinate value
|
void |
setMinX(double minX)
The minX value is the lower X coordinate value
|
void |
setMinY(double minY)
The minY value is the lower Y coordinate value
|
void |
setResX(double resX)
Optional spatial resolution in the units of crs.
|
void |
setResY(double resY)
Optional spatial resolution in the units of crs.
|
void |
setSRSName(String srsName)
Deprecated.
Please use setSRSName(String,boolean) to explicitly indicate axis handling
|
void |
setSRSName(String srsName,
boolean forceXY)
The CRS is bounding box's Coordinate Reference System.
|
String |
toString() |
protected double minX
protected double minY
protected double maxX
protected double maxY
protected double resX
protected double resY
public CRSEnvelope()
public CRSEnvelope(String epsgCode, double minX, double minY, double maxX, double maxY)
epsgCode
- The Coordinate Reference System this bounding box is inminX
- minY
- maxX
- maxY
- public CRSEnvelope(Envelope envelope)
public CoordinateReferenceSystem getCoordinateReferenceSystem()
null
getCoordinateReferenceSystem
in interface Envelope
null
if unknown.public String getSRSName()
public void setEPSGCode(String epsgCode)
setSRSName
public String getEPSGCode()
getSRSName
public void setSRSName(String srsName)
Examples from WMS specification:
srsName
- The SRSName for this envelope; usually an EPSG codepublic void setSRSName(String srsName, boolean forceXY)
Examples from WMS specification:
srsName
- The SRSName for this envelope; usually an EPSG codeforceXY
- True to forceXY axis order (used prior to WMS 1.3.0), False to use provided
axis order (WMS 1.3.0 and later )public int getDimension()
Envelope
getDimension
in interface Envelope
public double getMinimum(int dimension)
Envelope
DirectPosition
object:
Envelope.getLowerCorner().getOrdinate(dimension)
getMinimum
in interface Envelope
dimension
- The dimension for which to obtain the ordinate value.RectangularShape.getMinX()
,
RectangularShape.getMinY()
public double getMaximum(int dimension)
Envelope
DirectPosition
object:
Envelope.getUpperCorner().getOrdinate(dimension)
getMaximum
in interface Envelope
dimension
- The dimension for which to obtain the ordinate value.RectangularShape.getMaxX()
,
RectangularShape.getMaxY()
public double getCenter(int dimension)
public double getMedian(int dimension)
Envelope
(getMinimum(dimension) + getMaximum(dimension)) / 2
getMedian
in interface Envelope
dimension
- The dimension for which to obtain the ordinate value.RectangularShape.getCenterX()
,
RectangularShape.getCenterY()
public double getLength(int dimension)
public double getSpan(int dimension)
Envelope
getMaximum(dimension) - getMinimum(dimension)
getSpan
in interface Envelope
dimension
- The dimension for which to obtain the ordinate value.RectangularShape.getWidth()
,
RectangularShape.getHeight()
public DirectPosition getUpperCorner()
Envelope
Envelope
.getUpperCorner
in interface Envelope
public DirectPosition getLowerCorner()
Envelope
Envelope
.getLowerCorner
in interface Envelope
public double getMaxX()
public void setMaxX(double maxX)
maxX
- the new value for maxX. Should be greater than minX.public double getMaxY()
public void setMaxY(double maxY)
maxY
- the new value for maxY. Should be greater than minY.public double getMinX()
public void setMinX(double minX)
minX
- the new value for minX. Should be less than maxX.public double getMinY()
public void setMinY(double minY)
minY
- the new value for minY. Should be less than maxY.public double getResX()
public void setResX(double resX)
resX
- spatial resolutionm, or Double.NaN if not providedpublic double getResY()
public void setResY(double resY)
resY
- spatial resolutionm, or Double.NaN if not providedCopyright © 1996–2019 Geotools. All rights reserved.