Class CoordinateOperationFinder

java.lang.Object
org.apache.sis.referencing.operation.CoordinateOperationRegistry
org.apache.sis.referencing.operation.CoordinateOperationFinder

public class CoordinateOperationFinder extends CoordinateOperationRegistry
Finds a conversion or transformation path from a source CRS to a target CRS. This class implements two strategies for searching the coordinate operation:
  1. When createOperation(sourceCRS, targetCRS) is invoked, this class first tries to find the authority codes for the given source and target CRS. If such codes are found, they are submitted to a registry of coordinate operations. If an operation is found, it will be returned.
    Note: the above is known as the late-binding approach. The late-binding approach allows the authority to define better suited operations than what we would get if we were transforming everything from and to a pivot system (e.g. WGS84). In addition, this approach provides useful information like the coordinate operation scope and domain of validity, accuracy.
  2. If the above authority factory does not know about the specified CRS, then this class tries to infer the coordinate operation by itself. The CRS type is examined and the work is dispatched to one or many of the createOperationStep(…) protected methods defined in this class. Those methods use properties associated to the CRS, including BOUNDCRS or TOWGS84 elements found in Well Known Text (WKT).
    Note: the use of elements like TOWGS84 is known as the early-binding approach. The operation found by this approach may be sub-optimal. The early-binding approach is used only as a fallback when the late-binding approach gave no result.

Customization

Instances of this class are created by DefaultCoordinateOperationFactory. The only public method is createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem), which dispatches its work to the createOperationStep(…) protected methods. Developers can override those protected methods if they want to alter the way some operations are created.

Limitations

  • Each instance of this class shall be used only once.
  • This class is not thread-safe. A new instance shall be created for each coordinate operation to infer.
