Package mil.nga.proj
Class ProjectionRetriever
- java.lang.Object
-
- mil.nga.proj.ProjectionRetriever
-
public class ProjectionRetriever extends Object
Retrieves the proj4 projection parameter string for an authority and coordinate code- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROJECTIONS_PROPERTY_FILE_PREFIX
Projections property file name prefixstatic String
PROJECTIONS_PROPERTY_FILE_SUFFIX
Projections property file name suffix
-
Constructor Summary
Constructors Constructor Description ProjectionRetriever()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Clear the properties for all authoritiesstatic void
clear(String authority)
Clear the properties for the authoritystatic void
clear(String authority, long code)
Clear the property for the authority codestatic void
clear(String authority, String code)
Clear the property for the authority codestatic Properties
getOrCreateProjections(String authority)
Get or create the projection propertiesstatic String
getProjection(long epsg)
Get the proj4 projection string for the EPSG coordinate codestatic String
getProjection(String authority, long code)
Get the proj4 projection string for the authority coordinate codestatic String
getProjection(String authority, String code)
Get the proj4 projection string for the authority coordinate codestatic Properties
getProjections(String authority)
Get the projection properties for the authoritystatic String
propertyFileName(String authority)
Get the property file name for the authoritystatic void
setProjection(String authority, long code, String projection)
Set the projection for the authority and code, creating the authority if neededstatic void
setProjection(String authority, String code, String projection)
Set the projection for the authority and code, creating the authority if neededstatic void
setProjections(String authority, File propertiesFile)
Set the projections for the authority with the properties filestatic void
setProjections(String authority, InputStream propertiesStream)
Set the projections for the authority with the properties input streamstatic void
setProjections(String authority, Properties authorityProperties)
Set the authority projections as the provided properties
-
-
-
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
-
-
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 authoritycode
- 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 authoritycode
- 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 authoritycode
- coordinate code
-
clear
public static void clear(String authority, String code)
Clear the property for the authority code- Parameters:
authority
- coordinate authoritycode
- coordinate code
-
propertyFileName
public static String propertyFileName(String authority)
Get the property file name for the authorityResulting 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 authoritypropertiesStream
- properties input stream
-
setProjections
public static void setProjections(String authority, Properties authorityProperties)
Set the authority projections as the provided properties- Parameters:
authority
- coordinate authorityauthorityProperties
- 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 authoritypropertiesFile
- 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 authoritycode
- coordinate codeprojection
- proj4 projection
-
-