GDAL

gdal_proxy.h
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: GDAL Core
5 * Purpose: GDAL Core C++/Private declarations
6 * Author: Even Rouault <even dot rouault at spatialys.com>
7 *
8 ******************************************************************************
9 * Copyright (c) 2008-2014, Even Rouault <even dot rouault at spatialys.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
28 ****************************************************************************/
29
30 #ifndef GDAL_PROXY_H_INCLUDED
31 #define GDAL_PROXY_H_INCLUDED
32
33 #ifndef DOXYGEN_SKIP
34
35 #include "gdal.h"
36
37 #ifdef __cplusplus
38
39 #include "gdal_priv.h"
40 #include "cpl_hash_set.h"
41
42 /* ******************************************************************** */
43 /* GDALProxyDataset */
44 /* ******************************************************************** */
45
46 class CPL_DLL GDALProxyDataset : public GDALDataset
47 {
48 protected:
49 GDALProxyDataset()
50 {
51 }
52
53 virtual GDALDataset *RefUnderlyingDataset() const = 0;
54 virtual void UnrefUnderlyingDataset(GDALDataset *poUnderlyingDataset) const;
55
56 CPLErr IBuildOverviews(const char *, int, const int *, int, const int *,
57 GDALProgressFunc, void *,
58 CSLConstList papszOptions) override;
59 CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int,
60 GDALDataType, int, int *, GSpacing, GSpacing, GSpacing,
61 GDALRasterIOExtraArg *psExtraArg) override;
62
63 public:
64 char **GetMetadataDomainList() override;
65 char **GetMetadata(const char *pszDomain) override;
66 CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override;
67 const char *GetMetadataItem(const char *pszName,
68 const char *pszDomain) override;
69 CPLErr SetMetadataItem(const char *pszName, const char *pszValue,
70 const char *pszDomain) override;
71
72 CPLErr FlushCache(bool bAtClosing) override;
73
74 const OGRSpatialReference *GetSpatialRef() const override;
75 CPLErr SetSpatialRef(const OGRSpatialReference *poSRS) override;
76
77 CPLErr GetGeoTransform(double *) override;
78 CPLErr SetGeoTransform(double *) override;
79
80 void *GetInternalHandle(const char *) override;
81 GDALDriver *GetDriver() override;
82 char **GetFileList() override;
83
84 int GetGCPCount() override;
85 const OGRSpatialReference *GetGCPSpatialRef() const override;
86 const GDAL_GCP *GetGCPs() override;
87 CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList,
88 const OGRSpatialReference *poGCP_SRS) override;
89
90 CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize,
91 int nBufXSize, int nBufYSize, GDALDataType eDT,
92 int nBandCount, int *panBandList,
93 char **papszOptions) override;
94
95 CPLErr CreateMaskBand(int nFlags) override;
96
97 virtual CPLStringList
98 GetCompressionFormats(int nXOff, int nYOff, int nXSize, int nYSize,
99 int nBandCount, const int *panBandList) override;
100 virtual CPLErr ReadCompressedData(const char *pszFormat, int nXOff,
101 int nYOff, int nXSize, int nYSize,
102 int nBandCount, const int *panBandList,
103 void **ppBuffer, size_t *pnBufferSize,
104 char **ppszDetailedFormat) override;
105
106 private:
107 CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset)
108 };
109
110 /* ******************************************************************** */
111 /* GDALProxyRasterBand */
112 /* ******************************************************************** */
113
114 class CPL_DLL GDALProxyRasterBand : public GDALRasterBand
115 {
116 protected:
117 GDALProxyRasterBand()
118 {
119 }
120
121 virtual GDALRasterBand *
122 RefUnderlyingRasterBand(bool bForceOpen = true) const = 0;
123 virtual void
124 UnrefUnderlyingRasterBand(GDALRasterBand *poUnderlyingRasterBand) const;
125
126 CPLErr IReadBlock(int, int, void *) override;
127 CPLErr IWriteBlock(int, int, void *) override;
128 CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int,
129 GDALDataType, GSpacing, GSpacing,
130 GDALRasterIOExtraArg *psExtraArg) override;
131
132 public:
133 char **GetMetadataDomainList() override;
134 char **GetMetadata(const char *pszDomain) override;
135 CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override;
136 const char *GetMetadataItem(const char *pszName,
137 const char *pszDomain) override;
138 CPLErr SetMetadataItem(const char *pszName, const char *pszValue,
139 const char *pszDomain) override;
140 CPLErr FlushCache(bool bAtClosing) override;
141 char **GetCategoryNames() override;
142 double GetNoDataValue(int *pbSuccess = nullptr) override;
143 double GetMinimum(int *pbSuccess = nullptr) override;
144 double GetMaximum(int *pbSuccess = nullptr) override;
145 double GetOffset(int *pbSuccess = nullptr) override;
146 double GetScale(int *pbSuccess = nullptr) override;
147 const char *GetUnitType() override;
148 GDALColorInterp GetColorInterpretation() override;
149 GDALColorTable *GetColorTable() override;
150 CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) override;
151
152 CPLErr SetCategoryNames(char **) override;
153 CPLErr SetNoDataValue(double) override;
154 CPLErr DeleteNoDataValue() override;
155 CPLErr SetColorTable(GDALColorTable *) override;
156 CPLErr SetColorInterpretation(GDALColorInterp) override;
157 CPLErr SetOffset(double) override;
158 CPLErr SetScale(double) override;
159 CPLErr SetUnitType(const char *) override;
160
161 CPLErr GetStatistics(int bApproxOK, int bForce, double *pdfMin,
162 double *pdfMax, double *pdfMean,
163 double *padfStdDev) override;
164 CPLErr ComputeStatistics(int bApproxOK, double *pdfMin, double *pdfMax,
165 double *pdfMean, double *pdfStdDev,
166 GDALProgressFunc, void *pProgressData) override;
167 CPLErr SetStatistics(double dfMin, double dfMax, double dfMean,
168 double dfStdDev) override;
169 CPLErr ComputeRasterMinMax(int, double *) override;
170
171 int HasArbitraryOverviews() override;
172 int GetOverviewCount() override;
173 GDALRasterBand *GetOverview(int) override;
174 GDALRasterBand *GetRasterSampleOverview(GUIntBig) override;
175 CPLErr BuildOverviews(const char *, int, const int *, GDALProgressFunc,
176 void *, CSLConstList papszOptions) override;
177
178 CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize,
179 int nBufXSize, int nBufYSize, GDALDataType eDT,
180 char **papszOptions) override;
181
182 CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets,
183 GUIntBig *panHistogram, int bIncludeOutOfRange,
184 int bApproxOK, GDALProgressFunc,
185 void *pProgressData) override;
186
187 CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets,
188 GUIntBig **ppanHistogram, int bForce,
189 GDALProgressFunc, void *pProgressData) override;
190 CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets,
191 GUIntBig *panHistogram) override;
192
193 GDALRasterAttributeTable *GetDefaultRAT() override;
194 CPLErr SetDefaultRAT(const GDALRasterAttributeTable *) override;
195
196 GDALRasterBand *GetMaskBand() override;
197 int GetMaskFlags() override;
198 CPLErr CreateMaskBand(int nFlags) override;
199 bool IsMaskBand() const override;
200 GDALMaskValueRange GetMaskValueRange() const override;
201
202 CPLVirtualMem *GetVirtualMemAuto(GDALRWFlag eRWFlag, int *pnPixelSpace,
203 GIntBig *pnLineSpace,
204 char **papszOptions) override;
205
206 private:
207 CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand)
208 };
209
210 /* ******************************************************************** */
211 /* GDALProxyPoolDataset */
212 /* ******************************************************************** */
213
214 typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
215 class GDALProxyPoolRasterBand;
216
217 class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
218 {
219 private:
220 GIntBig responsiblePID = -1;
221
222 mutable char *pszProjectionRef = nullptr;
223 mutable OGRSpatialReference *m_poSRS = nullptr;
224 mutable OGRSpatialReference *m_poGCPSRS = nullptr;
225 double adfGeoTransform[6]{0, 1, 0, 0, 0, 1};
226 bool m_bHasSrcSRS = false;
227 bool bHasSrcGeoTransform = false;
228 char *pszGCPProjection = nullptr;
229 int nGCPCount = 0;
230 GDAL_GCP *pasGCPList = nullptr;
231 CPLHashSet *metadataSet = nullptr;
232 CPLHashSet *metadataItemSet = nullptr;
233
234 mutable GDALProxyPoolCacheEntry *cacheEntry = nullptr;
235 char *m_pszOwner = nullptr;
236
237 GDALDataset *RefUnderlyingDataset(bool bForceOpen) const;
238
239 GDALProxyPoolDataset(const char *pszSourceDatasetDescription,
240 GDALAccess eAccess, int bShared, const char *pszOwner);
241
242 protected:
243 GDALDataset *RefUnderlyingDataset() const override;
244 void
245 UnrefUnderlyingDataset(GDALDataset *poUnderlyingDataset) const override;
246
247 friend class GDALProxyPoolRasterBand;
248
249 public:
250 GDALProxyPoolDataset(const char *pszSourceDatasetDescription,
251 int nRasterXSize, int nRasterYSize,
252 GDALAccess eAccess = GA_ReadOnly, int bShared = FALSE,
253 const char *pszProjectionRef = nullptr,
254 double *padfGeoTransform = nullptr,
255 const char *pszOwner = nullptr);
256
257 static GDALProxyPoolDataset *Create(const char *pszSourceDatasetDescription,
258 CSLConstList papszOpenOptions = nullptr,
259 GDALAccess eAccess = GA_ReadOnly,
260 int bShared = FALSE,
261 const char *pszOwner = nullptr);
262
263 ~GDALProxyPoolDataset() override;
264
265 void SetOpenOptions(CSLConstList papszOpenOptions);
266
267 // If size (nBlockXSize&nBlockYSize) parameters is zero
268 // they will be loaded when RefUnderlyingRasterBand function is called.
269 // But in this case we cannot use them in other non-virtual methods before
270 // RefUnderlyingRasterBand fist call.
271 void AddSrcBandDescription(GDALDataType eDataType, int nBlockXSize,
272 int nBlockYSize);
273
274 // Used by VRT SimpleSource to add a single GDALProxyPoolRasterBand while
275 // keeping all other bands initialized to a nullptr. This is under the
276 // assumption, VRT SimpleSource will not have to access any other bands than
277 // the one added.
278 void AddSrcBand(int nBand, GDALDataType eDataType, int nBlockXSize,
279 int nBlockYSize);
280 CPLErr FlushCache(bool bAtClosing) override;
281
282 const OGRSpatialReference *GetSpatialRef() const override;
283 CPLErr SetSpatialRef(const OGRSpatialReference *poSRS) override;
284
285 CPLErr GetGeoTransform(double *) override;
286 CPLErr SetGeoTransform(double *) override;
287
288 // Special behavior for the following methods : they return a pointer
289 // data type, that must be cached by the proxy, so it doesn't become invalid
290 // when the underlying object get closed.
291 char **GetMetadata(const char *pszDomain) override;
292 const char *GetMetadataItem(const char *pszName,
293 const char *pszDomain) override;
294
295 void *GetInternalHandle(const char *pszRequest) override;
296
297 const OGRSpatialReference *GetGCPSpatialRef() const override;
298 const GDAL_GCP *GetGCPs() override;
299
300 private:
301 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset)
302 };
303
304 /* ******************************************************************** */
305 /* GDALProxyPoolRasterBand */
306 /* ******************************************************************** */
307
308 class GDALProxyPoolOverviewRasterBand;
309 class GDALProxyPoolMaskBand;
310
311 class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
312 {
313 private:
314 CPLHashSet *metadataSet = nullptr;
315 CPLHashSet *metadataItemSet = nullptr;
316 char *pszUnitType = nullptr;
317 char **papszCategoryNames = nullptr;
318 GDALColorTable *poColorTable = nullptr;
319
320 int nSizeProxyOverviewRasterBand = 0;
321 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand = nullptr;
322 GDALProxyPoolMaskBand *poProxyMaskBand = nullptr;
323
324 protected:
325 GDALRasterBand *
326 RefUnderlyingRasterBand(bool bForceOpen = true) const override;
327 void UnrefUnderlyingRasterBand(
328 GDALRasterBand *poUnderlyingRasterBand) const override;
329
330 friend class GDALProxyPoolOverviewRasterBand;
331 friend class GDALProxyPoolMaskBand;
332
333 public:
334 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS, int nBand,
335 GDALDataType eDataType, int nBlockXSize,
336 int nBlockYSize);
337 GDALProxyPoolRasterBand(GDALProxyPoolDataset *poDS,
338 GDALRasterBand *poUnderlyingRasterBand);
339 ~GDALProxyPoolRasterBand() override;
340
341 void AddSrcMaskBandDescription(GDALDataType eDataType, int nBlockXSize,
342 int nBlockYSize);
343
344 void AddSrcMaskBandDescriptionFromUnderlying();
345
346 // Special behavior for the following methods : they return a pointer
347 // data type, that must be cached by the proxy, so it doesn't become invalid
348 // when the underlying object get closed.
349 char **GetMetadata(const char *pszDomain) override;
350 const char *GetMetadataItem(const char *pszName,
351 const char *pszDomain) override;
352 char **GetCategoryNames() override;
353 const char *GetUnitType() override;
354 GDALColorTable *GetColorTable() override;
355 GDALRasterBand *GetOverview(int) override;
356 GDALRasterBand *
357 GetRasterSampleOverview(GUIntBig nDesiredSamples) override; // TODO
358 GDALRasterBand *GetMaskBand() override;
359
360 CPLErr FlushCache(bool bAtClosing) override;
361
362 private:
363 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand)
364 };
365
366 /* ******************************************************************** */
367 /* GDALProxyPoolOverviewRasterBand */
368 /* ******************************************************************** */
369
370 class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
371 {
372 private:
373 GDALProxyPoolRasterBand *poMainBand = nullptr;
374 int nOverviewBand = 0;
375
376 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
377 mutable int nRefCountUnderlyingMainRasterBand = 0;
378
379 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolOverviewRasterBand)
380
381 protected:
382 GDALRasterBand *
383 RefUnderlyingRasterBand(bool bForceOpen = true) const override;
384 void UnrefUnderlyingRasterBand(
385 GDALRasterBand *poUnderlyingRasterBand) const override;
386
387 public:
388 GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset *poDS,
389 GDALRasterBand *poUnderlyingOverviewBand,
390 GDALProxyPoolRasterBand *poMainBand,
391 int nOverviewBand);
392 ~GDALProxyPoolOverviewRasterBand() override;
393 };
394
395 /* ******************************************************************** */
396 /* GDALProxyPoolMaskBand */
397 /* ******************************************************************** */
398
399 class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
400 {
401 private:
402 GDALProxyPoolRasterBand *poMainBand = nullptr;
403
404 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
405 mutable int nRefCountUnderlyingMainRasterBand = 0;
406
407 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolMaskBand)
408
409 protected:
410 GDALRasterBand *
411 RefUnderlyingRasterBand(bool bForceOpen = true) const override;
412 void UnrefUnderlyingRasterBand(
413 GDALRasterBand *poUnderlyingRasterBand) const override;
414
415 public:
416 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
417 GDALRasterBand *poUnderlyingMaskBand,
418 GDALProxyPoolRasterBand *poMainBand);
419 GDALProxyPoolMaskBand(GDALProxyPoolDataset *poDS,
420 GDALProxyPoolRasterBand *poMainBand,
421 GDALDataType eDataType, int nBlockXSize,
422 int nBlockYSize);
423 ~GDALProxyPoolMaskBand() override;
424
425 bool IsMaskBand() const override
426 {
427 return true;
428 }
429 };
430
431 #endif
432
433 /* ******************************************************************** */
434 /* C types and methods declarations */
435 /* ******************************************************************** */
436
437 CPL_C_START
438
439 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
440
441 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(
442 const char *pszSourceDatasetDescription, int nRasterXSize, int nRasterYSize,
443 GDALAccess eAccess, int bShared, const char *pszProjectionRef,
444 double *padfGeoTransform);
445
446 void CPL_DLL
447 GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
448
449 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription(
450 GDALProxyPoolDatasetH hProxyPoolDataset, GDALDataType eDataType,
451 int nBlockXSize, int nBlockYSize);
452
453 CPL_C_END
454
455 #endif /* #ifndef DOXYGEN_SKIP */
456
457 #endif /* GDAL_PROXY_H_INCLUDED */
GDALRasterBand::IWriteBlock
virtual CPLErr IWriteBlock(int nBlockXOff, int nBlockYOff, void *pData)
Definition: gdalrasterband.cpp:649
GDALRasterBand::HasArbitraryOverviews
virtual int HasArbitraryOverviews()
Check for arbitrary overviews.
Definition: gdalrasterband.cpp:2557
GDALRasterBand::SetNoDataValue
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1911
GDALRasterBand::GetColorTable
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2460
GDALRasterBand::GetMaskValueRange
virtual GDALMaskValueRange GetMaskValueRange() const
Returns the range of values that a mask band can take.
Definition: gdalrasterband.cpp:7569
gdal.h
GDALRasterBand::ComputeStatistics
virtual CPLErr ComputeStatistics(int bApproxOK, double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev, GDALProgressFunc, void *pProgressData)
Compute image statistics.
Definition: gdalrasterband.cpp:5612
GDALRasterBand::GetUnitType
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:3041
GDALRasterBand::DeleteNoDataValue
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:2113
GDALRasterBand::GetOffset
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2840
GDALRasterBand::SetColorTable
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2509
GDALRasterBand::GetDefaultHistogram
virtual CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets, GUIntBig **ppanHistogram, int bForce, GDALProgressFunc, void *pProgressData)
Fetch default raster histogram.
Definition: gdalrasterband.cpp:4005
GDALRasterBand::IsMaskBand
virtual bool IsMaskBand() const
Returns whether a band is a mask band.
Definition: gdalrasterband.cpp:7518
GDALRasterBand::Fill
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue=0)
Fill this band with a constant value.
Definition: gdalrasterband.cpp:1470
cpl_hash_set.h
GDALRasterBand::GetVirtualMemAuto
virtual CPLVirtualMem * GetVirtualMemAuto(GDALRWFlag eRWFlag, int *pnPixelSpace, GIntBig *pnLineSpace, char **papszOptions)
Create a CPLVirtualMem object from a GDAL raster band object.
Definition: gdalrasterband.cpp:7895
CPLStringList
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:437
GDALDataset::GetDriver
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1417
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1700
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:166
GDALRasterBand::SetDefaultHistogram
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:6825
GDALRasterBand::SetUnitType
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:3089
GDALRasterBand::GetColorInterpretation
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:2371
GDALRasterBand::GetCategoryNames
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1622
GDALColorInterp
GDALColorInterp
Definition: gdal.h:226
GDALRasterBand
A single raster band (or channel).
Definition: gdal_priv.h:1270
GDALMaskValueRange
GDALMaskValueRange
Range of values found in a mask band.
Definition: gdal_priv.h:1241
GDALDataset::AdviseRead
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdaldataset.cpp:2926
GDALDataset::GetMetadata
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4362
GDALDataType
GDALDataType
Definition: gdal.h:63
GDALMajorObject::GetMetadataItem
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:341
GDALDataset::SetGCPs
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1914
GDALDataset::GetGCPs
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1807
GDALDataset::GetCompressionFormats
virtual CPLStringList GetCompressionFormats(int nXOff, int nYOff, int nXSize, int nYSize, int nBandCount, const int *panBandList)
Return the compression formats that can be natively obtained for the window of interest and requested...
Definition: gdaldataset.cpp:9362
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:348
CPLHashSet
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:52
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:306
GDALDataset::ReadCompressedData
virtual CPLErr ReadCompressedData(const char *pszFormat, int nXOff, int nYOff, int nXSize, int nYSize, int nBands, const int *panBandList, void **ppBuffer, size_t *pnBufferSize, char **ppszDetailedFormat)
Return the compressed content that can be natively obtained for the window of interest and requested ...
Definition: gdaldataset.cpp:9592
GDALRasterBand::GetOverviewCount
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2594
GDALRasterBand::SetDefaultRAT
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:6972
GDALDataset::GetInternalHandle
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1379
GDALRasterBand::GetMaskBand
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:7052
GDALMajorObject::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:247
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1178
GDALRasterBand::AdviseRead
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdalrasterband.cpp:4221
GUIntBig
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:229
GDALRasterBand::GetRasterSampleOverview
virtual GDALRasterBand * GetRasterSampleOverview(GUIntBig)
Fetch best sampling overview.
Definition: gdalrasterband.cpp:2689
GDALDataset::GetGCPSpatialRef
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1750
GDALDataset::SetSpatialRef
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition: gdaldataset.cpp:1202
GDAL_GCP
Ground Control Point.
Definition: gdal.h:1051
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:310
GDALRasterBand::IReadBlock
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
GDALDataset::GetGCPCount
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1665
GDALRasterBand::GetOverview
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2637
GDALMajorObject::GetMetadataDomainList
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:160
GDALRasterBand::ComputeRasterMinMax
virtual CPLErr ComputeRasterMinMax(int, double *)
Compute the min/max values for a band.
Definition: gdalrasterband.cpp:6473
CPLVirtualMem
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
GDALRasterBand::SetScale
virtual CPLErr SetScale(double dfNewScale)
Set scaling ratio.
Definition: gdalrasterband.cpp:2995
GDALRasterBand::BuildOverviews
virtual CPLErr BuildOverviews(const char *pszResampling, int nOverviews, const int *panOverviewList, GDALProgressFunc pfnProgress, void *pProgressData, CSLConstList papszOptions)
Definition: gdalrasterband.cpp:2798
GDALDataset::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3238
GSpacing
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:315
GDALRasterBand::GetNoDataValue
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1726
GDALAccess
GDALAccess
Definition: gdal.h:124
gdal_priv.h
GDALRasterBand::GetStatistics
virtual CPLErr GetStatistics(int bApproxOK, int bForce, double *pdfMin, double *pdfMax, double *pdfMean, double *padfStdDev)
Fetch image statistics.
Definition: gdalrasterband.cpp:4307
GA_ReadOnly
@ GA_ReadOnly
Definition: gdal.h:126
GDALDataset::GetSpatialRef
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:1097
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:226
GDALRasterBand::FlushCache
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush raster data cache.
Definition: gdalrasterband.cpp:1103
GDALDataset::SetGeoTransform
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1335
GDALRasterBand::GetMetadataItem
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="") override
Fetch single metadata item.
Definition: gdalrasterband.cpp:8328
GDALDataset::GetFileList
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:3117
GDALRasterBand::GetDefaultRAT
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:6923
GDALRasterIOExtraArg
Structure to pass extra arguments to RasterIO() method, must be initialized with INIT_RASTERIO_EXTRA_...
Definition: gdal.h:175
GDALRasterBand::GetMinimum
virtual double GetMinimum(int *pbSuccess=nullptr)
Fetch the minimum value for this band.
Definition: gdalrasterband.cpp:2267
GDALRasterBand::GetScale
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2946
GDALRWFlag
GDALRWFlag
Definition: gdal.h:131
GDALRasterBand::SetColorInterpretation
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2415
GDALRasterBand::IRasterIO
virtual CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg)
Read/write a region of image data for this band.
Definition: rasterio.cpp:207
GDALRasterBand::SetStatistics
virtual CPLErr SetStatistics(double dfMin, double dfMax, double dfMean, double dfStdDev)
Set statistics on band.
Definition: gdalrasterband.cpp:6175
GDALDataset::SetMetadataItem
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:52
GDALDataset::SetMetadata
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
GDALRasterBand::SetCategoryNames
virtual CPLErr SetCategoryNames(char **papszNames)
Set the category names for this band.
Definition: gdalrasterband.cpp:1670
GDALRasterBand::GetHistogram
virtual CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc, void *pProgressData)
Compute raster histogram.
Definition: gdalrasterband.cpp:3342
GDALRasterBand::GetMaskFlags
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:7377
GDALDataset::GetGeoTransform
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1281
GDALRasterBand::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:7458
GDALRasterBand::SetMetadata
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
GDALRasterAttributeTable
Definition: gdal_rat.h:47
GDALRasterBand::GetMaximum
virtual double GetMaximum(int *pbSuccess=nullptr)
Fetch the maximum value for this band.
Definition: gdalrasterband.cpp:2162
GDALRasterBand::SetMetadataItem
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
GDALRasterBand::SetOffset
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2889
GDALDataset::GetMetadataDomainList
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4463
CPL_DISALLOW_COPY_ASSIGN
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1042
GDALColorTable
A color table / palette.
Definition: gdal_priv.h:1121
GDALDataset::FlushCache
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:556