Class CoordinateReferenceProvider

java.lang.Object
com.luciad.geodesy.CoordinateReferenceProvider

public final class CoordinateReferenceProvider extends Object
Factory to create coordinate references from EPSG and OGC identifiers.
  • Method Details

    • create

      @NotNull public static CoordinateReference create(@NotNull String identifier) throws ParseException
      Creates the coordinate reference from a given EPSG, WKT (version 1) or OGC identifier.

      Supported EPSG codes

      A list of supported epsg references can be found here. A list of unsupported epsg references can be found here.

      Supported WKT strings

      This method supports decoding of WKT version 1 strings.

      Within this version of the standard, the following types of references are supported:

      • Geographic (aka geodetic) references: WKT strings that start with "GEOGCS"
      • Geocentric references: WKT strings that start with "GEOCCS"
      • Projected (aka grid) references: WKT strings that start with "PROJCS" or "FITTED_CS"
      • Topocentric references: WKT strings that start with ENGCRS and have a topocentric deriving conversion method with authority EPSG:9837.

      References with a vertical datum (strings that start with "COMPD_CS") are not supported.

      Example usage

      Creation of the WGS-84 coordinate reference system with an EPSG identifier.

          String identifier = "EPSG:4326";
          CoordinateReference crs = CoordinateReferenceProvider.create(identifier);
      

      Creation of the WGS-84 coordinate reference system with a WKT identifier.

          String identifier = "GEOGCS[\"WGS 84\",DATUM[\"World Geodetic System 1984\",SPHEROID[\"WGS 84\",6378137.0,298.257223563],TOWGS84[0.0,0.0,0.0]],PRIMEM[\"Greenwich\",0.0],UNIT[\"degree\",0.017453292519943295],AXIS[\"Geodetic latitude\",NORTH],AXIS[\"Geodetic longitude\",EAST],AUTHORITY[\"EPSG\",4326]]";
          CoordinateReference crs = CoordinateReferenceProvider.create(identifier);
      

      Creation of a topocentric reference based on the WGS-84 datum with a WKT identifier.

          String identifier = "ENGCRS[\"\",GEOGCS[\"WGS_1984\",DATUM[\"WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563],TOWGS84[0.0,0.0,0.0,0.0,0.0,0.0,0.0]]],DERIVINGCONVERSION[\"\",METHOD[\"Geographic/topocentric conversions\",AUTHORITY[\"EPSG\",9837]],PARAMETER[\"Latitude of topocentric origin\",50.7143019,UNIT[\"DEGREE\",0.017453292519943295]],PARAMETER[\"Longitude of topocentric origin\",21.310094,UNIT[\"DEGREE\",0.017453292519943295]],PARAMETER[\"Ellipsoidal height of topocentric origin\",275.0,UNIT[\"METER\",1.0]]],CS[Cartesian,3],AXIS[\"Topocentric East (E)\",EAST],AXIS[\"Topocentric North (N)\",NORTH],AXIS[\"Topocentric height (U)\",UP],UNIT[\"METER\",1.0]]";
          CoordinateReference crs = CoordinateReferenceProvider.create(identifier);
      

      Creation of the Web Mercator coordinate reference system with an OGC identifier.

          String identifier = "urn:ogc:def:crs:EPSG::3857";
          CoordinateReference crs = CoordinateReferenceProvider.create(identifier);
      
      Parameters:
      identifier - an EPSG, WKT (version 1) or OGC identifier, for example "EPSG:3857" or "urn:ogc:def:crs:EPSG::3857".
      Returns:
      the coordinate reference.
      Throws:
      ParseException - when the coordinate reference is not supported or cannot be parsed.