Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CoordinateReferenceSystem Class Reference
Collaboration diagram for duckdb::CoordinateReferenceSystem:

Public Member Functions

 CoordinateReferenceSystem (const string &definition)
 
CoordinateReferenceSystemType GetType () const
 Get the identified type of the coordinate reference system.
 
const string & GetDefinition () const
 Get the full provided definition of the coordinate reference system.
 
const string & GetIdentifier () const
 
bool IsComplete () const
 Is this a fully-defined coordinate system?
 
bool Equals (const CoordinateReferenceSystem &other) const
 
void Serialize (Serializer &serializer) const
 Serialize this CRS to a binary format.
 

Static Public Member Functions

static unique_ptr< CoordinateReferenceSystemTryIdentify (ClientContext &context, const string &source_crs)
 
static unique_ptr< CoordinateReferenceSystemTryConvert (ClientContext &context, const CoordinateReferenceSystem &source_crs, CoordinateReferenceSystemType target_type)
 
static unique_ptr< CoordinateReferenceSystemTryConvert (ClientContext &context, const string &source_crs, CoordinateReferenceSystemType target_type)
 
static CoordinateReferenceSystem Deserialize (Deserializer &deserializer)
 Deserialize a CRS from a binary format.
 

Static Private Member Functions

static void ParseDefinition (const string &text, CoordinateReferenceSystem &result)
 
static bool TryParseAuthCode (const string &text, CoordinateReferenceSystem &result)
 
static bool TryParseWKT2 (const string &text, CoordinateReferenceSystem &result)
 
static bool TryParsePROJJSON (const string &text, CoordinateReferenceSystem &result)
 

Private Attributes

CoordinateReferenceSystemType type = CoordinateReferenceSystemType::INVALID
 The type of the coordinate reference system.
 
string definition
 
string identifier
 

Friends

class CoordinateReferenceSystemProvider
 

Constructor & Destructor Documentation

◆ CoordinateReferenceSystem()

duckdb::CoordinateReferenceSystem::CoordinateReferenceSystem ( const string &  definition)
inlineexplicit
20456 {
20457 ParseDefinition(definition, *this);
20458 }
string definition
Definition duckdb.cpp:20544

Member Function Documentation

◆ GetType()

CoordinateReferenceSystemType duckdb::CoordinateReferenceSystem::GetType ( ) const
inline

Get the identified type of the coordinate reference system.

20461 {
20462 return type;
20463 }
CoordinateReferenceSystemType type
The type of the coordinate reference system.
Definition duckdb.cpp:20540
Here is the caller graph for this function:

◆ GetDefinition()

const string & duckdb::CoordinateReferenceSystem::GetDefinition ( ) const
inline

Get the full provided definition of the coordinate reference system.

20466 {
20467 return definition;
20468 }

◆ GetIdentifier()

const string & duckdb::CoordinateReferenceSystem::GetIdentifier ( ) const
inline

Get the "identifier" of the coordinate reference system (e.g. "EPSG:4326") This is the same as the definition for AUTH:CODE and SRID types

20472 {
20473 return identifier.empty() ? definition : identifier;
20474 }
string identifier
Definition duckdb.cpp:20548

◆ IsComplete()

bool duckdb::CoordinateReferenceSystem::IsComplete ( ) const
inline

Is this a fully-defined coordinate system?

20477 {
20478 switch (GetType()) {
20481 return true;
20482 default:
20483 return false;
20484 }
20485 }
CoordinateReferenceSystemType GetType() const
Get the identified type of the coordinate reference system.
Definition duckdb.cpp:20461
Here is the call graph for this function:

◆ Equals()

bool duckdb::CoordinateReferenceSystem::Equals ( const CoordinateReferenceSystem other) const
inline

Attempt to determine if this CRS is equivalent to another CRS This is currently not very precise, and may yield false negatives We consider two CRSs equal if one of the following is true:

  • Their identifiers match
  • Their type and full text definitions match, character-for-character
20492 {
20493 // Whatever the definitions are, if the identifiers match we consider them equal
20494 if (!identifier.empty() && identifier == other.identifier) {
20495 return true;
20496 }
20497
20498 // Fall back to comparing the full definitions
20499 // This is not ideal, because the same CRS (in the same format!) can often be expressed in multiple ways
20500 // E.g. field order, whitespace differences, casing, etc. But it's better than nothing for now.
20501
20502 // In the future we should:
20503 // 1. Implement proper normalization for each CRS format, and make _structured_ comparisons
20504 // 2. Allow extensions to inject a CRS handling library (e.g. PROJ) to perform proper _semantic_ comparisons
20505 return type == other.type && definition == other.definition;
20506 }

◆ TryIdentify()

static unique_ptr< CoordinateReferenceSystem > duckdb::CoordinateReferenceSystem::TryIdentify ( ClientContext context,
const string &  source_crs 
)
static

Try to identify a CRS from a string If the string is unable to be identified as one of the registered coordinates systems, and

  • IS NOT a complete CRS definition, returns nullptr
  • IS a complete CRS definition (e.g. PROJJSON or WKT2), returns the CRS as is. Otherwise, returns the identified CRS in the most compact form possible (AUTH:CODE > SRID > PROJJSON > WKT2)

◆ TryConvert() [1/2]

static unique_ptr< CoordinateReferenceSystem > duckdb::CoordinateReferenceSystem::TryConvert ( ClientContext context,
const CoordinateReferenceSystem source_crs,
CoordinateReferenceSystemType  target_type 
)
static

Try to convert the CRS to another format Returns nullptr if no conversion could be performed

◆ TryConvert() [2/2]

static unique_ptr< CoordinateReferenceSystem > duckdb::CoordinateReferenceSystem::TryConvert ( ClientContext context,
const string &  source_crs,
CoordinateReferenceSystemType  target_type 
)
static

Try to convert the CRS to another format Returns nullptr if no conversion could be performed

Member Data Documentation

◆ definition

string duckdb::CoordinateReferenceSystem::definition
private

The text definition of the coordinate reference system E.g. "AUTH:CODE", or a PROJJSON or WKT2 string

◆ identifier

string duckdb::CoordinateReferenceSystem::identifier
private

The identifier code of the coordinate reference system This can usually be derived from the text definition, but is cached here for convenience


The documentation for this class was generated from the following file: