World Ocean Simulation System (WOSS) library
woss::BathyGebcoDb Class Reference

NetCDF specialization of WossNetcdfDb for GEBCO database. More...

#include <bathymetry-gebco-db.h>

Inheritance diagram for woss::BathyGebcoDb:
Inheritance graph
Collaboration diagram for woss::BathyGebcoDb:
Collaboration graph

Public Member Functions

 BathyGebcoDb (const ::std::string &name)
 
virtual bool insertValue (const Coord &coordinates, const Bathymetry &bathymetry_value)
 
virtual double getValue (const Coord &coords) const
 
virtual bool finalizeConnection ()
 
void setGebcoType (const GEBCO_BATHY_TYPE &type)
 
GEBCO_BATHY_TYPE getGebcoType ()
 
- Public Member Functions inherited from woss::WossNetcdfDb
 WossNetcdfDb (const ::std::string &name)
 
virtual bool openConnection ()
 
virtual bool closeConnection ()
 
- Public Member Functions inherited from woss::WossDb
 WossDb (const ::std::string &name)
 
void setDbName (const ::std::string &pathname)
 
::std::string getDbName () const
 
void setDebug (double flag=true)
 
bool isUsingDebug () const
 
virtual bool isValid ()
 
virtual bool openConnection ()=0
 
virtual bool finalizeConnection ()=0
 
virtual bool closeConnection ()=0
 
virtual bool insertValue (const Coord &coordinates, const Bathymetry &bathymetry_value)=0
 
virtual Bathymetry getValue (const Coord &coords) const =0
 

Protected Member Functions

long get1DBathyIndex (const Coord &coords) const
 
Gebco2DIndexes get2DBathyIndexes (const Coord &coords) const
 
- Protected Member Functions inherited from woss::WossDb
PathName getPathName (const ::std::string &complete_path)
 

Protected Attributes

GEBCO_BATHY_TYPE gebco_type
 
netCDF::NcVar bathy_var
 
NcVar * bathy_var
 
netCDF::NcVar lat_var
 
NcVar * lat_var
 
netCDF::NcVar lon_var
 
NcVar * lon_var
 
- Protected Attributes inherited from woss::WossNetcdfDb
netCDF::NcFile * netcdf_db
 
NcFile * netcdf_db
 
- Protected Attributes inherited from woss::WossDb
::std::string db_name
 
bool debug
 

Detailed Description

NetCDF specialization of WossNetcdfDb for GEBCO database.

NetCDF specialization of WossNetcdfDb for GEBCO database. It creates a NetCDF variable used to get requested bathymetry values

Constructor & Destructor Documentation

◆ BathyGebcoDb()

BathyGebcoDb::BathyGebcoDb ( const ::std::string &  name)

BathyGebcoDb constructor

Parameters
namepathname of database

References woss::GEBCO_2D_30_SECONDS_BATHY_TYPE.

Member Function Documentation

◆ finalizeConnection()

bool BathyGebcoDb::finalizeConnection ( )
virtual

Post openConnection() actions. It create and initializes a NetCDF variable

Returns
true if method was successful, false otherwise

Implements woss::WossDb.

References bathy_var, woss::WossDb::debug, woss::GEBCO_1D_1_MINUTE_BATHY_TYPE, woss::GEBCO_1D_30_SECONDS_BATHY_TYPE, gebco_type, lat_var, lon_var, and woss::WossNetcdfDb::netcdf_db.

◆ get1DBathyIndex()

long BathyGebcoDb::get1DBathyIndex ( const Coord coords) const
protected

Returns the GEBCO 1D index corresponding the given coordinates. This index will be used to access the NetCDF variable and thus retrieving the bathymetry value

Parameters
coordsconst reference to a valid Coord object
Returns
index value

References woss::GEBCO_1D_1_MINUTE_BATHY_TYPE, gebco_type, and woss::Coord::getLatitude().

Referenced by getValue().

Here is the call graph for this function:

◆ get2DBathyIndexes()

Gebco2DIndexes BathyGebcoDb::get2DBathyIndexes ( const Coord coords) const
protected

Returns the GEBCO 2D indexes corresponding the given coordinates. These indexes will be used to access the NetCDF variable and thus retrieving the bathymetry value

Parameters
coordsconst reference to a valid Coord object
Returns
Gebco2DIndexes value

References woss::GEBCO_2D_1_MINUTE_BATHY_TYPE, gebco_type, and woss::Coord::getLatitude().

Referenced by getValue().

Here is the call graph for this function:

◆ getGebcoType()

GEBCO_BATHY_TYPE woss::BathyGebcoDb::getGebcoType ( )
inline

Returns which GEBCO version is in use #return GEBCO_BATHY_TYPE instance

References gebco_type.

◆ getValue()

double BathyGebcoDb::getValue ( const Coord coords) const
virtual

Returns the positive depth value ( bathymetry ) of given coordinates, if present in the database. If given coordinates are on land ( original retrieved value is positive ) HUGE_VAL is returned.

Parameters
coordsconst reference to a valid Coord object
Returns
positive depth value [m] if coordinates are found, HUGE_VAL otherwise

Implements woss::WossBathymetryDb.

References bathy_var, woss::WossDb::debug, woss::GEBCO_1D_1_MINUTE_BATHY_TYPE, woss::GEBCO_1D_30_SECONDS_BATHY_TYPE, woss::GEBCO_2D_15_SECONDS_BATHY_TYPE, woss::GEBCO_2D_1_MINUTE_BATHY_TYPE, woss::GEBCO_2D_30_SECONDS_BATHY_TYPE, gebco_type, get1DBathyIndex(), get2DBathyIndexes(), woss::Coord::getLatitude(), lat_var, and lon_var.

Here is the call graph for this function:

◆ insertValue()

bool BathyGebcoDb::insertValue ( const Coord coordinates,
const Bathymetry &  bathymetry_value 
)
virtual

Inserts the given woss::Bathymetry value in the database for given coordinates

Parameters
coordinatesconst reference to a valid Coord object
bathymetry_valueconst reference to woss::Bathymetry value to be inserted
Returns
true if method was successful, false otherwise

Implements woss::WossBathymetryDb.

◆ setGebcoType()

void woss::BathyGebcoDb::setGebcoType ( const GEBCO_BATHY_TYPE type)
inline

Notify the database which GEBCO version is in use

Parameters
typeGEBCO_BATHY_TYPE instance

References gebco_type.

Referenced by woss::BathyGebcoDbCreator::createWossDb().

Member Data Documentation

◆ bathy_var

netCDF::NcVar woss::BathyGebcoDb::bathy_var
protected

NetCDF bathymetry variable

Referenced by finalizeConnection(), and getValue().

◆ gebco_type

GEBCO_BATHY_TYPE woss::BathyGebcoDb::gebco_type
protected

◆ lat_var

netCDF::NcVar woss::BathyGebcoDb::lat_var
protected

NetCDF latitude variable

Referenced by finalizeConnection(), and getValue().

◆ lon_var

netCDF::NcVar woss::BathyGebcoDb::lon_var
protected

NetCDF longitude variable

Referenced by finalizeConnection(), and getValue().


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