DefaultTransformation (Apache SIS 1.6 API) JavaScript is disabled on your browser.     Skip navigation links Overview Class Use Tree New Deprecated Index Search Help org.apache.sis.referencing org.apache.sis.referencing.operation DefaultTransformation Contents  Description Immutability and thread safety Field Summary Constructor Summary Method Summary Constructor Details DefaultTransformation(Map, CoordinateReferenceSystem, CoordinateReferenceSystem, CoordinateReferenceSystem, OperationMethod, MathTransform) DefaultTransformation(Transformation) Method Details castOrCopy(Transformation) getInterface() getMethod() getParameterDescriptors() getParameterValues() equals(Object, ComparisonMode) Hide sidebar  Show sidebar Class DefaultTransformation Object FormattableObject AbstractIdentifiedObject AbstractCoordinateOperation DefaultTransformation All Implemented Interfaces: Serializable, Formattable, Parameterized, Deprecable, Lenient­Comparable, Printable, Identified­Object, Coordinate­Operation, Single­Operation, Transformation public class DefaultTransformation extends AbstractCoordinateOperation implements 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 Single­Operation​.get­Parameter­Values() 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 See Also: Default­Conversion Serialized Form Field Summary Fields inherited from class AbstractIdentifiedObject DEPRECATED_KEY, DOMAINS_KEY, LOCALE_KEY Fields inherited from interface CoordinateOperation COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY Fields inherited from interface IdentifiedObject ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY Constructor Summary Constructors Modifier Constructor Description   Default­Transformation(Map<String,?> properties, Coordinate­Reference­System source­CRS, Coordinate­Reference­System target­CRS, Coordinate­Reference­System interpolation­CRS, Operation­Method method, Math­Transform transform) Creates a coordinate transformation from the given properties. protected Default­Transformation(Transformation operation) Creates a new coordinate operation with the same values as the specified one. Method Summary All MethodsStatic MethodsInstance MethodsConcrete Methods Modifier and Type Method Description static Default­Transformation cast­Or­Copy(Transformation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation. boolean equals(Object object, Comparison­Mode mode) Compares this coordinate operation with the specified object for equality. Class<? extends Transformation> get­Interface() Returns the GeoAPI interface implemented by this class. Operation­Method get­Method() Returns a description of the operation method, including a list of expected parameter names. Parameter­Descriptor­Group get­Parameter­Descriptors() Returns a description of the parameters. Parameter­Value­Group get­Parameter­Values() Returns the parameter values. Methods inherited from class AbstractCoordinateOperation cast­Or­Copy, format­To, get­Coordinate­Operation­Accuracy, get­Domain­Of­Validity, get­Interpolation­CRS, get­Linear­Accuracy, get­Math­Transform, get­Operation­Version, get­Scope, get­Source­CRS, get­Source­Epoch, get­Target­CRS, get­Target­Epoch, get­Wrap­Around­Changes, is­Defining­Conversion, transform Methods inherited from class AbstractIdentifiedObject cast­Or­Copy, equals, format­To, get­Alias, get­Description, get­Domains, get­Identifiers, get­Name, get­Remarks, hash­Code, is­Deprecated, is­Heuristic­Match­For­Name Methods inherited from class FormattableObject print, to­String, to­String, to­WKT Methods inherited from class Object clone, finalize, get­Class, notify, notify­All, wait, wait, wait Methods inherited from interface CoordinateOperation get­Coordinate­Operation­Accuracy, get­Domain­Of­Validity, get­Math­Transform, get­Scope Methods inherited from interface IdentifiedObject get­Alias, get­Identifiers, get­Name, get­Remarks, to­WKT Methods inherited from interface SingleOperation get­Method, get­Parameter­Values Methods inherited from interface Transformation get­Operation­Version, get­Source­CRS, get­Target­CRS Constructor Details DefaultTransformation public DefaultTransformation(Map<String,?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, CoordinateReferenceSystem interpolationCRS, OperationMethod method, MathTransform transform) Creates a coordinate transformation from the given properties. The properties given in argument follow the same rules as 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 or String AbstractIdentifiedObject.getName() "identifiers" Identifier (optionally as array) AbstractIdentifiedObject.getIdentifiers() "coordinateOperationAccuracy" PositionalAccuracy (optionally as array) AbstractCoordinateOperation.getCoordinateOperationAccuracy() "domainOfValidity" Extent DefaultObjectDomain.getDomainOfValidity() Parameters: properties - the properties to be given to the identified object. source­CRS - the source CRS. target­CRS - the target CRS. interpolation­CRS - the CRS of additional coordinates needed for the operation, or null 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(Transformation operation) Creates a new coordinate operation with the same values as 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: cast­Or­Copy(Transformation) Method Details castOrCopy public static DefaultTransformation castOrCopy(Transformation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation. If the given object is already an instance of Default­Transformation, then it is returned unchanged. Otherwise a new Default­Transformation 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, or null 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 public Class<? extends Transformation> getInterface() Returns the GeoAPI interface implemented by this class. The SIS implementation returns Transformation​.class. Note for implementers Subclasses usually do not need to override this method since GeoAPI does not define Transformation sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces. Overrides: get­Interface in class Abstract­Coordinate­Operation Returns: Transformation​.class or a user-defined sub-interface. getMethod public OperationMethod getMethod() Returns a description of the operation method, including a list of expected parameter names. The returned object does not contains any parameter value. Specified by: get­Method in interface Single­Operation Returns: a description of the operation method. getParameterDescriptors public ParameterDescriptorGroup getParameterDescriptors() Returns a description of the parameters. The default implementation performs the following choice: If parameter values were specified explicitly at construction time, then the descriptor of those parameters is returned. Otherwise if this method can infer the parameter descriptor from the math transform, then that descriptor is returned. Otherwise fallback on the method parameters. Note: the two parameter descriptions (from the Math­Transform or from the Operation­Method) should be very similar. If they differ, it should be only in minor details like remarks, default values or units of measurement. Specified by: get­Parameter­Descriptors in interface Parameterized Returns: a description of the parameters. See Also: Default­Operation­Method​.get­Parameters() Abstract­Math­Transform​.get­Parameter­Descriptors() getParameterValues public ParameterValueGroup getParameterValues() Returns the parameter values. The default implementation performs the following choice: If parameter values were specified explicitly at construction time, then they are returned as an unmodifiable parameter group. Otherwise if this method can infer the parameter values from the math transform, then those parameters are returned. Otherwise throw Unsupported­Implementation­Exception. Specified by: get­Parameter­Values in interface Parameterized Specified by: get­Parameter­Values in interface Single­Operation Returns: the parameter values. Throws: Unsupported­Operation­Exception - if the parameter values cannot be determined for the current math transform implementation. See Also: Abstract­Math­Transform​.get­Parameter­Values() equals public boolean equals(Object object, ComparisonMode mode) Compares this coordinate operation with the specified object for equality. If the mode argument is Comparison­Mode​.STRICT or BY_CONTRACT, then all available properties are compared including the domains and the accuracy. Specified by: equals in interface Lenient­Comparable Overrides: equals in class Abstract­Coordinate­Operation Parameters: object - the object to compare to this. mode - the strictness level of the comparison. Returns: true if both objects are equal for the given comparison mode. See Also: Abstract­Identified­Object​.compute­Hash­Code() Utilities​.deep­Equals(Object, Object, Comparison­Mode)