Package mil.nga.proj

Class ProjectionRetriever


  • public class ProjectionRetriever
    extends Object
    Retrieves the proj4 projection parameter string for an authority and coordinate code
    Author:
    osbornb
    • Field Detail

      • PROJECTIONS_PROPERTY_FILE_PREFIX

        public static final String PROJECTIONS_PROPERTY_FILE_PREFIX
        Projections property file name prefix
        See Also:
        Constant Field Values
      • PROJECTIONS_PROPERTY_FILE_SUFFIX

        public static final String PROJECTIONS_PROPERTY_FILE_SUFFIX
        Projections property file name suffix
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProjectionRetriever

        public ProjectionRetriever()
    • Method Detail

      • getProjection

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

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

        public static String getProjection​(String authority,
                                           String code)
        Get the proj4 projection string for the authority coordinate code
        Parameters:
        authority - coordinate authority
        code - coordinate code
        Returns:
        proj4 projection
      • getOrCreateProjections

        public static Properties getOrCreateProjections​(String authority)
        Get or create the projection properties
        Parameters:
        authority - coordinate authority
        Returns:
        projection properties
      • getProjections

        public static Properties getProjections​(String authority)
        Get the projection properties for the authority
        Parameters:
        authority - coordinate authority
        Returns:
        projection properties
      • clear

        public static void clear()
        Clear the properties for all authorities
      • clear

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

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

        public static void clear​(String authority,
                                 String code)
        Clear the property for the authority code
        Parameters:
        authority - coordinate authority
        code - coordinate code
      • propertyFileName

        public static String propertyFileName​(String authority)
        Get the property file name for the authority

        Resulting File Name Format: "projections" .lower_case_authority."properties"

        Parameters:
        authority - coordinate authority
        Returns:
        property file name
      • setProjections

        public static void setProjections​(String authority,
                                          InputStream propertiesStream)
        Set the projections for the authority with the properties input stream
        Parameters:
        authority - coordinate authority
        propertiesStream - properties input stream
      • setProjections

        public static void setProjections​(String authority,
                                          Properties authorityProperties)
        Set the authority projections as the provided properties
        Parameters:
        authority - coordinate authority
        authorityProperties - authority projection properties
      • setProjections

        public static void setProjections​(String authority,
                                          File propertiesFile)
                                   throws FileNotFoundException
        Set the projections for the authority with the properties file
        Parameters:
        authority - coordinate authority
        propertiesFile - properties file
        Throws:
        FileNotFoundException - if properties file not found
      • setProjection

        public static void setProjection​(String authority,
                                         long code,
                                         String projection)
        Set the projection for the authority and code, creating the authority if needed
        Parameters:
        authority - coordinate authority
        code - coordinate code
        projection - proj4 projection
      • setProjection

        public static void setProjection​(String authority,
                                         String code,
                                         String projection)
        Set the projection for the authority and code, creating the authority if needed
        Parameters:
        authority - coordinate authority
        code - coordinate code
        projection - proj4 projection