MeteoIODoc 20260811.aeb9aef5
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
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 bool isValidFirstLine (const std::string &firstline)
 
static std::vector< double > extractMatches (const std::string &match)
 Extracts numeric coordinates from a geometry string.
 
static geoLocation extractLastPointFromGeometry (const std::string &geometry, const std::regex &pattern, const bool &has_Z)
 Extracts the last point from a WKT geometry string.
 
static std::string extractEpsgCode (const std::string &epsgStr)
 Extracts the EPSG code from a string in the format "EPSG:XXXX".
 
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 from a WKT geometry string.
 
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.
 
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.
 
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.

◆ extractCoordinates()

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

Extracts a geoLocation object from a WKT geometry string.

Parameters
geometryWKT geometry string (e.g., "POINT(1 2)", "POINTZ(1 2 3)")
Returns
The matching geoLocation object, or empty if no match found.

◆ 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.

◆ extractLastPointFromGeometry()

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

Extracts the last point from a WKT geometry string.

Parameters
geometryThe WKT geometry string (e.g., "POINT(1 2)" or "POINTZ(1 2 3)").
patternThe compiled regex pattern to match the geometry type.
has_ZWhether the geometry includes a Z (elevation) coordinate.
Returns
geoLocation containing the last point's coordinates, or empty if parse fails.

◆ extractMatches()

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

Extracts numeric coordinates from a geometry string.

Parameters
matchThe string to extract coordinates from.
Returns
Vector of extracted numeric values.

◆ 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.
Exceptions
InvalidFormatExceptionif the header values don't match the expected iCSV format.

◆ 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 
)

◆ 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.