bes  Updated for version 3.17.0
AbstractDataset.h
1 /******************************************************************************
2  * $Id: AbstractDataset.h 2011-07-19 16:24:00Z $
3  *
4  * Project: The Open Geospatial Consortium (OGC) Web Coverage Service (WCS)
5  * for Earth Observation: Open Source Reference Implementation
6  * Purpose: AbstractDataset class definition
7  * Author: Yuanzheng Shao, yshao3@gmu.edu
8  *
9  ******************************************************************************
10  * * Copyright (c) 2011, Liping Di <ldi@gmu.edu>, Yuanzheng Shao <yshao3@gmu.edu>
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  ****************************************************************************/
30 
31 #ifndef ABSTRACTDATASET_H_
32 #define ABSTRACTDATASET_H_
33 
34 #include <vector>
35 #include <memory>
36 
37 #include <gdal.h>
38 #include <gdal_priv.h>
39 #include <gdalwarper.h>
40 #include <ogrsf_frmts.h>
41 #include <ogr_spatialref.h>
42 #include <cpl_conv.h>
43 #include <cpl_minixml.h>
44 #include <vrtdataset.h>
45 
46 #include "wcsUtil.h"
47 
48 using namespace std;
49 
50 /* ******************************************************************** */
51 /* AbstractDataset */
52 /* ******************************************************************** */
53 
56 
57 protected:
58  auto_ptr<GDALDataset> maptr_DS;
59 
60  // Coverage Information Related
61  string ms_CoverageID;
62  string ms_CoverageBeginTime;
63  string ms_CoverageEndTime;
64  string ms_CoverageSubType;
65  string ms_CoverageArchiveTime;
66  string ms_CoveragePlatform;
67  string ms_CoverageInstrument;
68  string ms_CoverageSensor;
69  string ms_SrcFilename;
70  string ms_DatasetName;
71  string ms_DataTypeName;
72  string ms_NativeFormat;
73  string ms_FieldQuantityDef;
74  string ms_AllowRanges;
75  string ms_ISO19115Metadata;
76 
77  vector<int> mv_BandList;
78  vector<string> mv_MetaDataList;
79 
80  double md_Geotransform[6];
81  double md_GeoMinMax[4]; // Order: xmin, xmax, ymin, ymax
82  double md_MissingValue;
83 
84  int mb_GeoTransformSet;
85  int mb_IsVirtualDS;
86 
87  OGRSpatialReference mo_NativeCRS;
88 
89 protected:
91  virtual CPLErr SetNativeCRS();
92  virtual CPLErr SetGeoTransform();
93  virtual CPLErr SetGDALDataset(const int isSimple = 0);
94  virtual CPLErr SetMetaDataList(GDALDataset*);
95 
96 public:
97  AbstractDataset(const string&, vector<int> &);
98  virtual ~AbstractDataset();
99 
100  GDALDataset* GetGDALDataset();
101 
102  // Virtual Functions Definition
103  virtual CPLErr InitialDataset(const int isSimple = 0);
104 
105  // Fetch Function Related
106  const OGRSpatialReference& GetNativeCRS();
107  const double& GetMissingValue();
108  int GetGeoTransform(double geoTrans[]);
109  vector<string> GetMetaDataList();
110  vector<int> GetBandList();
111  void GetNativeBBox(double bBox[]);
112  CPLErr GetGeoMinMax(double geoMinMax[]);
113 
114  int GetImageBandCount();
115  int GetImageXSize();
116  int GetImageYSize();
117  string GetResourceFileName();
118  string GetDatasetName();
119  string GetDataTypeName();
120  string GetNativeFormat();
121  string GetCoverageID();
122  string GetDatasetDescription();
123  string GetNativeCRS_URN();
124  string GetGeoCRS_URN();
125  string GetProjectionRef();
126  string GetCoverageBeginTime();
127  string GetCoverageEndTime();
128  string GetCoverageSubType();
129  string GetFieldQuantityDef();
130  string GetAllowValues();
131  string GetISO19115Metadata();
132  string GetCoverageArchiveTime();
133  string GetCoveragePlatform();
134  string GetCoverageInstrument();
135  string GetCoverageSensor();
136 
137  // Fetch Variables Status Related
138  int IsbGeoTransformSet();
139  int IsCrossingIDL();
140 
141  CPLErr GetSuggestedWarpResolution(OGRSpatialReference& dstCRS, double adfDstGeoTransform[], int &nPixels,
142  int &nLines);
143  CPLErr GetSuggestedWarpResolution2(OGRSpatialReference& dstCRS, double adfDstGeoTransform[], int &nPixels,
144  int &nLines);
145 
146  GDALDataset* DatasetWarper(int& IsRefDS, OGRSpatialReference& dstCRS, int& iDstRasterXsize, int& iDstRasterYsize,
147  double pDstGeoTransform[], GDALResampleAlg eResampleAlg = GRA_NearestNeighbour);
148 };
149 
150 #endif /*ABSTRACTDATASET_H_*/
STL namespace.
Abstract dataset model definition. Based on GDAL dataset model.