Class OperationFactoryWrapper

  • All Implemented Interfaces:
    java.io.Serializable, org.opengis.metadata.Identifier, org.opengis.referencing.ObjectFactory, org.opengis.referencing.operation.CoordinateOperationFactory, org.opengis.referencing.ReferenceIdentifier, org.opengis.util.Factory

    final class OperationFactoryWrapper
    extends Wrapper
    implements org.opengis.referencing.operation.CoordinateOperationFactory, java.io.Serializable
    Wraps a PROJ4J implementation behind the equivalent GeoAPI interface.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) CoordinateTransformFactory impl
      The wrapped PROJ4 implementation.
      • Fields inherited from interface org.opengis.metadata.Identifier

        AUTHORITY_KEY, CODE_KEY
      • Fields inherited from interface org.opengis.referencing.ReferenceIdentifier

        CODESPACE_KEY, VERSION_KEY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opengis.referencing.operation.CoordinateOperation createConcatenatedOperation​(java.util.Map<java.lang.String,​?> properties, org.opengis.referencing.operation.CoordinateOperation... operations)  
      org.opengis.referencing.operation.Conversion createDefiningConversion​(java.util.Map<java.lang.String,​?> properties, org.opengis.referencing.operation.OperationMethod method, org.opengis.parameter.ParameterValueGroup parameters)  
      org.opengis.referencing.operation.CoordinateOperation createOperation​(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
      Creates a coordinate operation between the given pair of CRSs.
      org.opengis.referencing.operation.CoordinateOperation createOperation​(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.OperationMethod method)
      Creates a coordinate operation between the given pair of CRSs, ignoring the given method.
      java.lang.String getCode()
      {@return the factory name}.
      org.opengis.metadata.citation.Citation getVendor()
      {@return an identification of the softwware that provides the CRS definitions}.
      (package private) java.lang.Object implementation()
      {@return the PROJ4J backing implementation}.
      private static CoordinateReferenceSystem unwrap​(java.lang.String name, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
      Returns the given CRS as a PROJ4J implementation.
      (package private) static OperationFactoryWrapper wrap​(CoordinateTransformFactory impl)
      Wraps the given implementation.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • OperationFactoryWrapper

        private OperationFactoryWrapper​(CoordinateTransformFactory impl)
        Creates a new wrapper for the given PROJ4J implementation.
    • Method Detail

      • implementation

        java.lang.Object implementation()
        {@return the PROJ4J backing implementation}.
        Specified by:
        implementation in class Wrapper
      • getCode

        public java.lang.String getCode()
        {@return the factory name}.
        Specified by:
        getCode in interface org.opengis.metadata.Identifier
        Specified by:
        getCode in class Wrapper
      • getVendor

        public org.opengis.metadata.citation.Citation getVendor()
        {@return an identification of the softwware that provides the CRS definitions}. This is not the authority (EPSG, ESRI, etc).
        Specified by:
        getVendor in interface org.opengis.util.Factory
      • unwrap

        private static CoordinateReferenceSystem unwrap​(java.lang.String name,
                                                        org.opengis.referencing.crs.CoordinateReferenceSystem crs)
        Returns the given CRS as a PROJ4J implementation. This method avoids loading the Importer class when the given CRS is a PROJ4J wrapper.
        Parameters:
        name - "source" or "target", in case an error message needs to be produced
        crs - the CRS to unwrap
        Returns:
        the PROJ4J object for the given CRS.
      • createOperation

        public org.opengis.referencing.operation.CoordinateOperation createOperation​(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
                                                                                     org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
                                                                              throws org.opengis.util.FactoryException
        Creates a coordinate operation between the given pair of CRSs.
        Specified by:
        createOperation in interface org.opengis.referencing.operation.CoordinateOperationFactory
        Parameters:
        sourceCRS - the source coordinate reference system
        targetCRS - the target coordinate reference system
        Returns:
        coordinate operation from source to target
        Throws:
        org.opengis.util.FactoryException - if the operation cannot be created
      • createOperation

        public org.opengis.referencing.operation.CoordinateOperation createOperation​(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
                                                                                     org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
                                                                                     org.opengis.referencing.operation.OperationMethod method)
                                                                              throws org.opengis.util.FactoryException
        Creates a coordinate operation between the given pair of CRSs, ignoring the given method.
        Specified by:
        createOperation in interface org.opengis.referencing.operation.CoordinateOperationFactory
        Parameters:
        sourceCRS - the source coordinate reference system
        targetCRS - the target coordinate reference system
        method - ignored
        Returns:
        coordinate operation from source to target
        Throws:
        org.opengis.util.FactoryException - if the operation cannot be created
      • createConcatenatedOperation

        public org.opengis.referencing.operation.CoordinateOperation createConcatenatedOperation​(java.util.Map<java.lang.String,​?> properties,
                                                                                                 org.opengis.referencing.operation.CoordinateOperation... operations)
                                                                                          throws org.opengis.util.FactoryException
        Specified by:
        createConcatenatedOperation in interface org.opengis.referencing.operation.CoordinateOperationFactory
        Throws:
        org.opengis.util.FactoryException
      • createDefiningConversion

        public org.opengis.referencing.operation.Conversion createDefiningConversion​(java.util.Map<java.lang.String,​?> properties,
                                                                                     org.opengis.referencing.operation.OperationMethod method,
                                                                                     org.opengis.parameter.ParameterValueGroup parameters)
                                                                              throws org.opengis.util.FactoryException
        Specified by:
        createDefiningConversion in interface org.opengis.referencing.operation.CoordinateOperationFactory
        Throws:
        org.opengis.util.FactoryException