bes  Updated for version 3.20.6
FONgGrid.h
1 // FONgGrid.h
2 
3 // This file is part of BES GDAL File Out Module
4 
5 // Copyright (c) 2012 OPeNDAP, Inc.
6 // Author: James Gallagher <jgallagher@opendap.org>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // You can contact University Corporation for Atmospheric Research at
23 // 3080 Center Green Drive, Boulder, CO 80301
24 
25 #ifndef FONgGrid_h_
26 #define FONgGrid_h_ 1
27 
28 #include <set>
29 #include <string>
30 
31 class GDALDataset;
32 
33 namespace libdap {
34  class Grid;
35  class Array;
36 }
37 
52 class FONgGrid: public BESObj {
53 private:
54  libdap::Grid *d_grid;
55  libdap::Array *d_lat, *d_lon;
56 
57  // Sets of string values used to find stuff in attributes
58  std::set<std::string> d_coards_lat_units;
59  std::set<std::string> d_coards_lon_units;
60 
61  std::set<std::string> d_lat_names;
62  std::set<std::string> d_lon_names;
63 
64  bool m_lat_unit_or_name_match(const string &var_units, const string &var_name, const string &long_name);
65  bool m_lon_unit_or_name_match(const string &var_units, const string &var_name, const string &long_name);
66 
67  friend class FONgTransform;
68 
69 public:
70  FONgGrid(libdap::Grid *g);
71  virtual ~FONgGrid();
72 
73  libdap::Grid *grid() { return d_grid; }
74 
75  bool find_lat_lon_maps();
76 
78  virtual void extract_coordinates(FONgTransform &t);
79  string get_projection(libdap::DDS *dds);
81  virtual double *get_data();
82  virtual libdap::Type type() { return d_type; }
83  FONgGrid(): d_name(""), d_type(libdap::dods_null_c) {}
84 
85 protected:
86  string d_name;
87  libdap::Type d_type;
88 
89  virtual string name() { return d_name; }
90  virtual void set_name(const string &n) { d_name = n; }
91 
92  // virtual libdap::Type type() { return d_type; }
93  virtual void set_type(libdap::Type t) { d_type = t; }
94 
95  // virtual void extract_coordinates(FONgTransform &t) = 0;
96 
97 
98  // virtual string get_projection(libdap::DDS *dds) = 0;
99 
100 
101  // virtual double *get_data() = 0;
102 
103  virtual void dump(ostream &) const {};
104 
105 };
106 
107 #endif // FONgGrid_h_
FONgGrid::extract_coordinates
virtual void extract_coordinates(FONgTransform &t)
Get the GDAL/OGC WKT projection string.
Definition: FONgGrid.cc:203
FONgGrid::find_lat_lon_maps
bool find_lat_lon_maps()
Definition: FONgGrid.cc:144
Type
Type
Type of JSON value.
Definition: cmr_module/rapidjson/rapidjson.h:603
libdap
Definition: BESDapFunctionResponseCache.h:35
FONgGrid::get_data
virtual double * get_data()
Get the data values for the band(s). Call must delete.
Definition: FONgGrid.cc:337
BESObj
top level BES object to house generic methods
Definition: BESObj.h:49
FONgGrid::~FONgGrid
virtual ~FONgGrid()
Destructor that cleans up the grid.
Definition: FONgGrid.cc:84
FONgGrid
A DAP Grid with file out netcdf information included.
Definition: FONgGrid.h:52
FONgTransform
Transformation object that converts an OPeNDAP DataDDS to a GeoTiff file.
Definition: FONgTransform.h:41
FONgGrid::get_projection
string get_projection(libdap::DDS *dds)
Set the projection information For Grids, look for CF information. If it's not present,...
Definition: FONgGrid.cc:296