- All Implemented Interfaces:
- The source and target CRS.
- The interpolation CRS if a CRS other than source and target is needed for interpolating.
- In conversion and transformation subclasses, a description of the operation method together with the parameter values.
- The domain of validity.
- An estimation of the operation accuracy.
InstantiationThis class is conceptually abstract, even if it is technically possible to instantiate it. Typical applications should create instances of the most specific subclass prefixed by
Defaultinstead. An exception to this rule may occur when it is not possible to identify the exact operation type.
Immutability and thread safetyThis base class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar conditions. This means that unless otherwise noted in the javadoc,
CoordinateOperationinstances created using only SIS factories and static constants can be shared by many objects and passed between threads without synchronization.
- See Also:
Defined in the
Fields inherited from interface CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY
(Map<String, ?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, CoordinateReferenceSystem interpolationCRS, MathTransform transform)Creates a coordinate operation from the given properties.
protectedCreates a new coordinate operation with the same values than the specified one.
Method SummaryModifier and TypeMethodDescriptionReturns a SIS coordinate operation implementation with the values of the given arbitrary implementation.
protected longInvoked by
hashCode()for computing the hash code when first needed.
booleanCompares this coordinate operation with the specified object for equality.
protected StringFormats this coordinate operation in Well Known Text (WKT) version 2 format.Returns an estimation of the impact of this operation on point accuracy.Returns the area or region or timeframe in which this coordinate operation is valid.Returns the GeoAPI interface implemented by this class.
doubleReturns an estimation of positional accuracy in metres, or
NaNif unknown.Returns the version of the coordinate operation.Returns a description of domain of usage, or limitations of usage, for which this operation is valid.Returns the source CRS, or
nullif unspecified.Returns the target CRS, or
nullif unspecified.Returns the indices of target dimensions where "wrap around" may happen as a result of this coordinate operation.
Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
(Map<String, ?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, CoordinateReferenceSystem interpolationCRS, MathTransform transform)Creates a coordinate operation from the given properties. The properties given in argument follow the same rules than for the super-class constructor. Additionally, the following properties are understood by this constructor: Recognized properties (non exhaustive list) Property name Value type Returned by "operationVersion"
PositionalAccuracy(optionally as array)
Defined in parent class (reminder) "name"
CharSequence(optionally as array)
Identifier(optionally as array)
ConstraintsAll arguments except
null. If non-null, the dimension of CRS arguments shall be related to the
transformargument as below:
- Dimension of
sourceCRSshall be equal to the transform source dimension minus the dimension of the
- Dimension of
targetCRSshall be equal to the transform target dimension, minus the dimension of the
interpolationCRSis non-null, then the given
transformshall expect input coordinates in the following order:
- Coordinates of the interpolation CRS. Example: (x,y) in a vertical transform.
- Coordinates of the source CRS. Example: (z) in a vertical transform.
properties- the properties to be given to the identified object.
sourceCRS- the source CRS, or
targetCRS- the target CRS, or
interpolationCRS- the CRS of additional coordinates needed for the operation, or
transform- transform from positions in the source CRS to positions in the target CRS, or
- Dimension of
(CoordinateOperation 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.
operation- the coordinate operation to copy.
- See Also:
castOrCopyReturns a SIS coordinate operation implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices:
- If the given object is
null, then this method returns
- Otherwise if the given object is an instance of
ConcatenatedOperation, then this method delegates to the
castOrCopy(…)method of the corresponding SIS subclass. Note that if the given object implements more than one of the above-cited interfaces, then the
castOrCopy(…)method to be used is unspecified.
- Otherwise if the given object is already an instance of
AbstractCoordinateOperation, then it is returned unchanged.
- Otherwise a new
AbstractCoordinateOperationinstance is created using the copy constructor and returned. Note that this is a shallow copy operation, since the other properties contained in the given object are not recursively copied.
object- the object to get as a SIS implementation, or
- a SIS implementation containing the values of the given object (may be the
given object itself), or
nullif the argument was null.
- If the given object is
getInterfaceReturns the GeoAPI interface implemented by this class. The default implementation returns
CoordinateOperation.class. Subclasses implementing a more specific GeoAPI interface shall override this method.
isDefiningConversionpublic boolean isDefiningConversion()Returns
trueif this coordinate operation is for the definition of a derived or projected CRS. The standard (ISO 19111) approach constructs defining conversion as an operation of type
Conversionwith null source and target CRS. But SIS supports also defining conversions with non-null CRS provided that:
GeneralDerivedCRS.getBaseCRS()is the source CRS of this operation, and
GeneralDerivedCRS.getConversionFromBase()is this operation instance.
true, the source and target CRS are not marshalled in XML documents.
trueif this coordinate operation is for the definition of a derived or projected CRS.
getSourceCRSpublic CoordinateReferenceSystem getSourceCRS()Returns the source CRS, or
nullif unspecified. The source CRS is mandatory for transformations only. This information is optional for conversions according the ISO 19111 standard, but Apache SIS tries to provide that CRS in most cases anyway.
getTargetCRSpublic CoordinateReferenceSystem getTargetCRS()Returns the target CRS, or
nullif unspecified. The target CRS is mandatory for transformations only. This information is optional for conversions according the ISO 19111 standard, but Apache SIS tries to provide that CRS in most cases anyway.
getInterpolationCRSpublic CoordinateReferenceSystem getInterpolationCRS()Returns the CRS which is neither the source CRS or target CRS but still required for performing the operation.Example: some transformations of vertical coordinates (h) require the horizontal coordinates (φ,λ) in order to interpolate in a grid. This method returns the CRS of the grid where such interpolations are performed.
- the CRS (neither source or target CRS) required for interpolating the values, or
getOperationVersionpublic String getOperationVersion()Returns the version of the coordinate operation. Different versions of a coordinate transformation may exist because of the stochastic nature of the parameters. In principle this property is irrelevant to coordinate conversions, but Apache SIS accepts it anyway.
getCoordinateOperationAccuracyReturns an estimation of the impact of this operation on point accuracy. The positional accuracy gives position error estimates for target coordinates of this coordinate operation, assuming no errors in source coordinates.
getLinearAccuracypublic double getLinearAccuracy()Returns an estimation of positional accuracy in metres, or
NaNif unknown. The default implementation tries to infer a value from the metadata returned by
getCoordinateOperationAccuracy()using SIS-specific heuristics.
Current implementationThe current implementation uses the heuristic rules listed below. Note that those rules may change in any future SIS version.
- If at least one quantitative result is found with a linear unit, then returns the largest result value converted to metres.
- Otherwise if the operation is a conversion, then returns 0 since a conversion is by definition accurate up to rounding errors.
- Otherwise if the operation is a transformation,
then checks if the datum shift were applied with the help of Bursa-Wolf parameters.
If a datum shift has been applied, returns 25 meters.
If a datum shift should have been applied but has been omitted, returns 3000 meters.
Note: the 3000 meters value is higher than the highest value (999 meters) found in the EPSG database version 6.7. The 25 meters value is the next highest value found in the EPSG database for a significant number of transformations.
- Otherwise if the operation is a concatenated operation,
returns the sum of the accuracy of all components.
This is a conservative scenario where we assume that errors cumulate linearly.
Note: this is not necessarily the "worst case" scenario since the accuracy could be worst if the math transforms are highly non-linear.
- the accuracy estimation (always in meters), or NaN if unknown.
- See Also:
getDomainOfValiditypublic Extent getDomainOfValidity()Returns the area or region or timeframe in which this coordinate operation is valid.
getScopepublic InternationalString getScope()Returns a description of domain of usage, or limitations of usage, for which this operation is valid.
getMathTransformpublic MathTransform getMathTransform()Returns the object for transforming coordinates in the source CRS to coordinates in the target CRS.
Use with interpolation CRSIf the interpolation CRS is non-null, then the math transform input coordinates shall by (interpolation, source) tuples: for each value to transform, the interpolation point coordinates shall be first, followed by the source coordinates.Example: in a transformation between two vertical CRS, if the source coordinates are (z) values but the coordinate operation additionally requires (x,y) values for interpolation purpose, then the math transform input coordinates shall be (x,y,z) tuples in that order.The interpolation coordinates will pass through the operation and appear in the math transform outputs, in the same order than inputs.
getWrapAroundChangesReturns the indices of target dimensions where "wrap around" may happen as a result of this coordinate operation. If such change exists, then this is usually the longitude axis when the source CRS uses the [-180 … +180]° range and the target CRS uses the [0 … 360]° range, or the converse. If there is no change, then this is an empty set.Inverse relationship: sometime the target dimensions returned by this method can be mapped directly to wraparound axes in source CRS, but this is not always the case. For example consider the following operation chain:source projected CRS ⟶ base CRS ⟶ target geographic CRSIn this example, a wraparound axis in the target CRS (the longitude) can be mapped to a wraparound axis in the base CRS. But there is no corresponding wraparound axis in the source CRS because the easting axis in projected CRS does not have a wraparound range meaning. We could argue that axis directions match, but such matching is not guaranteed to exist since
ProjectedCRSis a special case of
GeneralDerivedCRSand derived CRS can have rotations.
The default implementation infers this set by inspecting the source and target coordinate system axes. It returns the indices of all target axes having
RangeMeaning.WRAPAROUNDand for which the following condition holds: a colinear source axis exists with compatible unit of measurement, and the range (taking unit conversions in account) or range meaning of those source and target axes are not the same.
- indices of target dimensions where "wrap around" may happen as a result of this coordinate operation.
equalsCompares this coordinate operation with the specified object for equality. If the
BY_CONTRACT, then all available properties are compared including the domain of validity and the scope.
- Specified by:
object- the object to compare to
STRICTfor performing a strict comparison, or
IGNORE_METADATAfor ignoring properties that do not make a difference in the numerical results of coordinate operations.
trueif both objects are equal for the given comparison mode.
- See Also:
computeHashCodeprotected long computeHashCode()Invoked by
hashCode()for computing the hash code when first needed. See
AbstractIdentifiedObject.computeHashCode()for more information.
formatToFormats this coordinate operation in Well Known Text (WKT) version 2 format.
ESRI extensionCoordinate operations can not be formatted in standard WKT 1 format, but an ESRI variant of WKT 1 allows a subset of coordinate operations with the ESRI-specific
GEOGTRANkeyword. To enabled this variant,
WKTFormatcan be configured as below:
format = new WKTFormat(null, null); format.setConvention(Convention.WKT1_IGNORE_AXES); format.setNameAuthority(Citations.ESRI);