LuciadCPillar 2023.1.04
luciad::CoordinateReferenceProvider Class Referencefinal

Factory to create coordinate references from EPSG and OGC identifiers. More...

#include <luciad/geodesy/CoordinateReferenceProvider.h>

Public Member Functions

 CoordinateReferenceProvider ()=delete
 
 ~CoordinateReferenceProvider ()=delete
 

Static Public Member Functions

static luciad::expected< std::shared_ptr< CoordinateReference >, ErrorInfocreate (const std::string &identifier)
 Creates the coordinate reference from a given EPSG, WKT (version 1) or OGC identifier. More...
 

Detailed Description

Factory to create coordinate references from EPSG and OGC identifiers.

Constructor & Destructor Documentation

◆ CoordinateReferenceProvider()

luciad::CoordinateReferenceProvider::CoordinateReferenceProvider ( )
delete

◆ ~CoordinateReferenceProvider()

luciad::CoordinateReferenceProvider::~CoordinateReferenceProvider ( )
delete

Member Function Documentation

◆ create()

static luciad::expected< std::shared_ptr< CoordinateReference >, ErrorInfo > luciad::CoordinateReferenceProvider::create ( const std::string &  identifier)
static

Creates the coordinate reference from a given EPSG, WKT (version 1) or OGC identifier.

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

Example usage:

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

std::string identifier = "EPSG:4326";
auto expected = CoordinateReferenceProvider::create(identifier);
const std::shared_ptr<CoordinateReference>& ptr = expected.value();
static luciad::expected< std::shared_ptr< CoordinateReference >, ErrorInfo > create(const std::string &identifier)
Creates the coordinate reference from a given EPSG, WKT (version 1) or OGC identifier.

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

std::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]]";
auto expected = CoordinateReferenceProvider::create(identifier);
const std::shared_ptr<CoordinateReference>& ptr = expected.value();

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

std::string identifier = "urn:ogc:def:crs:EPSG::3857";
auto expected = CoordinateReferenceProvider::create(identifier);
const std::shared_ptr<CoordinateReference>& ptr = expected.value();
Parameters
identifieran EPSG, WKT (version 1) or OGC identifier, for example "EPSG:3857" or "urn:ogc:def:crs:EPSG::3857".
Returns
an expected containing the coordinate reference. If the coordinate reference cannot be created, the expected contains an informational message.