public final class Projections extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Projections.ProjectionDefinition
Class to hold information about one projection.
|
Modifier and Type | Field and Description |
---|---|
private static Set<String> |
allCodes |
private static Map<String,ProjectionChoice> |
allProjectionChoicesByCode |
(package private) static Map<String,Datum> |
datums |
(package private) static Map<String,Ellipsoid> |
ellipsoids |
(package private) static Map<String,Projections.ProjectionDefinition> |
inits |
(package private) static Map<String,NTV2GridShiftFileWrapper> |
nadgrids |
private static Map<String,Projection> |
projectionsByCode_cache |
(package private) static Map<String,ProjFactory> |
projs
Registry for custom projection
should be compatible to PROJ.4
|
Modifier | Constructor and Description |
---|---|
private |
Projections() |
Modifier and Type | Method and Description |
---|---|
static Collection<String> |
getAllProjectionCodes()
Get a list of all supported projection codes.
|
static Proj |
getBaseProjection(String id) |
static Datum |
getDatum(String id) |
static Ellipsoid |
getEllipsoid(String id) |
static String |
getInit(String id)
Get the projection definition string for the given id.
|
static NTV2GridShiftFileWrapper |
getNTV2Grid(String id) |
static Projection |
getProjectionByCode(String code) |
static LatLon |
inverseProject(EastNorth en) |
static String |
listDatums()
Replies the list of datums as string (comma separated).
|
static String |
listEllipsoids()
Replies the list of ellipsoids as string (comma separated).
|
private static String |
listKeys(Map<String,?> map) |
static String |
listNadgrids()
Replies the list of nadgrids as string (comma separated).
|
static String |
listProjs()
Replies the list of projections as string (comma separated).
|
static List<Projections.ProjectionDefinition> |
loadProjectionDefinitions(BufferedReader r)
Load projection definitions from file.
|
static List<Projections.ProjectionDefinition> |
loadProjectionDefinitions(String path)
Load projection definitions from file.
|
static EastNorth |
project(LatLon ll) |
static void |
registerBaseProjection(String id,
Class<? extends Proj> projClass,
String origin) |
static void |
registerBaseProjection(String id,
ProjFactory fac,
String origin)
Plugins can register additional base projections.
|
private static final Map<String,ProjectionChoice> allProjectionChoicesByCode
private static final Map<String,Projection> projectionsByCode_cache
static final Map<String,ProjFactory> projs
static final Map<String,Ellipsoid> ellipsoids
static final Map<String,NTV2GridShiftFileWrapper> nadgrids
static final Map<String,Projections.ProjectionDefinition> inits
private Projections()
public static LatLon inverseProject(EastNorth en)
public static void registerBaseProjection(String id, ProjFactory fac, String origin)
id
- The "official" PROJ.4 id. In case the projection is not supported
by PROJ.4, use some prefix, e.g. josm:myproj or gdal:otherproj.fac
- The base projection factory.origin
- Multiple plugins may implement the same base projection.
Provide plugin name or similar string, so it be differentiated.public static void registerBaseProjection(String id, Class<? extends Proj> projClass, String origin)
public static Proj getBaseProjection(String id)
public static Ellipsoid getEllipsoid(String id)
public static NTV2GridShiftFileWrapper getNTV2Grid(String id)
public static String getInit(String id)
id
- the idpublic static List<Projections.ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException
path
- the pathIOException
- in case of I/O errorpublic static List<Projections.ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException
r
- the readerIOException
- in case of I/O errorpublic static Projection getProjectionByCode(String code)
public static Collection<String> getAllProjectionCodes()
getProjectionByCode(java.lang.String)
public static String listProjs()
public static String listEllipsoids()
public static String listDatums()
public static String listNadgrids()