bes  Updated for version 3.17.0
DAP_Dataset.h
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2012 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 #ifndef DAP_DATASET_H_
27 #define DAP_DATASET_H_
28 
29 #include <string>
30 #include "AbstractDataset.h"
31 #include "wcsUtil.h"
32 
33 using namespace std;
34 
35 namespace libdap {
36 
37 class Array;
38 class Grid;
39 
40 /************************************************************************/
41 /* ==================================================================== */
42 /* DAP_Dataset */
43 /* ==================================================================== */
44 /************************************************************************/
45 
47 
76 class DAP_Dataset : public AbstractDataset {
77 protected:
78  string m_ncLatDataSetName;
79  string m_ncLonDataSetName;
80  string m_ncCoverageIDName;
81 
82  // Instead of using names and opening files with GDAL,
83  // store pointers to Arrays read by the underlying DAP
84  // server constraint evaluator.
85  Array *m_src;
86  Array *m_lat;
87  Array *m_lon;
88 
89  int mi_RectifiedImageXSize;
90  int mi_RectifiedImageYSize;
91  int mi_SrcImageXSize;
92  int mi_SrcImageYSize;
93 
94  double mb_LatLonBBox[4];
95  double mdSrcGeoMinX;
96  double mdSrcGeoMinY;
97  double mdSrcGeoMaxX;
98  double mdSrcGeoMaxY;
99 
100  // This is not set until GetDAPArray() is called.
101  double m_geo_transform_coef[6];
102 
103  vector<GDAL_GCP> m_gdalGCPs;
104 
105 public:
106  CPLErr SetGCPGeoRef4VRTDataset(GDALDataset*);
107  void SetGeoBBoxAndGCPs(int xSize, int ySize);
108  CPLErr RectifyGOESDataSet();
109  CPLErr setResampleStandard(GDALDataset* hSrcDS, int& xRSValue, int& yRSValue);
110 
111  int isValidLatitude(const double &lat)
112  {
113  return (lat >= -90 && lat <= 90);
114  }
115  int isValidLongitude(const double &lon)
116  {
117  return (lon >= -180 && lon <= 180);
118  }
119 
120  virtual CPLErr SetGeoTransform();
121 #if 0
122  virtual CPLErr SetMetaDataList(GDALDataset* hSrcDS); //TODO Remove
123 #endif
124  virtual CPLErr SetNativeCRS();
125  virtual CPLErr SetGDALDataset(const int isSimple = 0);
126  virtual CPLErr InitialDataset(const int isSimple = 0);
127  virtual CPLErr GetGeoMinMax(double geoMinMax[]);
128 
129 public:
130  DAP_Dataset();
131  DAP_Dataset(const string& id, vector<int> &rBandList);
132 
133  // Added jhrg 11/23/12
134  DAP_Dataset(Array *src, Array *lat, Array *lon);
135  Array *GetDAPArray();
136  Grid *GetDAPGrid();
137 
138  virtual ~DAP_Dataset();
139 };
140 
141 } // namespace libdap
142 #endif /* DAP_DATASET_H_ */
STL namespace.
DAP_Dataset is a subclass of AbstractDataset, used to process NOAA GOES data.
Definition: DAP_Dataset.h:76
Abstract dataset model definition. Based on GDAL dataset model.