World Ocean Simulation System (WOSS) library
|
Specialization of WossTextualDb for UTM CSV database. More...
#include <bathymetry-utm-csv-db.h>
Public Member Functions | |
BathyUtmCsvDb (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 | setCSVSeparator (const char new_separator) |
const char | getCSVSeparator () const |
void | setDbSpacing (double spacing) |
double | getDbSpacing () const |
void | setDbTotalValues (int nnorth, int neast) |
std::pair< int, int > | getDbTotalValues () const |
void | setDbRangeEasting (double start, double end) |
std::pair< double, double > | getDbRangeEasting () const |
void | setDbRangeNorthing (double start, double end) |
std::pair< double, double > | getDbRangeNorthing () const |
void | setLandApproximationFlag (bool flag) |
bool | getLandApproximationFlag () |
Public Member Functions inherited from woss::WossTextualDb | |
WossTextualDb (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 () |
Protected Member Functions | |
int | getBathyIndex (const Coord &coords) const |
virtual bool | importData () |
Protected Member Functions inherited from woss::WossDb | |
PathName | getPathName (const ::std::string &complete_path) |
Protected Attributes | |
std::vector< double > | bathy_vec |
char | separator |
double | db_spacing |
int | total_northing_values |
int | total_easting_values |
double | range_easting_start |
double | range_easting_end |
double | range_northing_start |
double | range_northing_end |
bool | approx_land_to_sea_surface |
Protected Attributes inherited from woss::WossTextualDb | |
::std::fstream | textual_db |
Protected Attributes inherited from woss::WossDb | |
::std::string | db_name |
bool | debug |
Static Protected Attributes | |
static const double | land_approximation_depth = 0.000000001 |
Specialization of WossTextualDb for UTM CSV database.
Specialization of WossTextualDb for UTM CSV database. It creates a vector used to get requested bathymetry values.
BathyUtmCsvDb::BathyUtmCsvDb | ( | const ::std::string & | name | ) |
BathyUtmCsvDb constructor
name | pathname of database |
|
virtual |
Post openConnection() actions. It create and initializes a NetCDF variable
Implements woss::WossDb.
References importData().
|
protected |
Returns the index corresponding the given coordinates. This index will be used to access the vector variable and thus retrieving the bathymetry value
coords | const reference to a valid Coord object |
References db_spacing, woss::WossDb::debug, woss::UtmWgs84::getUtmWgs84FromCoord(), range_easting_end, range_easting_start, range_northing_end, range_northing_start, and total_easting_values.
Referenced by getValue().
|
inline |
|
inline |
Returns the current db range easting
References range_easting_end, and range_easting_start.
|
inline |
Returns the current db range northing
References range_northing_end, and range_northing_start.
|
inline |
Returns the current db spatial resolution
References db_spacing.
|
inline |
Returns the total northing and easting values
References total_easting_values, and total_northing_values.
|
inline |
Returns the current land approximation flag
References approx_land_to_sea_surface.
|
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.
coords | const reference to a valid Coord object |
Implements woss::WossBathymetryDb.
References approx_land_to_sea_surface, bathy_vec, woss::WossDb::debug, getBathyIndex(), and land_approximation_depth.
|
protectedvirtual |
Imports data from .csv file and store depth values in the bathy_vec
References bathy_vec, woss::WossDb::db_name, woss::WossDb::debug, separator, and woss::WossTextualDb::textual_db.
Referenced by finalizeConnection().
|
virtual |
Inserts the given woss::Bathymetry value in the database for given coordinates
coordinates | const reference to a valid Coord object |
bathymetry_value | const reference to woss::Bathymetry value to be inserted |
Implements woss::WossBathymetryDb.
|
inline |
Sets the char separator used in CSV textual db
new_separator | separator char |
References separator.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
inline |
Sets db range easting start and end
start | easting range start |
end | easting range end |
References range_easting_end, and range_easting_start.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
inline |
Sets db northing range start and end
start | northing range start |
end | northing range end |
References range_northing_end, and range_northing_start.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
inline |
Sets db resolution, in meters
spacing | space resolution in meters |
References db_spacing.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
inline |
Sets the db total northing and easting values
nnorth | db total northing points. should be >= 0 |
neast | db total easting points. should be >= 0 |
References total_easting_values, and total_northing_values.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
inline |
Sets land approximation flag
flag | land approximation flag |
References approx_land_to_sea_surface.
Referenced by woss::BathyUtmCsvDbCreator::createWossDb().
|
protected |
Approximate land db points to sea surface
Referenced by getLandApproximationFlag(), getValue(), and setLandApproximationFlag().
|
protected |
Vector with bathymetry values
Referenced by getValue(), and importData().
|
protected |
spatial spacing of the db, in meters
Referenced by getBathyIndex(), getDbSpacing(), and setDbSpacing().
|
staticprotected |
Depth value for land approximation
Referenced by getValue().
|
protected |
Separator used in the csv file
Referenced by getBathyIndex(), getDbRangeEasting(), and setDbRangeEasting().
|
protected |
Separator used in the csv file
Referenced by getBathyIndex(), getDbRangeEasting(), and setDbRangeEasting().
|
protected |
Separator used in the csv file
Referenced by getBathyIndex(), getDbRangeNorthing(), and setDbRangeNorthing().
|
protected |
Separator used in the csv file
Referenced by getBathyIndex(), getDbRangeNorthing(), and setDbRangeNorthing().
|
protected |
Separator used in the csv file
Referenced by getCSVSeparator(), importData(), and setCSVSeparator().
|
protected |
Separator used in the csv file
Referenced by getBathyIndex(), getDbTotalValues(), and setDbTotalValues().
|
protected |
Separator used in the csv file
Referenced by getDbTotalValues(), and setDbTotalValues().