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 virtual GDALDataset *RefUnderlyingDataset() const = 0;
52 virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) const;
53
54 CPLErr IBuildOverviews( const char *, int, int *,
55 int, int *, GDALProgressFunc, void * ) override;
56 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
57 void *, int, int, GDALDataType,
58 int, int *, GSpacing, GSpacing, GSpacing,
59 GDALRasterIOExtraArg* psExtraArg ) override;
60
61 public:
62 char **GetMetadataDomainList() override;
63 char **GetMetadata( const char * pszDomain ) override;
64 CPLErr SetMetadata( char ** papszMetadata,
65 const char * pszDomain ) override;
66 const char *GetMetadataItem( const char * pszName,
67 const char * pszDomain ) override;
68 CPLErr SetMetadataItem( const char * pszName,
69 const char * pszValue,
70 const char * pszDomain ) override;
71
72 void 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,
92 GDALDataType eDT,
93 int nBandCount, int *panBandList,
94 char **papszOptions ) override;
95
96 CPLErr CreateMaskBand( int nFlags ) override;
97
98 protected:
99 const char *_GetProjectionRef(void) override;
100 CPLErr _SetProjection( const char * ) override;
101 const char *_GetGCPProjection() override;
102 CPLErr _SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
103 const char *pszGCPProjection ) override;
104
105 private:
106 CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset)
107 };
108
109 /* ******************************************************************** */
110 /* GDALProxyRasterBand */
111 /* ******************************************************************** */
112
113 class CPL_DLL GDALProxyRasterBand : public GDALRasterBand
114 {
115 protected:
116 GDALProxyRasterBand() {}
117
118 virtual GDALRasterBand* RefUnderlyingRasterBand() const = 0;
119 virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) const;
120
121 CPLErr IReadBlock( int, int, void * ) override;
122 CPLErr IWriteBlock( int, int, void * ) override;
123 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
124 void *, int, int, GDALDataType,
125 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
126
127 public:
128 char **GetMetadataDomainList() override;
129 char **GetMetadata( const char * pszDomain ) override;
130 CPLErr SetMetadata( char ** papszMetadata,
131 const char * pszDomain ) override;
132 const char *GetMetadataItem( const char * pszName,
133 const char * pszDomain ) override;
134 CPLErr SetMetadataItem( const char * pszName,
135 const char * pszValue,
136 const char * pszDomain ) override;
137 CPLErr FlushCache(bool bAtClosing) override;
138 char **GetCategoryNames() override;
139 double GetNoDataValue( int *pbSuccess = nullptr ) override;
140 double GetMinimum( int *pbSuccess = nullptr ) override;
141 double GetMaximum(int *pbSuccess = nullptr ) override;
142 double GetOffset( int *pbSuccess = nullptr ) override;
143 double GetScale( int *pbSuccess = nullptr ) override;
144 const char *GetUnitType() override;
145 GDALColorInterp GetColorInterpretation() override;
146 GDALColorTable *GetColorTable() override;
147 CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) override;
148
149 CPLErr SetCategoryNames( char ** ) override;
150 CPLErr SetNoDataValue( double ) override;
151 CPLErr DeleteNoDataValue() override;
152 CPLErr SetColorTable( GDALColorTable * ) override;
153 CPLErr SetColorInterpretation( GDALColorInterp ) override;
154 CPLErr SetOffset( double ) override;
155 CPLErr SetScale( double ) override;
156 CPLErr SetUnitType( const char * ) override;
157
158 CPLErr GetStatistics( int bApproxOK, int bForce,
159 double *pdfMin, double *pdfMax,
160 double *pdfMean, double *padfStdDev ) override;
161 CPLErr ComputeStatistics( int bApproxOK,
162 double *pdfMin, double *pdfMax,
163 double *pdfMean, double *pdfStdDev,
164 GDALProgressFunc, void *pProgressData ) override;
165 CPLErr SetStatistics( double dfMin, double dfMax,
166 double dfMean, double dfStdDev ) override;
167 CPLErr ComputeRasterMinMax( int, double* ) override;
168
169 int HasArbitraryOverviews() override;
170 int GetOverviewCount() override;
171 GDALRasterBand *GetOverview( int ) override;
172 GDALRasterBand *GetRasterSampleOverview( GUIntBig ) override;
173 CPLErr BuildOverviews( const char *, int, int *,
174 GDALProgressFunc, void * ) override;
175
176 CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
177 int nBufXSize, int nBufYSize,
178 GDALDataType eDT, char **papszOptions ) override;
179
180 CPLErr GetHistogram( double dfMin, double dfMax,
181 int nBuckets, GUIntBig * panHistogram,
182 int bIncludeOutOfRange, int bApproxOK,
183 GDALProgressFunc, void *pProgressData ) override;
184
185 CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
186 int *pnBuckets, GUIntBig ** ppanHistogram,
187 int bForce,
188 GDALProgressFunc, void *pProgressData) override;
189 CPLErr SetDefaultHistogram( double dfMin, double dfMax,
190 int nBuckets, GUIntBig *panHistogram ) override;
191
192 GDALRasterAttributeTable *GetDefaultRAT() override;
193 CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) override;
194
195 GDALRasterBand *GetMaskBand() override;
196 int GetMaskFlags() override;
197 CPLErr CreateMaskBand( int nFlags ) override;
198 bool IsMaskBand() const override;
199 GDALMaskValueRange GetMaskValueRange() const override;
200
201 CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
202 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 bHasSrcProjection = false;
227 bool m_bHasSrcSRS = false;
228 bool bHasSrcGeoTransform = false;
229 char *pszGCPProjection = nullptr;
230 int nGCPCount = 0;
231 GDAL_GCP *pasGCPList = nullptr;
232 CPLHashSet *metadataSet = nullptr;
233 CPLHashSet *metadataItemSet = nullptr;
234
235 mutable GDALProxyPoolCacheEntry* cacheEntry = nullptr;
236 char *m_pszOwner = nullptr;
237
238 GDALDataset *RefUnderlyingDataset(bool bForceOpen) const;
239
240 GDALProxyPoolDataset( const char* pszSourceDatasetDescription,
241 GDALAccess eAccess,
242 int bShared,
243 const char* pszOwner );
244
245 protected:
246 GDALDataset *RefUnderlyingDataset() const override;
247 void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) const override;
248
249 friend class GDALProxyPoolRasterBand;
250
251 public:
252 GDALProxyPoolDataset( const char* pszSourceDatasetDescription,
253 int nRasterXSize, int nRasterYSize,
254 GDALAccess eAccess = GA_ReadOnly,
255 int bShared = FALSE,
256 const char * pszProjectionRef = nullptr,
257 double * padfGeoTransform = nullptr,
258 const char* pszOwner = nullptr );
259
260
261 static GDALProxyPoolDataset* Create( const char* pszSourceDatasetDescription,
262 CSLConstList papszOpenOptions = nullptr,
263 GDALAccess eAccess = GA_ReadOnly,
264 int bShared = FALSE,
265 const char* pszOwner = nullptr );
266
267 ~GDALProxyPoolDataset() override;
268
269 void SetOpenOptions( CSLConstList papszOpenOptions );
270
271 // If size (nBlockXSize&nBlockYSize) parameters is zero
272 // they will be loaded when RefUnderlyingRasterBand function is called.
273 // But in this case we cannot use them in other non-virtual methods before
274 // RefUnderlyingRasterBand fist call.
275 void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize,
276 int nBlockYSize );
277
278 // Used by VRT SimpleSource to add a single GDALProxyPoolRasterBand while
279 // keeping all other bands initialized to a nullptr. This is under the assumption,
280 // VRT SimpleSource will not have to access any other bands than the one added.
281 void AddSrcBand(int nBand, GDALDataType eDataType, int nBlockXSize,
282 int nBlockYSize );
283 void FlushCache(bool bAtClosing) override;
284
285 const OGRSpatialReference* GetSpatialRef() const override;
286 CPLErr SetSpatialRef(const OGRSpatialReference* poSRS) override;
287
288 const char *_GetProjectionRef() override;
289 CPLErr _SetProjection( const char * ) override;
290
291 CPLErr GetGeoTransform( double * ) override;
292 CPLErr SetGeoTransform( double * ) override;
293
294 // Special behavior for the following methods : they return a pointer
295 // data type, that must be cached by the proxy, so it doesn't become invalid
296 // when the underlying object get closed.
297 char **GetMetadata( const char * pszDomain ) override;
298 const char *GetMetadataItem( const char * pszName,
299 const char * pszDomain ) override;
300
301 void *GetInternalHandle( const char * pszRequest ) override;
302
303 const char *_GetGCPProjection() override;
304 const OGRSpatialReference* GetGCPSpatialRef() const override;
305 const GDAL_GCP *GetGCPs() override;
306
307 private:
308 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset)
309 };
310
311 /* ******************************************************************** */
312 /* GDALProxyPoolRasterBand */
313 /* ******************************************************************** */
314
315 class GDALProxyPoolOverviewRasterBand;
316 class GDALProxyPoolMaskBand;
317
318 class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
319 {
320 private:
321 CPLHashSet *metadataSet = nullptr;
322 CPLHashSet *metadataItemSet = nullptr;
323 char *pszUnitType = nullptr;
324 char **papszCategoryNames = nullptr;
325 GDALColorTable *poColorTable = nullptr;
326
327 int nSizeProxyOverviewRasterBand = 0;
328 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand = nullptr;
329 GDALProxyPoolMaskBand *poProxyMaskBand = nullptr;
330
331 GDALRasterBand* RefUnderlyingRasterBand( bool bForceOpen ) const;
332
333 protected:
334 GDALRasterBand* RefUnderlyingRasterBand() const override;
335 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
336 const override;
337
338 friend class GDALProxyPoolOverviewRasterBand;
339 friend class GDALProxyPoolMaskBand;
340
341 public:
342 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS, int nBand,
343 GDALDataType eDataType,
344 int nBlockXSize, int nBlockYSize );
345 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
346 GDALRasterBand* poUnderlyingRasterBand );
347 ~GDALProxyPoolRasterBand() override;
348
349 void AddSrcMaskBandDescription( GDALDataType eDataType, int nBlockXSize,
350 int nBlockYSize );
351
352 void AddSrcMaskBandDescriptionFromUnderlying();
353
354 // Special behavior for the following methods : they return a pointer
355 // data type, that must be cached by the proxy, so it doesn't become invalid
356 // when the underlying object get closed.
357 char **GetMetadata( const char * pszDomain ) override;
358 const char *GetMetadataItem( const char * pszName,
359 const char * pszDomain ) override;
360 char **GetCategoryNames() override;
361 const char *GetUnitType() override;
362 GDALColorTable *GetColorTable() override;
363 GDALRasterBand *GetOverview( int ) override;
364 GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples ) override; // TODO
365 GDALRasterBand *GetMaskBand() override;
366
367 CPLErr FlushCache(bool bAtClosing) override;
368
369 private:
370 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand)
371 };
372
373 /* ******************************************************************** */
374 /* GDALProxyPoolOverviewRasterBand */
375 /* ******************************************************************** */
376
377 class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
378 {
379 private:
380 GDALProxyPoolRasterBand *poMainBand = nullptr;
381 int nOverviewBand = 0;
382
383 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
384 mutable int nRefCountUnderlyingMainRasterBand = 0;
385
386 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolOverviewRasterBand)
387
388 protected:
389 GDALRasterBand* RefUnderlyingRasterBand() const override;
390 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
391 const override;
392
393 public:
394 GDALProxyPoolOverviewRasterBand( GDALProxyPoolDataset* poDS,
395 GDALRasterBand* poUnderlyingOverviewBand,
396 GDALProxyPoolRasterBand* poMainBand,
397 int nOverviewBand );
398 ~GDALProxyPoolOverviewRasterBand() override;
399 };
400
401 /* ******************************************************************** */
402 /* GDALProxyPoolMaskBand */
403 /* ******************************************************************** */
404
405 class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
406 {
407 private:
408 GDALProxyPoolRasterBand *poMainBand = nullptr;
409
410 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
411 mutable int nRefCountUnderlyingMainRasterBand = 0;
412
413 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolMaskBand)
414
415 protected:
416 GDALRasterBand* RefUnderlyingRasterBand() const override;
417 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
418 const override;
419
420 public:
421 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
422 GDALRasterBand* poUnderlyingMaskBand,
423 GDALProxyPoolRasterBand* poMainBand );
424 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
425 GDALProxyPoolRasterBand* poMainBand,
426 GDALDataType eDataType,
427 int nBlockXSize, int nBlockYSize );
428 ~GDALProxyPoolMaskBand() override;
429
430 bool IsMaskBand() const override { return true; }
431 };
432
433 #endif
434
435 /* ******************************************************************** */
436 /* C types and methods declarations */
437 /* ******************************************************************** */
438
439 CPL_C_START
440
441 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
442
443 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(const char* pszSourceDatasetDescription,
444 int nRasterXSize, int nRasterYSize,
445 GDALAccess eAccess, int bShared,
446 const char * pszProjectionRef,
447 double * padfGeoTransform);
448
449 void CPL_DLL GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
450
451 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hProxyPoolDataset,
452 GDALDataType eDataType,
453 int nBlockXSize, int nBlockYSize);
454
455 CPL_C_END
456
457 #endif /* #ifndef DOXYGEN_SKIP */
458
459 #endif /* GDAL_PROXY_H_INCLUDED */
GDALRasterBand::IWriteBlock
virtual CPLErr IWriteBlock(int nBlockXOff, int nBlockYOff, void *pData)
Definition: gdalrasterband.cpp:616
GDALRasterBand::HasArbitraryOverviews
virtual int HasArbitraryOverviews()
Check for arbitrary overviews.
Definition: gdalrasterband.cpp:2435
GDALRasterBand::SetNoDataValue
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1814
GDALRasterBand::GetColorTable
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2338
GDALRasterBand::GetMaskValueRange
virtual GDALMaskValueRange GetMaskValueRange() const
Returns the range of values that a mask band can take.
Definition: gdalrasterband.cpp:6717
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:5214
GDALRasterBand::GetUnitType
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2915
GDALRasterBand::BuildOverviews
virtual CPLErr BuildOverviews(const char *pszResampling, int nOverviews, int *panOverviewList, GDALProgressFunc pfnProgress, void *pProgressData)
Build raster overview(s)
Definition: gdalrasterband.cpp:2672
GDALRasterBand::DeleteNoDataValue
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:2016
GDALRasterBand::GetOffset
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2713
GDALRasterBand::SetColorTable
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2387
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:3757
GDALRasterBand::IsMaskBand
virtual bool IsMaskBand() const
Returns whether a band is a mask band.
Definition: gdalrasterband.cpp:6667
GDALRasterBand::Fill
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue=0)
Fill this band with a constant value.
Definition: gdalrasterband.cpp:1379
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:7039
GDALDataset::GetDriver
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1315
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1524
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
GDALRasterBand::SetDefaultHistogram
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:6012
GDALRasterBand::SetUnitType
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:2963
GDALRasterBand::GetColorInterpretation
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:2246
GDALRasterBand::GetCategoryNames
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1525
GDALColorInterp
GDALColorInterp
Definition: gdal.h:204
GDALRasterBand
A single raster band (or channel).
Definition: gdal_priv.h:1150
GDALMaskValueRange
GDALMaskValueRange
Range of values found in a mask band.
Definition: gdal_priv.h:1140
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:2841
GDALDataset::GetMetadata
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4229
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:344
GDALDataset::SetGCPs
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1834
GDALDataset::GetGCPs
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1729
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:339
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:301
GDALRasterBand::GetOverviewCount
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2472
GDALRasterBand::SetDefaultRAT
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:6159
GDALDataset::GetInternalHandle
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1277
GDALRasterBand::GetMaskBand
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:6244
GDALMajorObject::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1053
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:3972
GUIntBig
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:233
GDALRasterBand::GetRasterSampleOverview
virtual GDALRasterBand * GetRasterSampleOverview(GUIntBig)
Fetch best sampling overview.
Definition: gdalrasterband.cpp:2564
GDALDataset::GetGCPSpatialRef
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1646
GDALDataset::SetSpatialRef
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition: gdaldataset.cpp:1059
GDAL_GCP
Ground Control Point.
Definition: gdal.h:732
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:303
GDALRasterBand::IReadBlock
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
GDALDataset::GetGCPCount
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1549
GDALRasterBand::GetOverview
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2514
GDALMajorObject::GetMetadataDomainList
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
GDALRasterBand::ComputeRasterMinMax
virtual CPLErr ComputeRasterMinMax(int, double *)
Compute the min/max values for a band.
Definition: gdalrasterband.cpp:5777
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:2868
GDALDataset::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3147
GSpacing
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:287
GDALRasterBand::GetNoDataValue
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1629
GDALAccess
GDALAccess
Definition: gdal.h:116
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:4052
GA_ReadOnly
@ GA_ReadOnly
Definition: gdal.h:117
GDALDataset::GetSpatialRef
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:928
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:230
GDALRasterBand::FlushCache
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush raster data cache.
Definition: gdalrasterband.cpp:1022
GDALDataset::SetGeoTransform
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1232
GDALDataset::GetFileList
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:3026
GDALRasterBand::GetDefaultRAT
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:6111
GDALRasterIOExtraArg
Structure to pass extra arguments to RasterIO() method, must be initialized with INIT_RASTERIO_EXTRA_...
Definition: gdal.h:161
GDALDataset::FlushCache
virtual void FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:435
GDALRasterBand::GetMinimum
virtual double GetMinimum(int *pbSuccess=nullptr)
Fetch the minimum value for this band.
Definition: gdalrasterband.cpp:2159
GDALRasterBand::GetScale
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2819
GDALRWFlag
GDALRWFlag
Definition: gdal.h:122
GDALRasterBand::SetColorInterpretation
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2291
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:209
GDALRasterBand::SetStatistics
virtual CPLErr SetStatistics(double dfMin, double dfMax, double dfMean, double dfStdDev)
Set statistics on band.
Definition: gdalrasterband.cpp:5710
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:1573
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:3215
GDALRasterBand::GetMaskFlags
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:6526
GDALDataset::GetGeoTransform
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1177
GDALRasterBand::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:6607
GDALRasterBand::SetMetadata
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
GDALRasterAttributeTable
Definition: gdal_rat.h:47
GDALRasterBand::GetMaximum
virtual double GetMaximum(int *pbSuccess=nullptr)
Fetch the maximum value for this band.
Definition: gdalrasterband.cpp:2066
GDALRasterBand::SetMetadataItem
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
GDALRasterBand::SetOffset
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2762
GDALDataset::GetMetadataDomainList
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4330
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:927
GDALColorTable
A color table / palette.
Definition: gdal_priv.h:1032