public class CrsRegistry extends Object
CoordinateReferenceSystems.
Currently, the registry is limited to EPSG-defined coordinate reference systems.
| Constructor and Description |
|---|
CrsRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static CoordinateReferenceSystem<?> |
computeIfAbsent(CrsId crsId,
Function<? super CrsId,? extends CoordinateReferenceSystem<? extends Position>> buildCrs)
Returns the registered coordinate reference system, or when unavailable in the registry, create a new reference system and register
it on-the-fly.
|
static CoordinateReferenceSystem<?> |
getCoordinateReferenceSystem(CrsId crsId,
CoordinateReferenceSystem<?> fallback)
returns the
CoordinateReferenceSystem for the specified CrsId |
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)
Returns the Geographic Coordinate Reference System for the specified EPSG
|
static ProjectedCoordinateReferenceSystem |
getProjectedCoordinateReferenceSystemForEPSG(int epsgCode)
Returns the Projected Coordinate Reference System for the specified EPSG
|
static boolean |
hasCoordinateReferenceSystemForEPSG(int epsgCode)
Determine if the registry contains the
CoordinateReferenceSystem identified by its SRID |
static CoordinateReferenceSystem<?> |
ifAbsentReturnGeographic2D(int epsgCode)
Returns the registered coordinate reference system, or when unavailable in the registry, create a new Geographic 2D system and register
this on-the-fly.
|
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.
|
static void |
registerCoordinateReferenceSystem(CoordinateReferenceSystem<?> crs)
Registers a
CoordinateReferenceSystem in the registry. |
static void |
registerCoordinateReferenceSystem(CrsId id,
CoordinateReferenceSystem<?> crs)
Registers a
CoordinateReferenceSystem in the registry under the specified (pseudo-)EPSG code. |
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<?> getCoordinateReferenceSystem(CrsId crsId, CoordinateReferenceSystem<?> fallback)
CoordinateReferenceSystem for the specified CrsIdcrsId - the identifier for the Coordinate Reference Systemfallback - the coordinate reference system to use, if the specified crsId is registeredCoordinateReferenceSystem 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 CoordinateReferenceSystem<?> ifAbsentReturnGeographic2D(int epsgCode)
epsgCode - the code to look uppublic static CoordinateReferenceSystem<?> computeIfAbsent(CrsId crsId, Function<? super CrsId,? extends CoordinateReferenceSystem<? extends Position>> buildCrs)
crsId - the CrsId for the Coordinate reference systembuildCrs - the function that builds a new Coordinate Reference System, if none is available in this RegistryCrsId identifierpublic static void registerCoordinateReferenceSystem(CoordinateReferenceSystem<?> crs)
CoordinateReferenceSystem in the registry.crs - the CoordinateReferenceSystem to registerpublic static void registerCoordinateReferenceSystem(CrsId id, CoordinateReferenceSystem<?> crs)
CoordinateReferenceSystem in the registry under the specified (pseudo-)EPSG code.id - the CrsId under which to register this CoordinateReferenceSystemcrs - the CoordinateReferenceSystem to registerpublic static boolean hasCoordinateReferenceSystemForEPSG(int epsgCode)
CoordinateReferenceSystem identified by its SRIDepsgCode - the SRID to look upCoordinateReferenceSystempublic static Geographic2DCoordinateReferenceSystem getGeographicCoordinateReferenceSystemForEPSG(int epsgCode)
epsgCode - the EPSG code for the reference systemRuntimeException - when the system is not geographicpublic static ProjectedCoordinateReferenceSystem getProjectedCoordinateReferenceSystemForEPSG(int epsgCode)
epsgCode - the EPSG code for the reference systemRuntimeException - when the system is not projectedpublic 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.Copyright © 2023 geolatte.org. All rights reserved.