Since:
0.7
Version:
1.3
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<org.opengis.metadata.Identifier,Object>
    Identifiers used as the basis for identifier of CRS used as an intermediate step.
    private final Map<CRSPair,Boolean>
    The pair of source and target CRS for which we already searched a coordinate operation.
    private final boolean
    Whether this finder instance is allowed to use DefaultCoordinateOperationFactory.cache.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CoordinateOperationFinder(org.opengis.referencing.operation.CoordinateOperationAuthorityFactory registry, org.opengis.referencing.operation.CoordinateOperationFactory factory, CoordinateOperationContext context)
    Creates a new instance for the given factory and context.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static List<org.opengis.referencing.operation.CoordinateOperation>
    asList(org.opengis.referencing.operation.CoordinateOperation operation)
    Returns the given operation as a list of one element.
    private static boolean
    canHide(org.opengis.metadata.Identifier id)
    Returns true if a coordinate operation of the given name can be hidden in the list of operations.
    private static String
    canNotInvert(org.opengis.referencing.crs.GeneralDerivedCRS crs)
    Returns an error message for "Cannot invert operation XYZ.".
    private org.opengis.referencing.operation.CoordinateOperation
    concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2)
    Concatenates two operation steps.
    private org.opengis.referencing.operation.CoordinateOperation
    concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2, org.opengis.referencing.operation.CoordinateOperation step3)
    Concatenates three transformation steps.
    private org.opengis.referencing.crs.CoordinateReferenceSystem
    createCompoundCRS(org.opengis.referencing.crs.CoordinateReferenceSystem template, org.opengis.referencing.crs.CoordinateReferenceSystem[] components)
    Creates a compound CRS, but we special processing for (two-dimensional Geographic + ellipsoidal heights) tuples.
    private org.opengis.referencing.operation.CoordinateOperation
    createFromAffineTransform(org.opengis.metadata.Identifier name, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.Matrix matrix)
    Creates a coordinate operation from a matrix, which usually describes an affine transform.
    org.opengis.referencing.operation.CoordinateOperation
    createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
    Infers an operation for conversion or transformation between two coordinate reference systems.
    List<org.opengis.referencing.operation.CoordinateOperation>
    createOperations(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
    Infers operations for conversions or transformations between two coordinate reference systems.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, List<? extends org.opengis.referencing.crs.SingleCRS> sourceComponents, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, List<? extends org.opengis.referencing.crs.SingleCRS> targetComponents)
    Creates an operation between at least one CompoundCRS (usually the source) and an arbitrary CRS.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.GeneralDerivedCRS sourceCRS, org.opengis.referencing.crs.GeneralDerivedCRS targetCRS)
    Creates an operation between two derived coordinate reference systems.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.GeneralDerivedCRS sourceCRS, org.opengis.referencing.crs.SingleCRS targetCRS)
    Creates an operation from a derived CRS to an arbitrary single coordinate reference system.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.GeodeticCRS sourceCRS, org.opengis.referencing.crs.GeodeticCRS targetCRS)
    Creates an operation between two geodetic (geographic or geocentric) coordinate reference systems.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.GeodeticCRS sourceCRS, org.opengis.referencing.crs.VerticalCRS targetCRS)
    Creates an operation between a geodetic and a vertical coordinate reference systems.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.SingleCRS sourceCRS, org.opengis.referencing.crs.GeneralDerivedCRS targetCRS)
    Creates operations from an arbitrary single CRS to a derived coordinate reference system.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.TemporalCRS sourceCRS, org.opengis.referencing.crs.TemporalCRS targetCRS)
    Creates an operation between two temporal coordinate reference systems.
    protected List<org.opengis.referencing.operation.CoordinateOperation>
    createOperationStep(org.opengis.referencing.crs.VerticalCRS sourceCRS, org.opengis.referencing.crs.VerticalCRS targetCRS)
    Creates an operation between two vertical coordinate reference systems.
    private static Map<String,?>
    defaultName(org.opengis.referencing.crs.CoordinateReferenceSystem source, org.opengis.referencing.crs.CoordinateReferenceSystem target)
    Returns a name for a transformation between two CRS.
    private Map<String,?>
    derivedFrom(org.opengis.referencing.IdentifiedObject object)
    Returns a name for an object derived from the specified one.
    private static boolean
    isAffine(org.opengis.referencing.operation.CoordinateOperation operation)
    Returns true if the given operation is non-null and use the affine operation method.
    private static boolean
    isIdentity(org.opengis.referencing.operation.CoordinateOperation operation)
    Returns true if the specified operation is an identity conversion.
    private static String
    notFoundMessage(org.opengis.referencing.IdentifiedObject source, org.opengis.referencing.IdentifiedObject target)
    Returns an error message for "No path found from sourceCRS to targetCRS".
    private static Map<String,?>
    Returns the given name in a singleton map.

    Methods inherited from class org.apache.sis.referencing.operation.CoordinateOperationRegistry

    createFromMathTransform, inverse, properties, recoverableException, toAuthorityDefinition

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • identifierOfStepCRS

      private final Map<org.opengis.metadata.Identifier,Object> identifierOfStepCRS
      Identifiers used as the basis for identifier of CRS used as an intermediate step. The values can be of two kinds:
      • If the value is an instance of Integer, then this is the number of identifiers derived from the identifier associated to the key.
      • Otherwise the key is itself an Identifier derived from another identifier, and the value is that identifier.
      See Also:
    • previousSearches

      private final Map<CRSPair,Boolean> previousSearches
      The pair of source and target CRS for which we already searched a coordinate operation. This is used as a safety against infinite recursivity.
    • useCache

      private final boolean useCache
      Whether this finder instance is allowed to use DefaultCoordinateOperationFactory.cache.
  • Constructor Details

    • CoordinateOperationFinder

      public CoordinateOperationFinder(org.opengis.referencing.operation.CoordinateOperationAuthorityFactory registry, org.opengis.referencing.operation.CoordinateOperationFactory factory, CoordinateOperationContext context) throws org.opengis.util.FactoryException
      Creates a new instance for the given factory and context.
      Parameters:
      registry - the factory to use for creating operations as defined by authority, or null if none.
      factory - the factory to use for creating operations not found in the registry.
      context - the area of interest and desired accuracy, or null if none.
      Throws:
      org.opengis.util.FactoryException - if an error occurred while initializing this CoordinateOperationFinder.
      See Also:
  • Method Details

    • createOperation

      public org.opengis.referencing.operation.CoordinateOperation createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.referencing.operation.OperationNotFoundException, org.opengis.util.FactoryException
      Infers an operation for conversion or transformation between two coordinate reference systems. If a non-null authority factory – the registry – has been specified at construction time, then this method will first query that factory (late-binding approach – see class javadoc). If no operation has been found in the registry or if no registry has been specified to the constructor, this method inspects the given CRS and delegates the work to one or many createOperationStep(…) methods (early-binding approach).

      The default implementation invokes createOperations(sourceCRS, targetCRS), then returns the first operation in the returned list or throws an exception if the list is empty.

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.referencing.operation.OperationNotFoundException - if no operation path was found from sourceCRS to targetCRS.
      org.opengis.util.FactoryException - if the operation creation failed for some other reason.
    • createOperations

      public List<org.opengis.referencing.operation.CoordinateOperation> createOperations(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.util.FactoryException
      Infers operations for conversions or transformations between two coordinate reference systems. If a non-null authority factory – the registry – has been specified at construction time, then this method will first query that factory (late-binding approach – see class javadoc). If no operation has been found in the registry or if no registry has been specified to the constructor, this method inspects the given CRS and delegates the work to one or many createOperationStep(…) methods (early-binding approach).

      At first, this method is invoked with the sourceCRS and targetCRS arguments given to the CoordinateOperationFactory.createOperation(…) method. But then, this method may be invoked recursively by some createOperationStep(…) methods with different source or target CRS, for example in order to process the base geographic CRS of a projected CRS.

      Coordinate operations are returned in preference order: best operations for the area of interest should be first. The returned list is modifiable: callers can add, remove or set elements without impact on this CoordinateOperationFinder instance.

      Overrides:
      createOperations in class CoordinateOperationRegistry
      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      coordinate operations from sourceCRS to targetCRS.
      Throws:
      org.opengis.referencing.operation.OperationNotFoundException - if no operation path was found from sourceCRS to targetCRS.
      org.opengis.util.FactoryException - if the operation creation failed for some other reason.
      Since:
      1.0
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.SingleCRS sourceCRS, org.opengis.referencing.crs.GeneralDerivedCRS targetCRS) throws org.opengis.util.FactoryException
      Creates operations from an arbitrary single CRS to a derived coordinate reference system. Conversions from GeographicCRS to ProjectedCRS are also handled by this method, since projected CRS are a special kind of GeneralDerivedCRS.

      The default implementation constructs the following operation chain:

      sourceCRS → baseCRS → targetCRS
      where the conversion from baseCRS to targetCRS is obtained from targetCRS.getConversionFromBase().

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      coordinate operations from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.GeneralDerivedCRS sourceCRS, org.opengis.referencing.crs.SingleCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation from a derived CRS to an arbitrary single coordinate reference system. Conversions from ProjectedCRS to GeographicCRS are also handled by this method, since projected CRS are a special kind of GeneralDerivedCRS.

      The default implementation constructs the following operation chain:

      sourceCRS → baseCRS → targetCRS
      where the conversion from sourceCRS to baseCRS is obtained from the inverse of sourceCRS.getConversionFromBase().

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.GeneralDerivedCRS sourceCRS, org.opengis.referencing.crs.GeneralDerivedCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation between two derived coordinate reference systems. The default implementation performs three steps:
      1. Convert from sourceCRS to its base CRS.
      2. Convert the source base CRS to target base CRS.
      3. Convert from the target base CRS to the targetCRS.

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.GeodeticCRS sourceCRS, org.opengis.referencing.crs.GeodeticCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation between two geodetic (geographic or geocentric) coordinate reference systems. The default implementation can:
      • adjust axis order and orientation, for example converting from (North, West) axes to (East, North) axes,
      • apply units conversion if needed,
      • perform longitude rotation if needed,
      • perform datum shift if Bursa-Wolf parameters are available for the area of interest.

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.GeodeticCRS sourceCRS, org.opengis.referencing.crs.VerticalCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation between a geodetic and a vertical coordinate reference systems. The height returned by this method will usually be part of a pass-through operation.

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.VerticalCRS sourceCRS, org.opengis.referencing.crs.VerticalCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation between two vertical coordinate reference systems. The default implementation checks if both CRS use the same datum, then adjusts for axis direction and units.

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.TemporalCRS sourceCRS, org.opengis.referencing.crs.TemporalCRS targetCRS) throws org.opengis.util.FactoryException
      Creates an operation between two temporal coordinate reference systems. The default implementation checks if both CRS use the same datum, then adjusts for axis direction, units and epoch.

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      targetCRS - output coordinate reference system.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createOperationStep

      protected List<org.opengis.referencing.operation.CoordinateOperation> createOperationStep(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, List<? extends org.opengis.referencing.crs.SingleCRS> sourceComponents, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, List<? extends org.opengis.referencing.crs.SingleCRS> targetComponents) throws org.opengis.util.FactoryException
      Creates an operation between at least one CompoundCRS (usually the source) and an arbitrary CRS. The default implementation tries to invoke the createOperation(…) method with various combinations of source and target components. A preference is given for components of the same type (e.g. source GeodeticCRS with target GeodeticCRS, etc.).

      This method returns only one step for a chain of concatenated operations (to be built by the caller). But a list is returned because the same step may be implemented by different operation methods. Only one element in the returned list should be selected (usually the first one).

      Parameters:
      sourceCRS - input coordinate reference system.
      sourceComponents - components of the source CRS.
      targetCRS - output coordinate reference system.
      targetComponents - components of the target CRS.
      Returns:
      a coordinate operation from sourceCRS to targetCRS.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • createFromAffineTransform

      private org.opengis.referencing.operation.CoordinateOperation createFromAffineTransform(org.opengis.metadata.Identifier name, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.Matrix matrix) throws org.opengis.util.FactoryException
      Creates a coordinate operation from a matrix, which usually describes an affine transform. A default OperationMethod object is given to this transform. In the special case where the name identifier is CoordinateOperationRegistry.DATUM_SHIFT or CoordinateOperationRegistry.ELLIPSOID_CHANGE, the operation will be a Transformation instance instead of Conversion.
      Parameters:
      name - the identifier for the operation to be created.
      sourceCRS - the source coordinate reference system.
      targetCRS - the target coordinate reference system.
      matrix - the matrix which describe an affine transform operation.
      Returns:
      the conversion or transformation.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be created.
    • createCompoundCRS

      private org.opengis.referencing.crs.CoordinateReferenceSystem createCompoundCRS(org.opengis.referencing.crs.CoordinateReferenceSystem template, org.opengis.referencing.crs.CoordinateReferenceSystem[] components) throws org.opengis.util.FactoryException
      Creates a compound CRS, but we special processing for (two-dimensional Geographic + ellipsoidal heights) tuples. If any such tuple is found, a three-dimensional geographic CRS is created instead of the compound CRS.
      Parameters:
      template - the CRS from which to inherit properties.
      components - ordered array of CoordinateReferenceSystem objects.
      Returns:
      the coordinate reference system for the given properties.
      Throws:
      org.opengis.util.FactoryException - if the object creation failed.
      See Also:
    • concatenate

      private org.opengis.referencing.operation.CoordinateOperation concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2) throws org.opengis.util.FactoryException
      Concatenates two operation steps. The new concatenated operation gets an automatically generated name.

      Special case

      If one of the given operation steps performs a change of axis order or units, then that change will be merged with the other operation instead of creating an ConcatenatedOperation.
      Parameters:
      step1 - the first step, or null for the identity operation.
      step2 - the second step, or null for the identity operation.
      Returns:
      a concatenated operation, or null if all arguments were null.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • concatenate

      private org.opengis.referencing.operation.CoordinateOperation concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2, org.opengis.referencing.operation.CoordinateOperation step3) throws org.opengis.util.FactoryException
      Concatenates three transformation steps. If the first and/or the last operation is an CoordinateOperationRegistry.AXIS_CHANGES, then it will be included as part of the second operation instead of creating a ConcatenatedOperation. If a concatenated operation is created, it will get an automatically generated name.
      Parameters:
      step1 - the first step, or null for the identity operation.
      step2 - the second step, or null for the identity operation.
      step3 - the third step, or null for the identity operation.
      Returns:
      a concatenated operation, or null if all arguments were null.
      Throws:
      org.opengis.util.FactoryException - if the operation cannot be constructed.
    • isAffine

      private static boolean isAffine(org.opengis.referencing.operation.CoordinateOperation operation)
      Returns true if the given operation is non-null and use the affine operation method.
    • isIdentity

      private static boolean isIdentity(org.opengis.referencing.operation.CoordinateOperation operation)
      Returns true if the specified operation is an identity conversion. This method always returns false for transformations even if their associated math transform is an identity one, because such transformations are usually datum shift and must be visible.
    • canHide

      private static boolean canHide(org.opengis.metadata.Identifier id)
      Returns true if a coordinate operation of the given name can be hidden in the list of operations. Note that the MathTransform will still take the operation in account however.
    • properties

      private static Map<String,?> properties(String name)
      Returns the given name in a singleton map.
    • derivedFrom

      private Map<String,?> derivedFrom(org.opengis.referencing.IdentifiedObject object)
      Returns a name for an object derived from the specified one. This method builds a name of the form "<original identifier> (step 1)" where "(step 1)" may be replaced by "(step 2)", "(step 3)", etc. if this method has already been invoked for the same identifier (directly or indirectly).
    • defaultName

      private static Map<String,?> defaultName(org.opengis.referencing.crs.CoordinateReferenceSystem source, org.opengis.referencing.crs.CoordinateReferenceSystem target)
      Returns a name for a transformation between two CRS.
    • asList

      private static List<org.opengis.referencing.operation.CoordinateOperation> asList(org.opengis.referencing.operation.CoordinateOperation operation)
      Returns the given operation as a list of one element. We cannot use Collections.singletonList(Object) because the list needs to be modifiable, as required by createOperations(CoordinateReferenceSystem, CoordinateReferenceSystem) method contract.
    • notFoundMessage

      private static String notFoundMessage(org.opengis.referencing.IdentifiedObject source, org.opengis.referencing.IdentifiedObject target)
      Returns an error message for "No path found from sourceCRS to targetCRS". This is used for the construction of OperationNotFoundException.
      Parameters:
      source - the source CRS.
      target - the target CRS.
      Returns:
      a default error message.
    • canNotInvert

      private static String canNotInvert(org.opengis.referencing.crs.GeneralDerivedCRS crs)
      Returns an error message for "Cannot invert operation XYZ.". This is used for the construction of OperationNotFoundException.
      Parameters:
      crs - the CRS having a conversion that cannot be inverted.
      Returns:
      a default error message.