Class ManyCoordinateOperationFactory

All Implemented Interfaces:
Factory, ObjectFactory, CoordinateOperationFactory, Factory, RegistrableFactory

public class ManyCoordinateOperationFactory extends DefaultCoordinateOperationFactory
A CoordinateOperationFactory that delegates to multiple underlying factories, returning the first set of results it finds from any of them.
  • Constructor Details

    • ManyCoordinateOperationFactory

      public ManyCoordinateOperationFactory(Hints hints)
  • Method Details

    • createFromDatabase

      protected CoordinateOperation createFromDatabase(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS)
      Description copied from class: DefaultCoordinateOperationFactory
      If the coordinate operation is explicitly defined in some database (typically EPSG), returns it. Otherwise (if there is no database, or if the database doesn't contains an explicit operation from sourceCRS to targetCRS, or if this method failed to create an operation from the database), returns null.

      The default implementation always returns null, since there is no database connected to a DefaultCoordinateOperationFactory instance. In other words, the default implementation is "standalone": it tries to figure out transformation paths by itself. Subclasses should override this method if they can fetch a more accurate operation from some database. The mean subclass doing so is AuthorityBackedFactory.

      This method is invoked by createOperation(sourceCRS, targetCRS) before to try to figure out a transformation path by itself. It is also invoked by various createOperationStep(...) methods when an intermediate CRS was obtained by GeneralDerivedCRS.getBaseCRS() (this case occurs especially during geographic from/to projected CRS operations). This method is not invoked for synthetic CRS generated by createOperationStep(...), since those temporary CRS are not expected to exist in a database.

      Overrides:
      createFromDatabase in class DefaultCoordinateOperationFactory
      Parameters:
      sourceCRS - Input coordinate reference system.
      targetCRS - Output coordinate reference system.
      Returns:
      A coordinate operation from sourceCRS to targetCRS if and only if one is explicitly defined in some underlying database, or null otherwise.
    • findFromDatabase

      public Set<CoordinateOperation> findFromDatabase(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, int limit)
      Description copied from class: DefaultCoordinateOperationFactory
      Returns a list of available coordinate operations explicitly defined in some database (typically EPSG), for the provided CRS pair. Otherwise (if there is no database, or if the database doesn't contains any explicit operation from sourceCRS to targetCRS, or if this method failed to create the operations from the database), returns an empty Set.

      The default implementation always returns an empty Set, since there is no database connected to a DefaultCoordinateOperationFactory instance. In other words, the default implementation is "standalone": it tries to figure out transformation paths by itself. Subclasses should override this method if they can fetch a more accurate operation from some database. The mean subclass doing so is AuthorityBackedFactory.

      This method is invoked by findOperations(sourceCRS, targetCRS) before to try to figure out a transformation path by itself. It is also invoked by various findOperationSteps(...) methods when an intermediate CRS was obtained by GeneralDerivedCRS.getBaseCRS() (this case occurs especially during geographic from/to projected CRS operations). This method is not invoked for synthetic CRS generated by createOperationStep(...), since those temporary CRS are not expected to exist in a database.

      Specified by:
      findFromDatabase in interface CoordinateOperationFactory
      Overrides:
      findFromDatabase in class DefaultCoordinateOperationFactory
      Parameters:
      sourceCRS - Input coordinate reference system.
      targetCRS - Output coordinate reference system.
      limit - The maximum number of operations to be returned. Use -1 to return all the available operations. Use 1 to return just one operations. Currently, the behavior for other values of limit is undefined.
      Returns:
      A set of coordinate operations from sourceCRS to targetCRS if and only if one is explicitly defined in some underlying database, or an empty Set otherwise.