Package mil.nga.proj

Class ProjectionFactory


  • public class ProjectionFactory
    extends Object
    Projection factory for coordinate projections and transformations
    Author:
    osbornb
    • Constructor Detail

      • ProjectionFactory

        public ProjectionFactory()
    • Method Detail

      • resetOrder

        public static void resetOrder()
        Reset the projection factory retrieval order to the default
      • getOrder

        public static Set<ProjectionFactoryType> getOrder()
        Get a copy of the projection factory retrieval order
        Returns:
        order set copy
      • getCachelessOrder

        public static Set<ProjectionFactoryType> getCachelessOrder()
        Get a copy of the projection factory retrieval order without caching
        Returns:
        order set copy without cache
      • removeOrderType

        public static boolean removeOrderType​(ProjectionFactoryType type)
        Remove the projection factory retrieval type from the retrieval ordering
        Parameters:
        type - retrieval type
        Returns:
        true if removed
      • setOrder

        public static void setOrder​(ProjectionFactoryType... types)
        Set the projection factory retrieval order
        Parameters:
        types - factory retrieval types
      • buildDefaultOrder

        public static Set<ProjectionFactoryType> buildDefaultOrder()
        Build a default order set for specified ordered projection retrievals without changing the global ordering
        Returns:
        projection factory retrieval order
      • buildOrder

        public static Set<ProjectionFactoryType> buildOrder​(ProjectionFactoryType... types)
        Build an order set for specified ordered projection retrievals without changing the global ordering
        Parameters:
        types - factory retrieval types
        Returns:
        projection factory retrieval order
      • getProjection

        public static Projection getProjection​(long epsg)
        Get the projection for the EPSG code
        Parameters:
        epsg - EPSG coordinate code
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(long epsg)
        Get the cacheless projection for the EPSG code
        Parameters:
        epsg - EPSG coordinate code
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String name)
        Get the projection for the projection name, expected as 'authority:code' or 'epsg_code'
        Parameters:
        name - projection name
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String name)
        Get the cacheless projection for the projection name, expected as 'authority:code' or 'epsg_code'
        Parameters:
        name - projection name
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               long code)
        Get the projection for authority and code
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        long code)
        Get the cacheless projection for authority and code
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               String code)
        Get the projection for authority and code
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        String code)
        Get the cacheless projection for authority and code
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               long code,
                                               String paramStr)
        Get the projection for authority, code, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        long code,
                                                        String paramStr)
        Get the cacheless projection for authority, code, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               String code,
                                               String paramStr)
        Get the projection for authority, code, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        String code,
                                                        String paramStr)
        Get the cacheless projection for authority, code, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               long code,
                                               String[] params)
        Get the projection for authority, code, and parameters
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        long code,
                                                        String[] params)
        Get the cacheless projection for authority, code, and parameters
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               String code,
                                               String[] params)
        Get the projection for authority, code, and parameters
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        String code,
                                                        String[] params)
        Get the cacheless projection for authority, code, and parameters
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        Returns:
        projection
      • getProjectionByDefinition

        public static Projection getProjectionByDefinition​(String authority,
                                                           long code,
                                                           String definition)
        Get the projection for the authority, code, and definition
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        definition - definition
        Returns:
        projection
      • getCachelessProjectionByDefinition

        public static Projection getCachelessProjectionByDefinition​(String authority,
                                                                    long code,
                                                                    String definition)
        Get the cacheless projection for the authority, code, and definition
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        definition - definition
        Returns:
        projection
      • getProjectionByDefinition

        public static Projection getProjectionByDefinition​(String authority,
                                                           String code,
                                                           String definition)
        Get the projection for the authority, code, and definition
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        definition - definition
        Returns:
        projection
      • getCachelessProjectionByDefinition

        public static Projection getCachelessProjectionByDefinition​(String authority,
                                                                    String code,
                                                                    String definition)
        Get the cacheless projection for the authority, code, and definition
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        definition - definition
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               long code,
                                               String[] params,
                                               String definition)
        Get the projection for the authority, code, definition, and custom parameter array
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        long code,
                                                        String[] params,
                                                        String definition)
        Get the cacheless projection for the authority, code, definition, and custom parameter array
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(String authority,
                                               String code,
                                               String paramStr,
                                               String definition)
        Get the projection for the authority, code, definition, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        definition - definition
        Returns:
        projection
        Since:
        1.1.0
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        String code,
                                                        String paramStr,
                                                        String definition)
        Get the cacheless projection for the authority, code, definition, and parameter string
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        paramStr - proj4 string
        definition - definition
        Returns:
        projection
        Since:
        1.1.0
      • getProjection

        public static Projection getProjection​(String authority,
                                               String code,
                                               String[] params,
                                               String definition)
        Get the projection for the authority, code, definition, and custom parameter array
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getCachelessProjection

        public static Projection getCachelessProjection​(String authority,
                                                        String code,
                                                        String[] params,
                                                        String definition)
        Get the cacheless projection for the authority, code, definition, and custom parameter array
        Parameters:
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(Set<ProjectionFactoryType> types,
                                               String authority,
                                               String code,
                                               String[] params,
                                               String definition)
        Get the projection for the authority, code, definition, and custom parameter array
        Parameters:
        types - projection factory retrieval types
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getProjection

        public static Projection getProjection​(ProjectionFactoryType type,
                                               String authority,
                                               String code,
                                               String[] params,
                                               String definition)
        Get the projection for the authority, code, definition, and custom parameter array
        Parameters:
        type - projection factory retrieval type
        authority - coordinate authority
        code - authority coordinate code
        params - proj4 params array
        definition - definition
        Returns:
        projection
      • getProjectionByDefinition

        public static Projection getProjectionByDefinition​(String definition)
        Get the projection for the definition
        Parameters:
        definition - definition
        Returns:
        projection
      • getCachelessProjectionByDefinition

        public static Projection getCachelessProjectionByDefinition​(String definition)
        Get the cacheless projection for the definition
        Parameters:
        definition - definition
        Returns:
        projection
      • getProjectionByParams

        public static Projection getProjectionByParams​(String paramStr)
        Get the projection for the params
        Parameters:
        paramStr - proj4 string
        Returns:
        projection
        Since:
        1.1.0
      • getProjectionByParams

        public static Projection getProjectionByParams​(String[] params)
        Get the projection for the params
        Parameters:
        params - proj4 params array
        Returns:
        projection
        Since:
        1.1.0
      • getProjections

        public static Projections getProjections()
        Get the projections
        Returns:
        projections
      • getProjections

        public static AuthorityProjections getProjections​(String authority)
        Get the projections for the authority
        Parameters:
        authority - coordinate authority
        Returns:
        authority projections
      • parseAuthorityAndCode

        public static String[] parseAuthorityAndCode​(String name)
        Parse a projection name, expected as 'authority:code' or 'epsg_code', into an authority and code
        Parameters:
        name - projection name
        Returns:
        [authority, code]
      • buildParameters

        public static String[] buildParameters​(String paramStr)
        Build a proj4 parameters array from a proj4 string
        Parameters:
        paramStr - proj4 string
        Returns:
        proj4 params array
      • clear

        public static void clear()
        Clear all authority projections
      • clear

        public static void clear​(String authority)
        Clear the authority projections
        Parameters:
        authority - coordinate authority
      • clear

        public static void clear​(String authority,
                                 long code)
        Clear the authority projection code
        Parameters:
        authority - coordinate authority
        code - coordinate code
      • clear

        public static void clear​(String authority,
                                 String code)
        Clear the authority projection code
        Parameters:
        authority - coordinate authority
        code - coordinate code