Class AuthorityBackedFactory

    • Constructor Detail

      • AuthorityBackedFactory

        public AuthorityBackedFactory()
        Creates a new factory backed by a default EPSG authority factory. This factory will uses a priority slightly higher than the default (standalone) factory.
      • AuthorityBackedFactory

        public AuthorityBackedFactory​(Hints userHints)
        Creates a new factory backed by an authority factory fetched using the specified hints. This constructor recognizes the CRS, CS, DATUM and MATH_TRANSFORM FACTORY hints.
        Parameters:
        userHints - The hints, or null if none.
    • Method Detail

      • createFromDatabase

        protected CoordinateOperation createFromDatabase​(CoordinateReferenceSystem sourceCRS,
                                                         CoordinateReferenceSystem targetCRS)
        Returns an operation for conversion or transformation between two coordinate reference systems. The default implementation extracts the authority code from the supplied sourceCRS and targetCRS, and submit them to the createFromCoordinateReferenceSystemCodes(sourceCode, targetCode) methods. If no operation is found for those codes, then this method returns null.

        Note that this method may be invoked recursively. For example no operation may be available from the underlying authority factory between two compound CRS, but an operation may be available between two components of those compound CRS.

        Overrides:
        createFromDatabase in class DefaultCoordinateOperationFactory
        Parameters:
        sourceCRS - Input coordinate reference system.
        targetCRS - Output coordinate reference system.
        Returns:
        A coordinate operation from sourceCRS to targetCRS, or null if no such operation is explicitly defined in the underlying database.
        Since:
        2.3
      • validateCandidate

        protected CoordinateOperation validateCandidate​(CoordinateOperation candidate,
                                                        CoordinateReferenceSystem sourceCRS,
                                                        CoordinateReferenceSystem targetCRS,
                                                        boolean inverse)
        Selects a valid operation from a set of candidates. Currently, it returns the first operation which is a valid transformation from the sourceCRS to targetCRs and that is accepted by this authority.
        Parameters:
        candidate - A set of candidate operations
        sourceCRS - Source CRS
        targetCRS - Target CRS
        inverse - whether the inverse operation has to be applied
      • findFromDatabase

        protected Set<CoordinateOperation> findFromDatabase​(CoordinateReferenceSystem sourceCRS,
                                                            CoordinateReferenceSystem targetCRS,
                                                            int limit)
        Returns the list of available operations for conversion or transformation between two coordinate reference systems. The default implementation extracts the authority code from the supplied sourceCRS and targetCRS, and submit them to the createFromCoordinateReferenceSystemCodes(sourceCode, targetCode) methods. If no operation is found for those codes, then this method returns an empty Set.

        Note that this method may be invoked recursively. For example no operation may be available from the underlying authority factory between two compound CRS, but an operation may be available between two components of those compound CRS.

        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 operation. Currently, the behavior for other values of limit is undefined.
        Returns:
        A set of coordinate operations from sourceCRS to targetCRS, or an empty Set if no operation is explicitly defined in the underlying database for that CRS pair.
        Since:
        19
      • accept

        protected boolean accept​(CoordinateOperation operation)
        Returns true if the specified operation is acceptable. This method is invoked automatically by createFromDatabase(...) for every operation candidates found. The default implementation returns always true. Subclasses should override this method if they wish to filter the coordinate operations to be returned.
        Since:
        2.3