Package mil.nga.proj
Class ProjectionFactory
- java.lang.Object
-
- mil.nga.proj.ProjectionFactory
-
public class ProjectionFactory extends Object
Projection factory for coordinate projections and transformations- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description ProjectionFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<ProjectionFactoryType>buildDefaultOrder()Build a default order set for specified ordered projection retrievals without changing the global orderingstatic Set<ProjectionFactoryType>buildOrder(ProjectionFactoryType... types)Build an order set for specified ordered projection retrievals without changing the global orderingstatic String[]buildParameters(String paramStr)Build a proj4 parameters array from a proj4 stringstatic voidclear()Clear all authority projectionsstatic voidclear(String authority)Clear the authority projectionsstatic voidclear(String authority, long code)Clear the authority projection codestatic voidclear(String authority, String code)Clear the authority projection codestatic Set<ProjectionFactoryType>getCachelessOrder()Get a copy of the projection factory retrieval order without cachingstatic ProjectiongetCachelessProjection(long epsg)Get the cacheless projection for the EPSG codestatic ProjectiongetCachelessProjection(String name)Get the cacheless projection for the projection name, expected as 'authority:code' or 'epsg_code'static ProjectiongetCachelessProjection(String authority, long code)Get the cacheless projection for authority and codestatic ProjectiongetCachelessProjection(String authority, long code, String paramStr)Get the cacheless projection for authority, code, and parameter stringstatic ProjectiongetCachelessProjection(String authority, long code, String[] params)Get the cacheless projection for authority, code, and parametersstatic ProjectiongetCachelessProjection(String authority, long code, String[] params, String definition)Get the cacheless projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetCachelessProjection(String authority, String code)Get the cacheless projection for authority and codestatic ProjectiongetCachelessProjection(String authority, String code, String paramStr)Get the cacheless projection for authority, code, and parameter stringstatic ProjectiongetCachelessProjection(String authority, String code, String[] params)Get the cacheless projection for authority, code, and parametersstatic ProjectiongetCachelessProjection(String authority, String code, String[] params, String definition)Get the cacheless projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetCachelessProjection(String authority, String code, String paramStr, String definition)Get the cacheless projection for the authority, code, definition, and parameter stringstatic ProjectiongetCachelessProjectionByDefinition(String definition)Get the cacheless projection for the definitionstatic ProjectiongetCachelessProjectionByDefinition(String authority, long code, String definition)Get the cacheless projection for the authority, code, and definitionstatic ProjectiongetCachelessProjectionByDefinition(String authority, String code, String definition)Get the cacheless projection for the authority, code, and definitionstatic Set<ProjectionFactoryType>getOrder()Get a copy of the projection factory retrieval orderstatic ProjectiongetProjection(long epsg)Get the projection for the EPSG codestatic ProjectiongetProjection(String name)Get the projection for the projection name, expected as 'authority:code' or 'epsg_code'static ProjectiongetProjection(String authority, long code)Get the projection for authority and codestatic ProjectiongetProjection(String authority, long code, String paramStr)Get the projection for authority, code, and parameter stringstatic ProjectiongetProjection(String authority, long code, String[] params)Get the projection for authority, code, and parametersstatic ProjectiongetProjection(String authority, long code, String[] params, String definition)Get the projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetProjection(String authority, String code)Get the projection for authority and codestatic ProjectiongetProjection(String authority, String code, String paramStr)Get the projection for authority, code, and parameter stringstatic ProjectiongetProjection(String authority, String code, String[] params)Get the projection for authority, code, and parametersstatic ProjectiongetProjection(String authority, String code, String[] params, String definition)Get the projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetProjection(String authority, String code, String paramStr, String definition)Get the projection for the authority, code, definition, and parameter stringstatic ProjectiongetProjection(Set<ProjectionFactoryType> types, String authority, String code, String[] params, String definition)Get the projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetProjection(ProjectionFactoryType type, String authority, String code, String[] params, String definition)Get the projection for the authority, code, definition, and custom parameter arraystatic ProjectiongetProjectionByDefinition(String definition)Get the projection for the definitionstatic ProjectiongetProjectionByDefinition(String authority, long code, String definition)Get the projection for the authority, code, and definitionstatic ProjectiongetProjectionByDefinition(String authority, String code, String definition)Get the projection for the authority, code, and definitionstatic ProjectiongetProjectionByParams(String paramStr)Get the projection for the paramsstatic ProjectiongetProjectionByParams(String[] params)Get the projection for the paramsstatic ProjectionsgetProjections()Get the projectionsstatic AuthorityProjectionsgetProjections(String authority)Get the projections for the authoritystatic String[]parseAuthorityAndCode(String name)Parse a projection name, expected as 'authority:code' or 'epsg_code', into an authority and codestatic booleanremoveOrderType(ProjectionFactoryType type)Remove the projection factory retrieval type from the retrieval orderingstatic voidresetOrder()Reset the projection factory retrieval order to the defaultstatic voidsetOrder(ProjectionFactoryType... types)Set the projection factory retrieval order
-
-
-
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 authoritycode- 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 authoritycode- authority coordinate code- Returns:
- projection
-
getProjection
public static Projection getProjection(String authority, String code)
Get the projection for authority and code- Parameters:
authority- coordinate authoritycode- 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 authoritycode- 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 authoritycode- authority coordinate codeparamStr- 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 authoritycode- authority coordinate codeparamStr- 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 authoritycode- authority coordinate codeparamStr- 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 authoritycode- authority coordinate codeparamStr- 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 authoritycode- authority coordinate codeparams- 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 authoritycode- authority coordinate codeparams- 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 authoritycode- authority coordinate codeparams- 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 authoritycode- authority coordinate codeparams- 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 authoritycode- authority coordinate codedefinition- 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 authoritycode- authority coordinate codedefinition- 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 authoritycode- authority coordinate codedefinition- 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 authoritycode- authority coordinate codedefinition- 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 authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 authoritycode- authority coordinate codeparamStr- proj4 stringdefinition- 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 authoritycode- authority coordinate codeparamStr- proj4 stringdefinition- 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 authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 typesauthority- coordinate authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 typeauthority- coordinate authoritycode- authority coordinate codeparams- proj4 params arraydefinition- 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 authoritycode- coordinate code
-
-