|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.resources.CRSUtilities
A set of static methods working on OpenGIS® coordinate reference system objects. Some of those methods are useful, but not really rigorous. This is why they do not appear in the "official" package, but instead in this private one. Do not rely on this API! It may change in incompatible way in any future release.
Method Summary | |
static java.awt.geom.Point2D |
deltaTransform(org.opengis.referencing.operation.MathTransform2D transform,
java.awt.geom.Point2D origin,
java.awt.geom.Point2D source,
java.awt.geom.Point2D dest)
Transforms the relative distance vector specified by and stores the result in . |
static org.opengis.spatialschema.geometry.DirectPosition |
deltaTransform(org.opengis.referencing.operation.MathTransform transform,
org.opengis.spatialschema.geometry.DirectPosition origin,
org.opengis.spatialschema.geometry.DirectPosition source)
Transforms the relative distance vector specified by and stores the result in . |
static int |
dimensionColinearWith(org.opengis.referencing.cs.CoordinateSystem cs,
org.opengis.referencing.cs.CoordinateSystemAxis axis)
Returns the dimension within the coordinate system of the first occurrence of an axis colinear with the specified axis. |
static boolean |
equalsIgnoreMetadata(java.lang.Object object1,
java.lang.Object object2)
Compare the specified objects for equality. |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getCRS2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns a two-dimensional coordinate reference system representing the two first dimensions of the specified coordinate reference system. |
static org.opengis.referencing.datum.Datum |
getDatum(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the datum of the specified CRS, or if none. |
static int |
getDimensionOf(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
java.lang.Class type)
Returns the dimension of the first coordinate reference system of the given type. |
static org.opengis.referencing.datum.Ellipsoid |
getEllipsoid(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the first ellipsoid found in a coordinate reference system, or if there is none. |
static org.opengis.spatialschema.geometry.Envelope |
getEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the bounding box of the specified coordinate reference system, or if none. |
static org.opengis.referencing.datum.Ellipsoid |
getHeadGeoEllipsoid(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the ellipsoid used by the specified coordinate reference system, providing that the two first dimensions use an instance of GeographicCRS . |
static org.opengis.referencing.crs.SingleCRS |
getHorizontalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the first horizontal coordinate reference system found in the given CRS, or if there is none. |
static org.opengis.referencing.crs.ProjectedCRS |
getProjectedCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the first projected coordinate reference system found in a the given CRS, or if there is none. |
static org.opengis.referencing.crs.CoordinateReferenceSystem |
getSubCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
int lower,
int upper)
Returns a sub-coordinate reference system for the specified dimension range. |
static org.opengis.referencing.crs.TemporalCRS |
getTemporalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the first temporal coordinate reference system found in the given CRS, or if there is none. |
static javax.units.Unit |
getUnit(org.opengis.referencing.cs.CoordinateSystem cs)
Returns the unit used for all axis in the specified coordinate system. |
static org.opengis.referencing.crs.VerticalCRS |
getVerticalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the first vertical coordinate reference system found in a the given CRS, or if there is none. |
static java.lang.String |
toWGS84String(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
java.awt.geom.Rectangle2D bounds)
Returns a character string for the specified geographic area. |
static java.awt.geom.Rectangle2D |
transform(org.opengis.referencing.operation.MathTransform2D transform,
java.awt.geom.Rectangle2D source,
java.awt.geom.Rectangle2D dest)
Transform an envelope. |
static GeneralEnvelope |
transform(org.opengis.referencing.operation.MathTransform transform,
org.opengis.spatialschema.geometry.Envelope envelope)
Transforms an envelope. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean equalsIgnoreMetadata(java.lang.Object object1, java.lang.Object object2)
object1
- The first object to compare (may be null).object2
- The second object to compare (may be null).
CRS
.
The method signature is already there.public static int dimensionColinearWith(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystemAxis axis)
is . If no such axis occurs in this coordinate system, then is returned.cs.getAxis(k).getDirection().absolute() == axis.getDirection().absolute()
For example, returns the dimension number of time axis.
cs
- The coordinate system to examine.axis
- The axis to look for.
public static javax.units.Unit getUnit(org.opengis.referencing.cs.CoordinateSystem cs)
public static int getDimensionOf(org.opengis.referencing.crs.CoordinateReferenceSystem crs, java.lang.Class type) throws java.lang.IllegalArgumentException
CoordinateReferenceSystem
.
If no such dimension is found, then this method returns .
crs
- The coordinate reference system (CRS) to examine.type
- The CRS type to look for.
Must be a subclass of CoordinateReferenceSystem
.
java.lang.IllegalArgumentException
- if the is not legal.public static org.opengis.referencing.crs.CoordinateReferenceSystem getSubCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int lower, int upper)
crs
- The coordinate reference system to decompose.lower
- The first dimension to keep, inclusive.upper
- The last dimension to keep, exclusive.
public static org.opengis.referencing.crs.CoordinateReferenceSystem getCRS2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws org.opengis.referencing.operation.TransformException
CompoundCRS
, then the
head coordinate reference system is examined.
crs
- The coordinate system, or .
org.opengis.referencing.operation.TransformException
- if can't be reduced to a two-coordinate system.
We use this exception class since this method is usually invoked in the context
of a transformation process.public static org.opengis.referencing.crs.SingleCRS getHorizontalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.crs.ProjectedCRS getProjectedCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.crs.VerticalCRS getVerticalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.crs.TemporalCRS getTemporalCRS(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.datum.Datum getDatum(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.datum.Ellipsoid getEllipsoid(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
CRS
.public static org.opengis.referencing.datum.Ellipsoid getHeadGeoEllipsoid(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
GeographicCRS
. Otherwise (i.e. if the
two first dimensions are not geographic), returns .
public static org.opengis.spatialschema.geometry.Envelope getEnvelope(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
crs
- The coordinate reference system, or .
CRS
.
The method signature is already there.public static GeneralEnvelope transform(org.opengis.referencing.operation.MathTransform transform, org.opengis.spatialschema.geometry.Envelope envelope) throws org.opengis.referencing.operation.TransformException
transform
- The transform to use.envelope
- Envelope to transform, or . This envelope will not be modified.
org.opengis.referencing.operation.TransformException
- if a transform failed.CRS
.public static java.awt.geom.Rectangle2D transform(org.opengis.referencing.operation.MathTransform2D transform, java.awt.geom.Rectangle2D source, java.awt.geom.Rectangle2D dest) throws org.opengis.referencing.operation.TransformException
transform(transform, new GeneralEnvelope(source)).toRectangle2D()
transform
- The transform to use. Source and target dimension must be 2.source
- The rectangle to transform (may be ).dest
- The destination rectangle (may be ).
If , a new rectangle will be created and returned.
org.opengis.referencing.operation.TransformException
- if a transform failed.CRS
.public static org.opengis.spatialschema.geometry.DirectPosition deltaTransform(org.opengis.referencing.operation.MathTransform transform, org.opengis.spatialschema.geometry.DirectPosition origin, org.opengis.spatialschema.geometry.DirectPosition source) throws org.opengis.referencing.operation.TransformException
transform
- The transform to apply.origin
- The position where to compute the delta transform in the source CS.source
- The distance vector to be delta transformed
org.opengis.referencing.operation.TransformException
- if the transformation failed.public static java.awt.geom.Point2D deltaTransform(org.opengis.referencing.operation.MathTransform2D transform, java.awt.geom.Point2D origin, java.awt.geom.Point2D source, java.awt.geom.Point2D dest) throws org.opengis.referencing.operation.TransformException
transform
- The transform to apply.origin
- The position where to compute the delta transform in the source CS.source
- The distance vector to be delta transformeddest
- The resulting transformed distance vector, or
org.opengis.referencing.operation.TransformException
- if the transformation failed.AffineTransform.deltaTransform(Point2D,Point2D)
public static java.lang.String toWGS84String(org.opengis.referencing.crs.CoordinateReferenceSystem crs, java.awt.geom.Rectangle2D bounds)
CRS
.
Or yet better: move formatting code in
method, and move the transformation code into
constructor.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |