bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
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
31class GDALDataset;
32
33namespace libdap {
34 class Grid;
35 class Array;
36}
37
52class FONgGrid: public BESObj {
53private:
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
69public:
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
85protected:
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_
top level BES object to house generic methods
Definition BESObj.h:54
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
FONgGrid(libdap::Grid *g)
Constructor for FONgGrid that takes a DAP Grid.
Definition FONgGrid.cc:49
virtual double * get_data()
Get the data values for the band(s). Call must delete.
Definition FONgGrid.cc:337
bool find_lat_lon_maps()
Definition FONgGrid.cc:144
virtual ~FONgGrid()
Destructor that cleans up the grid.
Definition FONgGrid.cc:84
virtual void extract_coordinates(FONgTransform &t)
Get the GDAL/OGC WKT projection string.
Definition FONgGrid.cc:203
STL class.