World Ocean Simulation System (WOSS) library
bathymetry-utm-csv-db.h
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@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
22/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
39#ifndef WOSS_BATHYMETRY_UTM_CSV_DB_H
40#define WOSS_BATHYMETRY_UTM_CSV_DB_H
41
42#include "woss-db.h"
43#include <vector>
44#include <utility>
45
46namespace woss {
47
48
56 public:
57
63 BathyUtmCsvDb( const ::std::string& name );
64
65 virtual ~BathyUtmCsvDb() { }
66
67
75 virtual bool insertValue( const Coord& coordinates, const Bathymetry& bathymetry_value );
76
84 virtual double getValue( const Coord& coords ) const ;
85
86
92 virtual bool finalizeConnection();
93
99 void setCSVSeparator( const char new_separator ) { separator = new_separator; }
100
106 const char getCSVSeparator() const { return separator; }
107
113 void setDbSpacing( double spacing ) { db_spacing = spacing; }
114
120 double getDbSpacing() const { return db_spacing; }
121
128 void setDbTotalValues(int nnorth, int neast) {
129 total_northing_values = nnorth;
130 total_easting_values = neast;
131 }
132
138 std::pair<int, int> getDbTotalValues() const {
139 return std::make_pair(total_northing_values, total_easting_values);
140 }
141
148 void setDbRangeEasting(double start, double end) {
149 range_easting_start = start;
150 range_easting_end = end;
151 }
152
158 std::pair<double, double> getDbRangeEasting() const {
159 return std::make_pair(range_easting_start, range_easting_end);
160 }
161
168 void setDbRangeNorthing(double start, double end) {
169 range_northing_start = start;
170 range_northing_end = end;
171 }
172
178 std::pair<double, double> getDbRangeNorthing() const {
179 return std::make_pair( range_northing_start, range_northing_end);
180 }
181
186 void setLandApproximationFlag(bool flag) {
188 }
189
198
199 protected:
200
208 int getBathyIndex( const Coord& coords ) const ;
209
215 virtual bool importData();
216
217
218 std::vector<double> bathy_vec;
222 double db_spacing;
238 static const double land_approximation_depth;
239 };
240
241}
242
243#endif /* WOSS_BATHYMETRY_UTM_CSV_DB_H */
244
245
246
Specialization of WossTextualDb for UTM CSV database.
Definition bathymetry-utm-csv-db.h:55
double range_easting_start
Definition bathymetry-utm-csv-db.h:228
const char getCSVSeparator() const
Definition bathymetry-utm-csv-db.h:106
void setDbSpacing(double spacing)
Definition bathymetry-utm-csv-db.h:113
void setDbTotalValues(int nnorth, int neast)
Definition bathymetry-utm-csv-db.h:128
std::vector< double > bathy_vec
Definition bathymetry-utm-csv-db.h:218
virtual bool finalizeConnection()
Definition bathymetry-utm-csv-db.cpp:58
void setCSVSeparator(const char new_separator)
Definition bathymetry-utm-csv-db.h:99
void setLandApproximationFlag(bool flag)
Definition bathymetry-utm-csv-db.h:186
bool getLandApproximationFlag()
Definition bathymetry-utm-csv-db.h:195
virtual bool importData()
Definition bathymetry-utm-csv-db.cpp:137
int total_northing_values
Definition bathymetry-utm-csv-db.h:224
double range_northing_start
Definition bathymetry-utm-csv-db.h:232
static const double land_approximation_depth
Definition bathymetry-utm-csv-db.h:238
virtual double getValue(const Coord &coords) const
Definition bathymetry-utm-csv-db.cpp:69
void setDbRangeEasting(double start, double end)
Definition bathymetry-utm-csv-db.h:148
std::pair< double, double > getDbRangeNorthing() const
Definition bathymetry-utm-csv-db.h:178
void setDbRangeNorthing(double start, double end)
Definition bathymetry-utm-csv-db.h:168
bool approx_land_to_sea_surface
Definition bathymetry-utm-csv-db.h:236
char separator
Definition bathymetry-utm-csv-db.h:220
virtual bool insertValue(const Coord &coordinates, const Bathymetry &bathymetry_value)
Definition bathymetry-utm-csv-db.cpp:63
double range_northing_end
Definition bathymetry-utm-csv-db.h:234
double db_spacing
Definition bathymetry-utm-csv-db.h:222
double range_easting_end
Definition bathymetry-utm-csv-db.h:230
int getBathyIndex(const Coord &coords) const
Definition bathymetry-utm-csv-db.cpp:97
double getDbSpacing() const
Definition bathymetry-utm-csv-db.h:120
std::pair< int, int > getDbTotalValues() const
Definition bathymetry-utm-csv-db.h:138
int total_easting_values
Definition bathymetry-utm-csv-db.h:226
std::pair< double, double > getDbRangeEasting() const
Definition bathymetry-utm-csv-db.h:158
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:107
Data behaviour class for bathymetry database.
Definition woss-db.h:292
Textual implementation of WossDb.
Definition woss-db.h:245
Provides the interface for woss::WossDb class.