MeteoIODoc 20240504.aefd3c94
mio::iCSV Namespace Reference

Classes

struct  fieldsSection
 Stores Information on the FIELDS section of a iCSV file. More...
 
struct  geoLocation
 Represents a geographic location extracted from iCSV files. (POINT(X Y)...) More...
 
class  iCSVFile
 This class is responsible for handling and storing iCSV files. More...
 
struct  MetaDataSection
 Stores information on the METADATA section of a iCSV file. More...
 

Functions

static void custom_assert (const std::string &value, const std::string &asssert_val)
 
static bool isValidFirstLine (const std::string &firstline)
 
static std::vector< double > extractMatches (const std::string &match)
 Extracts values out of geometry strings. More...
 
static geoLocation processGeometryRegexes (const std::string &geometry, const std::regex &reg, const bool &has_Z)
 process geometry strings to return a geoLocation object. More...
 
static std::string extractEpsgCode (const std::string &epsgStr)
 Extracts the EPSG code from a string in the format "EPSG:XXXX". More...
 
static bool isValidEpsgCode (const std::string &epsgStr)
 
std::vector< double > convertVector (const std::vector< std::string > &vec)
 
std::vector< CoordsconvertVector (const std::vector< geoLocation > &vec, const int &epsg)
 
geoLocation toiCSVLocation (Coords loc, const int &epsg)
 
geoLocation extractCoordinates (const std::string &geometry)
 extracts a geoLocation object out of a WKT geometry string. More...
 
bool operator== (const geoLocation &lhs, const geoLocation &rhs)
 
bool operator!= (const geoLocation &lhs, const geoLocation &rhs)
 
bool operator== (const MetaDataSection &lhs, const MetaDataSection &rhs)
 
bool roughlyEqual (const MetaDataSection &lhs, const MetaDataSection &rhs)
 Checks if two MetaDataSection objects are roughly equal. More...
 
MetaDataSectionoperator+= (MetaDataSection &lhs, const MetaDataSection &rhs)
 
bool operator== (const fieldsSection &lhs, const fieldsSection &rhs)
 
bool roughlyEqual (const fieldsSection &lhs, const fieldsSection &rhs)
 Checks if two fieldsSection objects are roughly equal. More...
 
fieldsSectionoperator+= (fieldsSection &lhs, const fieldsSection &rhs)
 

Function Documentation

◆ convertVector() [1/2]

std::vector< Coords > mio::iCSV::convertVector ( const std::vector< geoLocation > &  vec,
const int &  epsg 
)

◆ convertVector() [2/2]

std::vector< double > mio::iCSV::convertVector ( const std::vector< std::string > &  vec)

Converts a vector of strings to a vector of doubles.

Parameters
vecThe vector of strings to be converted.
Returns
The converted vector of doubles.

◆ custom_assert()

static void mio::iCSV::custom_assert ( const std::string &  value,
const std::string &  asssert_val 
)
static

◆ extractCoordinates()

geoLocation mio::iCSV::extractCoordinates ( const std::string &  geometry)

extracts a geoLocation object out of a WKT geometry string.

Parameters
[in]geometryWKT geometry string
Returns
the matching geoLocation object

◆ extractEpsgCode()

static std::string mio::iCSV::extractEpsgCode ( const std::string &  epsgStr)
static

Extracts the EPSG code from a string in the format "EPSG:XXXX".

Parameters
epsgStrThe string containing the EPSG code.
Returns
The extracted EPSG code as a string.

◆ extractMatches()

static std::vector< double > mio::iCSV::extractMatches ( const std::string &  match)
static

Extracts values out of geometry strings.

◆ isValidEpsgCode()

static bool mio::iCSV::isValidEpsgCode ( const std::string &  epsgStr)
static

◆ isValidFirstLine()

static bool mio::iCSV::isValidFirstLine ( const std::string &  firstline)
static

Checks if the first line of iCSV data is conforming to the standard.

Parameters
firstlineThe first line of iCSV data.
Returns
True if the first line is valid, false otherwise.

◆ operator!=()

bool mio::iCSV::operator!= ( const geoLocation lhs,
const geoLocation rhs 
)

◆ operator+=() [1/2]

fieldsSection & mio::iCSV::operator+= ( fieldsSection lhs,
const fieldsSection rhs 
)

◆ operator+=() [2/2]

MetaDataSection & mio::iCSV::operator+= ( MetaDataSection lhs,
const MetaDataSection rhs 
)

◆ operator==() [1/3]

bool mio::iCSV::operator== ( const fieldsSection lhs,
const fieldsSection rhs 
)

◆ operator==() [2/3]

bool mio::iCSV::operator== ( const geoLocation lhs,
const geoLocation rhs 
)

◆ operator==() [3/3]

bool mio::iCSV::operator== ( const MetaDataSection lhs,
const MetaDataSection rhs 
)

◆ processGeometryRegexes()

static geoLocation mio::iCSV::processGeometryRegexes ( const std::string &  geometry,
const std::regex &  reg,
const bool &  has_Z 
)
static

process geometry strings to return a geoLocation object.

For Now only returs the last point in the geometry string.

◆ roughlyEqual() [1/2]

bool mio::iCSV::roughlyEqual ( const fieldsSection lhs,
const fieldsSection rhs 
)

Checks if two fieldsSection objects are roughly equal.

Parameters
lhsThe first MetaDataSection object.
rhsThe second MetaDataSection object.
Returns
true if the objects are roughly equal, false otherwise.

◆ roughlyEqual() [2/2]

bool mio::iCSV::roughlyEqual ( const MetaDataSection lhs,
const MetaDataSection rhs 
)

Checks if two MetaDataSection objects are roughly equal.

Parameters
lhsThe first MetaDataSection object.
rhsThe second MetaDataSection object.
Returns
true if the objects are roughly equal, false otherwise.

◆ toiCSVLocation()

geoLocation mio::iCSV::toiCSVLocation ( Coords  loc,
const int &  epsg 
)

Converts the given Coords object to a geoLocation object.

Parameters
[in]locThe Coords object to convert.
[in]epsgEPSG code of the provided coordinates
Returns
The converted geoLocation object.