Class DefaultTransformation
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.operation.AbstractCoordinateOperation
org.apache.sis.referencing.operation.AbstractSingleOperation
org.apache.sis.referencing.operation.DefaultTransformation
- All Implemented Interfaces:
Serializable
,Formattable
,Parameterized
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.CoordinateOperation
,org.opengis.referencing.operation.SingleOperation
,org.opengis.referencing.operation.Transformation
public class DefaultTransformation
extends AbstractSingleOperation
implements org.opengis.referencing.operation.Transformation
A parameterized mathematical operation that transforms coordinates to another CRS with a change of
datum.
The parameters of a coordinate transformation are empirically derived from data containing the coordinates of a
series of points in both coordinate reference systems. This computational process is usually "over-determined",
allowing derivation of error (or accuracy) estimates for the
transformation. Also, the stochastic nature of the parameters may result in multiple (different)
versions of the same coordinate transformation.
This coordinate operation contains an operation method, usually
with associated parameter values. In the SIS default implementation, the parameter values are inferred from the
math transform. Subclasses may have to override the AbstractSingleOperation.getParameterValues()
method if they need to provide a different set of parameters.
Immutability and thread safety
This class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. This means that unless otherwise noted in the javadoc,Transformation
instances created using only SIS factories and static constants can be shared
by many objects and passed between threads without synchronization.- Since:
- 0.6
- Version:
- 0.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.AbstractSingleOperation
parameters
Fields inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
coordinateOperationAccuracy, domainOfValidity, sourceCRS, targetCRS, transform
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.operation.CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Constructs a new object in which every attributes are set to a null value.DefaultTransformation
(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform transform) Creates a coordinate transformation from the given properties.protected
DefaultTransformation
(org.opengis.referencing.operation.Transformation operation) Creates a new coordinate operation with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultTransformation
castOrCopy
(org.opengis.referencing.operation.Transformation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation.Class<? extends org.opengis.referencing.operation.Transformation>
Returns the GeoAPI interface implemented by this class.Methods inherited from class org.apache.sis.referencing.operation.AbstractSingleOperation
afterUnmarshal, equals, getMethod, getParameterDescriptors, getParameterValues, setParameterValues
Methods inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
castOrCopy, checkDimensions, computeHashCode, computeTransientFields, formatTo, getCoordinateOperationAccuracy, getDomainOfValidity, getInterpolationCRS, getInterpolationCRS, getLinearAccuracy, getMathTransform, getOperationVersion, getParameterDescriptors, getScope, getSourceCRS, getTargetCRS, getWrapAroundChanges, isDefiningConversion
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.operation.CoordinateOperation
getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getScope
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
Methods inherited from interface org.opengis.referencing.operation.SingleOperation
getMethod, getParameterValues
Methods inherited from interface org.opengis.referencing.operation.Transformation
getOperationVersion, getSourceCRS, getTargetCRS
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
-
Constructor Details
-
DefaultTransformation
public DefaultTransformation(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform transform) Creates a coordinate transformation from the given properties. The properties given in argument follow the same rules than for the super-class constructor. The following table is a reminder of main (not all) properties:Recognized properties (non exhaustive list) Property name Value type Returned by "name" Identifier
orString
AbstractIdentifiedObject.getName()
"identifiers" Identifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
"coordinateOperationAccuracy" PositionalAccuracy
(optionally as array)AbstractCoordinateOperation.getCoordinateOperationAccuracy()
"domainOfValidity" Extent
AbstractCoordinateOperation.getDomainOfValidity()
- Parameters:
properties
- the properties to be given to the identified object.sourceCRS
- the source CRS.targetCRS
- the target CRS.interpolationCRS
- the CRS of additional coordinates needed for the operation, ornull
if none.method
- the coordinate operation method (mandatory in all cases).transform
- transform from positions in the source CRS to positions in the target CRS.
-
DefaultTransformation
protected DefaultTransformation(org.opengis.referencing.operation.Transformation operation) Creates a new coordinate operation with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.This constructor performs a shallow copy, i.e. the properties are not cloned.
- Parameters:
operation
- the coordinate operation to copy.- See Also:
-
DefaultTransformation
private DefaultTransformation()Constructs a new object in which every attributes are set to a null value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflection.
-
-
Method Details
-
castOrCopy
public static DefaultTransformation castOrCopy(org.opengis.referencing.operation.Transformation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation. If the given object is already an instance ofDefaultTransformation
, then it is returned unchanged. Otherwise a newDefaultTransformation
instance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other properties contained in the given object are not recursively copied.- Parameters:
object
- the object to get as a SIS implementation, ornull
if none.- Returns:
- a SIS implementation containing the values of the given object (may be the
given object itself), or
null
if the argument was null.
-
getInterface
Returns the GeoAPI interface implemented by this class. The SIS implementation returnsTransformation.class
.Note for implementers: Subclasses usually do not need to override this method since GeoAPI does not defineTransformation
sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.- Overrides:
getInterface
in classAbstractCoordinateOperation
- Returns:
Transformation.class
or a user-defined sub-interface.
-