World Ocean Simulation System (WOSS) library
bathymetry-utm-csv-db.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 2025 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - WOSS@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
32#ifndef WOSS_BATHYMETRY_UTM_CSV_DB_H
33#define WOSS_BATHYMETRY_UTM_CSV_DB_H
34
35#include <vector>
36#include <utility>
37#include "woss-db.h"
38
39namespace woss {
40
48 public:
49
55 BathyUtmCsvDb( const std::string& name );
56
57 virtual ~BathyUtmCsvDb() override = default;
58
59
67 virtual bool insertValue( const Coord& coordinates, const Bathymetry& bathymetry_value ) override;
68
76 virtual Bathymetry getValue( const Coord& coords ) const override;
77
78
84 virtual bool finalizeConnection() override;
85
91 void setCSVSeparator( const char new_separator ) { separator = new_separator; }
92
98 const char getCSVSeparator() const { return separator; }
99
105 void setDbSpacing( double spacing ) { db_spacing = spacing; }
106
112 double getDbSpacing() const { return db_spacing; }
113
120 void setDbTotalValues(int nnorth, int neast) {
121 total_northing_values = nnorth;
122 total_easting_values = neast;
123 }
124
130 std::pair<int, int> getDbTotalValues() const {
131 return std::make_pair(total_northing_values, total_easting_values);
132 }
133
140 void setDbRangeEasting(double start, double end) {
141 range_easting_start = start;
142 range_easting_end = end;
143 }
144
150 std::pair<double, double> getDbRangeEasting() const {
151 return std::make_pair(range_easting_start, range_easting_end);
152 }
153
160 void setDbRangeNorthing(double start, double end) {
161 range_northing_start = start;
162 range_northing_end = end;
163 }
164
170 std::pair<double, double> getDbRangeNorthing() const {
171 return std::make_pair( range_northing_start, range_northing_end);
172 }
173
178 void setLandApproximationFlag(bool flag) {
180 }
181
190
191 protected:
192
200 int getBathyIndex( const Coord& coords ) const;
201
207 virtual bool importData();
208
209
210 std::vector<double> bathy_vec;
214 double db_spacing;
230 static const double land_approximation_depth;
231 };
232
233}
234
235#endif /* WOSS_BATHYMETRY_UTM_CSV_DB_H */
236
237
238
Specialization of WossTextualDb for UTM CSV database.
Definition bathymetry-utm-csv-db.h:47
double range_easting_start
Definition bathymetry-utm-csv-db.h:220
const char getCSVSeparator() const
Definition bathymetry-utm-csv-db.h:98
void setDbSpacing(double spacing)
Definition bathymetry-utm-csv-db.h:105
void setDbTotalValues(int nnorth, int neast)
Definition bathymetry-utm-csv-db.h:120
std::vector< double > bathy_vec
Definition bathymetry-utm-csv-db.h:210
void setCSVSeparator(const char new_separator)
Definition bathymetry-utm-csv-db.h:91
void setLandApproximationFlag(bool flag)
Definition bathymetry-utm-csv-db.h:178
bool getLandApproximationFlag()
Definition bathymetry-utm-csv-db.h:187
virtual Bathymetry getValue(const Coord &coords) const override
Definition bathymetry-utm-csv-db.cpp:63
virtual bool importData()
Definition bathymetry-utm-csv-db.cpp:130
int total_northing_values
Definition bathymetry-utm-csv-db.h:216
double range_northing_start
Definition bathymetry-utm-csv-db.h:224
static const double land_approximation_depth
Definition bathymetry-utm-csv-db.h:230
virtual bool finalizeConnection() override
Definition bathymetry-utm-csv-db.cpp:52
void setDbRangeEasting(double start, double end)
Definition bathymetry-utm-csv-db.h:140
virtual ~BathyUtmCsvDb() override=default
std::pair< double, double > getDbRangeNorthing() const
Definition bathymetry-utm-csv-db.h:170
virtual bool insertValue(const Coord &coordinates, const Bathymetry &bathymetry_value) override
Definition bathymetry-utm-csv-db.cpp:57
void setDbRangeNorthing(double start, double end)
Definition bathymetry-utm-csv-db.h:160
bool approx_land_to_sea_surface
Definition bathymetry-utm-csv-db.h:228
char separator
Definition bathymetry-utm-csv-db.h:212
double range_northing_end
Definition bathymetry-utm-csv-db.h:226
double db_spacing
Definition bathymetry-utm-csv-db.h:214
double range_easting_end
Definition bathymetry-utm-csv-db.h:222
int getBathyIndex(const Coord &coords) const
Definition bathymetry-utm-csv-db.cpp:91
double getDbSpacing() const
Definition bathymetry-utm-csv-db.h:112
std::pair< int, int > getDbTotalValues() const
Definition bathymetry-utm-csv-db.h:130
int total_easting_values
Definition bathymetry-utm-csv-db.h:218
std::pair< double, double > getDbRangeEasting() const
Definition bathymetry-utm-csv-db.h:150
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:98
Data behaviour class for bathymetry database.
Definition woss-db.h:265
Textual implementation of WossDb.
Definition woss-db.h:224
Definition ac-toolbox-arr-asc-reader.h:44
double Bathymetry
Definition definitions.h:44
Provides the interface for woss::WossDb class.