org.deegree_impl.model.ct
Class CoordinateTransformation

java.lang.Object
  extended byorg.deegree_impl.model.cs.Info
      extended byorg.deegree_impl.model.ct.CoordinateTransformation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CoordinateTransformation.Inverse

public class CoordinateTransformation
extends Info

Describes a coordinate transformation. A coordinate transformation class establishes an association between a source and a target coordinate reference system, and provides a MathTransform for transforming coordinates in the source coordinate reference system to coordinates in the target coordinate reference system. These coordinate systems can be ground or image coordinates. In general mathematics, "transformation" is the general term for mappings between coordinate systems (see tensor analysis).

For a ground coordinate point, if the transformation depends only on mathematically derived parameters (as in a cartographic projection), then this is an ISO conversion. If the transformation depends on empirically derived parameters (as in datum transformations), then this is an ISO transformation.

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
CT_CoordinateTransformation, Serialized Form

Nested Class Summary
(package private)  class CoordinateTransformation.Export
          Wrap a CoordinateTransformation for use with OpenGIS.
private static class CoordinateTransformation.Inverse
          The inverse coordinate transformation.
 
Nested classes inherited from class org.deegree_impl.model.cs.Info
 
Field Summary
(package private)  CoordinateTransformation inverse
          The inverse transform.
private  java.lang.Object proxy
          OpenGIS object returned by cachedOpenGIS(java.lang.Object).
private static long serialVersionUID
          Serial number for interoperability with different versions.
private  CoordinateSystem sourceCS
          The source coordinate system.
private  CoordinateSystem targetCS
          The destination coordinate system.
protected  MathTransform transform
          The underlying math transform, or null if it doesn't has been constructed yet.
private  TransformType type
          The transform type.
 
Fields inherited from class org.deegree_impl.model.cs.Info
 
Constructor Summary
CoordinateTransformation(java.lang.String name, CoordinateSystem sourceCS, CoordinateSystem targetCS, TransformType type, MathTransform transform)
          Construct a coordinate transformation.
 
Method Summary
(package private)  java.lang.Object cachedOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this info.
 boolean equals(java.lang.Object object)
          Compares the specified object with this coordinate transformation for equality.
 MathTransform getMathTransform()
          Gets the math transform.
 java.lang.String getName(java.util.Locale locale)
          Gets the name of this coordinate transformation.
 CoordinateSystem getSourceCS()
          Gets the source coordinate system.
 CoordinateSystem getTargetCS()
          Gets the target coordinate system.
 TransformType getTransformType()
          Gets the semantic type of transform.
 int hashCode()
          Returns a hash value for this coordinate transformation.
 CoordinateTransformation inverse()
          Returns the inverse transform of this object.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this math transform.
 
Methods inherited from class org.deegree_impl.model.cs.Info
ensureNonNull, getAbbreviation, getAlias, getAuthority, getAuthorityCode, getRemarks, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values

proxy

private transient java.lang.Object proxy
OpenGIS object returned by cachedOpenGIS(java.lang.Object). It may be a hard or a weak reference.


sourceCS

private final CoordinateSystem sourceCS
The source coordinate system.


targetCS

private final CoordinateSystem targetCS
The destination coordinate system.


type

private final TransformType type
The transform type.


transform

protected MathTransform transform
The underlying math transform, or null if it doesn't has been constructed yet. If null, then subclass must initialize this field the first time getMathTransform() is invoked.


inverse

transient CoordinateTransformation inverse
The inverse transform. This field will be computed only when needed.

Constructor Detail

CoordinateTransformation

public CoordinateTransformation(java.lang.String name,
                                CoordinateSystem sourceCS,
                                CoordinateSystem targetCS,
                                TransformType type,
                                MathTransform transform)
Construct a coordinate transformation.

Parameters:
name - The coordinate transformation name, or null for an automatically generated name.
sourceCS - The source coordinate system.
targetCS - The destination coordinate system.
type - The transform type.
transform - The math transform. This argument is allowed to be null only if this constructor is invoked from within a subclass constructor. In this case, the subclass must construct a math transform no later than the first time getMathTransform() is invoked.
Method Detail

getName

public java.lang.String getName(java.util.Locale locale)
Gets the name of this coordinate transformation.

Overrides:
getName in class Info
Parameters:
locale - The desired locale, or null for the default locale.
See Also:
CS_Info.getName()

getSourceCS

public CoordinateSystem getSourceCS()
Gets the source coordinate system.

See Also:
CT_CoordinateTransformation.getSourceCS()

getTargetCS

public CoordinateSystem getTargetCS()
Gets the target coordinate system.

See Also:
CT_CoordinateTransformation.getTargetCS()

getTransformType

public TransformType getTransformType()
Gets the semantic type of transform. For example, a datum transformation or a coordinate conversion.

See Also:
CT_CoordinateTransformation.getTransformType()

getMathTransform

public MathTransform getMathTransform()
Gets the math transform. The math transform will transform positions in the source coordinate system into positions in the target coordinate system.

See Also:
CT_CoordinateTransformation.getMathTransform()

inverse

public CoordinateTransformation inverse()
                                 throws NoninvertibleTransformException
Returns the inverse transform of this object.

Throws:
NoninvertibleTransformException

hashCode

public int hashCode()
Returns a hash value for this coordinate transformation.

Overrides:
hashCode in class Info

equals

public boolean equals(java.lang.Object object)
Compares the specified object with this coordinate transformation for equality. The default implementation compare name, transform type, source and target coordinate systems. It doesn't compare the math transform, since it should be equivalents if the above mentionned parameters are equal.

Overrides:
equals in class Info

toOpenGIS

java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this math transform. The returned object is suitable for RMI use. Note 1: The returned type is a generic Object in order to avoid too early class loading of OpenGIS interface. Note 2: We do NOT want this method to override Info.toOpenGIS(), since the returned object do not implements CS_Info. The package-private access do the trick.


cachedOpenGIS

final java.lang.Object cachedOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this info. This method first look in the cache. If no interface was previously cached, then this method create a new adapter and cache the result.

Parameters:
adapters - The originating Adapters.