public class CrsRegistry
extends java.lang.Object
CoordinateReferenceSystems.
Currently, the registry is limited to EPSG-defined coordinate reference systems.
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.Integer,CrsId> |
crsIdMap |
private static java.util.concurrent.ConcurrentHashMap<java.lang.Integer,CoordinateReferenceSystem<? extends Position>> |
crsMap |
private static java.lang.String |
DELIM |
private static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
CrsRegistry() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
addDefinition(java.lang.String line,
CrsWktDecoder decoder) |
private static java.io.BufferedReader |
createReader() |
static CoordinateReferenceSystem<?> |
getCoordinateReferenceSystemForEPSG(int epsgCode,
CoordinateReferenceSystem<?> fallback)
returns the
CoordinateReferenceSystem for the specified EPSG code. |
static CrsId |
getCrsIdForEPSG(int epsgCode)
Returns the
CrsId for the specified EPSG Code. |
static Geographic2DCoordinateReferenceSystem |
getGeographicCoordinateReferenceSystemForEPSG(int epsgCode) |
static ProjectedCoordinateReferenceSystem |
getProjectedCoordinateReferenceSystemForEPSG(int epsgCode) |
static boolean |
hasCoordinateReferenceSystemForEPSG(int epsgCode)
Determine if the registry contains the
CoordinateReferenceSystem identified by its SRID |
static CoordinateReferenceSystem<?> |
ifAbsentReturnProjected2D(int epsgCode)
Returns the registered coordinate reference system, or when unavailable in the registry, create a new Projected 2D system and register
this on-the-fly.
|
private static void |
loadCRS() |
static void |
registerCoordinateReferenceSystem(CoordinateReferenceSystem<?> crs)
Registers a
CoordinateReferenceSystem in the registry under the specified (pseudo-)EPSG code. |
private static final org.slf4j.Logger LOGGER
private static final java.util.concurrent.ConcurrentHashMap<java.lang.Integer,CoordinateReferenceSystem<? extends Position>> crsMap
private static final java.util.Map<java.lang.Integer,CrsId> crsIdMap
private static final java.lang.String DELIM
private static void loadCRS()
throws java.io.IOException
java.io.IOExceptionprivate static java.io.BufferedReader createReader()
private static void addDefinition(java.lang.String line,
CrsWktDecoder decoder)
public static CoordinateReferenceSystem<?> getCoordinateReferenceSystemForEPSG(int epsgCode, CoordinateReferenceSystem<?> fallback)
CoordinateReferenceSystem for the specified EPSG code.epsgCode - the EPSG codefallback - the coordinateCoordinateReferenceSystem corresponding to the specified EPSG code, or null if
no such system is registered.public static CoordinateReferenceSystem<?> ifAbsentReturnProjected2D(int epsgCode)
epsgCode - the code to look uppublic static void registerCoordinateReferenceSystem(CoordinateReferenceSystem<?> crs)
CoordinateReferenceSystem in the registry under the specified (pseudo-)EPSG code.crs - the CoordinateReferenceSystem to registerpublic static boolean hasCoordinateReferenceSystemForEPSG(int epsgCode)
CoordinateReferenceSystem identified by its SRIDepsgCode - the SRID to look upCoordinateReferenceSystempublic static Geographic2DCoordinateReferenceSystem getGeographicCoordinateReferenceSystemForEPSG(int epsgCode)
public static ProjectedCoordinateReferenceSystem getProjectedCoordinateReferenceSystemForEPSG(int epsgCode)
public static CrsId getCrsIdForEPSG(int epsgCode)
CrsId for the specified EPSG Code.epsgCode - the EPSG codeCrsId corresponding to the specified EPSG code, or null if
no such system is registered.