Class AuthorityFactoryWrapper

  • All Implemented Interfaces:
    java.io.Serializable, org.opengis.metadata.Identifier, org.opengis.referencing.AuthorityFactory, org.opengis.referencing.crs.CRSAuthorityFactory, org.opengis.referencing.ReferenceIdentifier, org.opengis.util.Factory

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

      Fields 
      Modifier and Type Field Description
      (package private) CRSFactory 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
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AuthorityFactoryWrapper​(CRSFactory impl)
      Creates a new wrapper for the given PROJ4J implementation.
    • Field Detail

      • impl

        final CRSFactory impl
        The wrapped PROJ4 implementation.
    • Constructor Detail

      • AuthorityFactoryWrapper

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

      • wrap

        static AuthorityFactoryWrapper wrap​(CRSFactory impl)
        Wraps the given implementation.
        Parameters:
        impl - the implementation to wrap, or null
        Returns:
        the wrapper, or null if the given implementation was null
      • 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
      • getDescriptionText

        public org.opengis.util.InternationalString getDescriptionText​(java.lang.String code)
                                                                throws org.opengis.util.FactoryException
        Returns the name of the CRS for the given code. Usually, this method is for fetching the name without the cost of creating the full CRS. However, this implementation is inefficient in this regard.
        Specified by:
        getDescriptionText in interface org.opengis.referencing.AuthorityFactory
        Throws:
        org.opengis.util.FactoryException
      • createObject

        public org.opengis.referencing.IdentifiedObject createObject​(java.lang.String code)
                                                              throws org.opengis.util.FactoryException
        Generic method defined in parent interface.
        Specified by:
        createObject in interface org.opengis.referencing.AuthorityFactory
        Throws:
        org.opengis.util.FactoryException
      • createCoordinateReferenceSystem

        public org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem​(java.lang.String code)
                                                                                              throws org.opengis.util.FactoryException
        Creates a CRS from a code in the "AUTHORITY:CODE" syntax. If the authority is unspecified, then "EPSG" is assumed.
        Specified by:
        createCoordinateReferenceSystem in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Parameters:
        code - the authority (optional) and code of the CRS to create
        Returns:
        the CRS for the given code
        Throws:
        org.opengis.util.FactoryException - if the CRS cannot be created
      • createGeographicCRS

        public org.opengis.referencing.crs.GeographicCRS createGeographicCRS​(java.lang.String code)
                                                                      throws org.opengis.util.FactoryException
        Creates the CRS from the specified code and cast to a geographic CRS.
        Specified by:
        createGeographicCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Parameters:
        code - the authority (optional) and code of the CRS to create
        Returns:
        the CRS for the given code
        Throws:
        org.opengis.util.FactoryException - if the CRS cannot be created or is not geographic
      • createProjectedCRS

        public org.opengis.referencing.crs.ProjectedCRS createProjectedCRS​(java.lang.String code)
                                                                    throws org.opengis.util.FactoryException
        Creates the CRS from the specified code and cast to a projected CRS.
        Specified by:
        createProjectedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Parameters:
        code - the authority (optional) and code of the CRS to create
        Returns:
        the CRS for the given code
        Throws:
        org.opengis.util.FactoryException - if the CRS cannot be created or is not projected
      • createGeocentricCRS

        public org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS​(java.lang.String code)
                                                                      throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                             org.opengis.util.FactoryException
        Specified by:
        createGeocentricCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createVerticalCRS

        public org.opengis.referencing.crs.VerticalCRS createVerticalCRS​(java.lang.String code)
                                                                  throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                         org.opengis.util.FactoryException
        Specified by:
        createVerticalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createTemporalCRS

        public org.opengis.referencing.crs.TemporalCRS createTemporalCRS​(java.lang.String code)
                                                                  throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                         org.opengis.util.FactoryException
        Specified by:
        createTemporalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createEngineeringCRS

        public org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS​(java.lang.String code)
                                                                        throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                               org.opengis.util.FactoryException
        Specified by:
        createEngineeringCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createImageCRS

        public org.opengis.referencing.crs.ImageCRS createImageCRS​(java.lang.String code)
                                                            throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                   org.opengis.util.FactoryException
        Specified by:
        createImageCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createDerivedCRS

        public org.opengis.referencing.crs.DerivedCRS createDerivedCRS​(java.lang.String code)
                                                                throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                       org.opengis.util.FactoryException
        Specified by:
        createDerivedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.referencing.NoSuchAuthorityCodeException
        org.opengis.util.FactoryException
      • createCompoundCRS

        public org.opengis.referencing.crs.CompoundCRS createCompoundCRS​(java.lang.String code)
                                                                  throws org.opengis.util.FactoryException
        Specified by:
        createCompoundCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
        Throws:
        org.opengis.util.FactoryException
      • getAuthorityCodes

        public java.util.Set<java.lang.String> getAuthorityCodes​(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type)
                                                          throws org.opengis.util.FactoryException
        Specified by:
        getAuthorityCodes in interface org.opengis.referencing.AuthorityFactory
        Throws:
        org.opengis.util.FactoryException