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 *,
55 int, const int *,
56 int, const int *,
57 GDALProgressFunc, void *,
58 CSLConstList papszOptions ) override;
59 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
60 void *, int, int, GDALDataType,
61 int, int *, GSpacing, GSpacing, GSpacing,
62 GDALRasterIOExtraArg* psExtraArg ) override;
63
64 public:
65 char **GetMetadataDomainList() override;
66 char **GetMetadata( const char * pszDomain ) override;
67 CPLErr SetMetadata( char ** papszMetadata,
68 const char * pszDomain ) override;
69 const char *GetMetadataItem( const char * pszName,
70 const char * pszDomain ) override;
71 CPLErr SetMetadataItem( const char * pszName,
72 const char * pszValue,
73 const char * pszDomain ) override;
74
75 void FlushCache(bool bAtClosing) override;
76
77 const OGRSpatialReference* GetSpatialRef() const override;
78 CPLErr SetSpatialRef(const OGRSpatialReference* poSRS) override;
79
80 CPLErr GetGeoTransform( double * ) override;
81 CPLErr SetGeoTransform( double * ) override;
82
83 void *GetInternalHandle( const char * ) override;
84 GDALDriver *GetDriver() override;
85 char **GetFileList() override;
86
87 int GetGCPCount() override;
88 const OGRSpatialReference* GetGCPSpatialRef() const override;
89 const GDAL_GCP *GetGCPs() override;
90 CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
91 const OGRSpatialReference * poGCP_SRS ) override;
92
93 CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
94 int nBufXSize, int nBufYSize,
95 GDALDataType eDT,
96 int nBandCount, int *panBandList,
97 char **papszOptions ) override;
98
99 CPLErr CreateMaskBand( int nFlags ) override;
100
101 private:
102 CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset)
103 };
104
105 /* ******************************************************************** */
106 /* GDALProxyRasterBand */
107 /* ******************************************************************** */
108
109 class CPL_DLL GDALProxyRasterBand : public GDALRasterBand
110 {
111 protected:
112 GDALProxyRasterBand() {}
113
114 virtual GDALRasterBand* RefUnderlyingRasterBand() const = 0;
115 virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) const;
116
117 CPLErr IReadBlock( int, int, void * ) override;
118 CPLErr IWriteBlock( int, int, void * ) override;
119 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
120 void *, int, int, GDALDataType,
121 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
122
123 public:
124 char **GetMetadataDomainList() override;
125 char **GetMetadata( const char * pszDomain ) override;
126 CPLErr SetMetadata( char ** papszMetadata,
127 const char * pszDomain ) override;
128 const char *GetMetadataItem( const char * pszName,
129 const char * pszDomain ) override;
130 CPLErr SetMetadataItem( const char * pszName,
131 const char * pszValue,
132 const char * pszDomain ) override;
133 CPLErr FlushCache(bool bAtClosing) override;
134 char **GetCategoryNames() override;
135 double GetNoDataValue( int *pbSuccess = nullptr ) override;
136 double GetMinimum( int *pbSuccess = nullptr ) override;
137 double GetMaximum(int *pbSuccess = nullptr ) override;
138 double GetOffset( int *pbSuccess = nullptr ) override;
139 double GetScale( int *pbSuccess = nullptr ) override;
140 const char *GetUnitType() override;
141 GDALColorInterp GetColorInterpretation() override;
142 GDALColorTable *GetColorTable() override;
143 CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) override;
144
145 CPLErr SetCategoryNames( char ** ) override;
146 CPLErr SetNoDataValue( double ) override;
147 CPLErr DeleteNoDataValue() override;
148 CPLErr SetColorTable( GDALColorTable * ) override;
149 CPLErr SetColorInterpretation( GDALColorInterp ) override;
150 CPLErr SetOffset( double ) override;
151 CPLErr SetScale( double ) override;
152 CPLErr SetUnitType( const char * ) override;
153
154 CPLErr GetStatistics( int bApproxOK, int bForce,
155 double *pdfMin, double *pdfMax,
156 double *pdfMean, double *padfStdDev ) override;
157 CPLErr ComputeStatistics( int bApproxOK,
158 double *pdfMin, double *pdfMax,
159 double *pdfMean, double *pdfStdDev,
160 GDALProgressFunc, void *pProgressData ) override;
161 CPLErr SetStatistics( double dfMin, double dfMax,
162 double dfMean, double dfStdDev ) override;
163 CPLErr ComputeRasterMinMax( int, double* ) override;
164
165 int HasArbitraryOverviews() override;
166 int GetOverviewCount() override;
167 GDALRasterBand *GetOverview( int ) override;
168 GDALRasterBand *GetRasterSampleOverview( GUIntBig ) override;
169 CPLErr BuildOverviews( const char *, int, const int *,
170 GDALProgressFunc, void *, CSLConstList papszOptions ) override;
171
172 CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
173 int nBufXSize, int nBufYSize,
174 GDALDataType eDT, char **papszOptions ) override;
175
176 CPLErr GetHistogram( double dfMin, double dfMax,
177 int nBuckets, GUIntBig * panHistogram,
178 int bIncludeOutOfRange, int bApproxOK,
179 GDALProgressFunc, void *pProgressData ) override;
180
181 CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
182 int *pnBuckets, GUIntBig ** ppanHistogram,
183 int bForce,
184 GDALProgressFunc, void *pProgressData) override;
185 CPLErr SetDefaultHistogram( double dfMin, double dfMax,
186 int nBuckets, GUIntBig *panHistogram ) override;
187
188 GDALRasterAttributeTable *GetDefaultRAT() override;
189 CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) override;
190
191 GDALRasterBand *GetMaskBand() override;
192 int GetMaskFlags() override;
193 CPLErr CreateMaskBand( int nFlags ) override;
194 bool IsMaskBand() const override;
195 GDALMaskValueRange GetMaskValueRange() const override;
196
197 CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
198 int *pnPixelSpace,
199 GIntBig *pnLineSpace,
200 char **papszOptions ) override;
201
202 private:
203 CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand)
204 };
205
206 /* ******************************************************************** */
207 /* GDALProxyPoolDataset */
208 /* ******************************************************************** */
209
210 typedef struct _GDALProxyPoolCacheEntry GDALProxyPoolCacheEntry;
211 class GDALProxyPoolRasterBand;
212
213 class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
214 {
215 private:
216 GIntBig responsiblePID = -1;
217
218 mutable char *pszProjectionRef = nullptr;
219 mutable OGRSpatialReference* m_poSRS = nullptr;
220 mutable OGRSpatialReference* m_poGCPSRS = nullptr;
221 double adfGeoTransform[6]{0,1,0,0,0,1};
222 bool m_bHasSrcSRS = false;
223 bool bHasSrcGeoTransform = false;
224 char *pszGCPProjection = nullptr;
225 int nGCPCount = 0;
226 GDAL_GCP *pasGCPList = nullptr;
227 CPLHashSet *metadataSet = nullptr;
228 CPLHashSet *metadataItemSet = nullptr;
229
230 mutable GDALProxyPoolCacheEntry* cacheEntry = nullptr;
231 char *m_pszOwner = nullptr;
232
233 GDALDataset *RefUnderlyingDataset(bool bForceOpen) const;
234
235 GDALProxyPoolDataset( const char* pszSourceDatasetDescription,
236 GDALAccess eAccess,
237 int bShared,
238 const char* pszOwner );
239
240 protected:
241 GDALDataset *RefUnderlyingDataset() const override;
242 void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) const override;
243
244 friend class GDALProxyPoolRasterBand;
245
246 public:
247 GDALProxyPoolDataset( const char* pszSourceDatasetDescription,
248 int nRasterXSize, int nRasterYSize,
249 GDALAccess eAccess = GA_ReadOnly,
250 int bShared = FALSE,
251 const char * pszProjectionRef = nullptr,
252 double * padfGeoTransform = nullptr,
253 const char* pszOwner = nullptr );
254
255
256 static GDALProxyPoolDataset* Create( const char* pszSourceDatasetDescription,
257 CSLConstList papszOpenOptions = nullptr,
258 GDALAccess eAccess = GA_ReadOnly,
259 int bShared = FALSE,
260 const char* pszOwner = nullptr );
261
262 ~GDALProxyPoolDataset() override;
263
264 void SetOpenOptions( CSLConstList papszOpenOptions );
265
266 // If size (nBlockXSize&nBlockYSize) parameters is zero
267 // they will be loaded when RefUnderlyingRasterBand function is called.
268 // But in this case we cannot use them in other non-virtual methods before
269 // RefUnderlyingRasterBand fist call.
270 void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize,
271 int nBlockYSize );
272
273 // Used by VRT SimpleSource to add a single GDALProxyPoolRasterBand while
274 // keeping all other bands initialized to a nullptr. This is under the assumption,
275 // VRT SimpleSource will not have to access any other bands than the one added.
276 void AddSrcBand(int nBand, GDALDataType eDataType, int nBlockXSize,
277 int nBlockYSize );
278 void FlushCache(bool bAtClosing) override;
279
280 const OGRSpatialReference* GetSpatialRef() const override;
281 CPLErr SetSpatialRef(const OGRSpatialReference* poSRS) override;
282
283 CPLErr GetGeoTransform( double * ) override;
284 CPLErr SetGeoTransform( double * ) override;
285
286 // Special behavior for the following methods : they return a pointer
287 // data type, that must be cached by the proxy, so it doesn't become invalid
288 // when the underlying object get closed.
289 char **GetMetadata( const char * pszDomain ) override;
290 const char *GetMetadataItem( const char * pszName,
291 const char * pszDomain ) override;
292
293 void *GetInternalHandle( const char * pszRequest ) override;
294
295 const OGRSpatialReference* GetGCPSpatialRef() const override;
296 const GDAL_GCP *GetGCPs() override;
297
298 private:
299 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset)
300 };
301
302 /* ******************************************************************** */
303 /* GDALProxyPoolRasterBand */
304 /* ******************************************************************** */
305
306 class GDALProxyPoolOverviewRasterBand;
307 class GDALProxyPoolMaskBand;
308
309 class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
310 {
311 private:
312 CPLHashSet *metadataSet = nullptr;
313 CPLHashSet *metadataItemSet = nullptr;
314 char *pszUnitType = nullptr;
315 char **papszCategoryNames = nullptr;
316 GDALColorTable *poColorTable = nullptr;
317
318 int nSizeProxyOverviewRasterBand = 0;
319 GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand = nullptr;
320 GDALProxyPoolMaskBand *poProxyMaskBand = nullptr;
321
322 GDALRasterBand* RefUnderlyingRasterBand( bool bForceOpen ) const;
323
324 protected:
325 GDALRasterBand* RefUnderlyingRasterBand() const override;
326 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
327 const override;
328
329 friend class GDALProxyPoolOverviewRasterBand;
330 friend class GDALProxyPoolMaskBand;
331
332 public:
333 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS, int nBand,
334 GDALDataType eDataType,
335 int nBlockXSize, int nBlockYSize );
336 GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
337 GDALRasterBand* poUnderlyingRasterBand );
338 ~GDALProxyPoolRasterBand() override;
339
340 void AddSrcMaskBandDescription( GDALDataType eDataType, int nBlockXSize,
341 int nBlockYSize );
342
343 void AddSrcMaskBandDescriptionFromUnderlying();
344
345 // Special behavior for the following methods : they return a pointer
346 // data type, that must be cached by the proxy, so it doesn't become invalid
347 // when the underlying object get closed.
348 char **GetMetadata( const char * pszDomain ) override;
349 const char *GetMetadataItem( const char * pszName,
350 const char * pszDomain ) override;
351 char **GetCategoryNames() override;
352 const char *GetUnitType() override;
353 GDALColorTable *GetColorTable() override;
354 GDALRasterBand *GetOverview( int ) override;
355 GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples ) override; // TODO
356 GDALRasterBand *GetMaskBand() override;
357
358 CPLErr FlushCache(bool bAtClosing) override;
359
360 private:
361 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand)
362 };
363
364 /* ******************************************************************** */
365 /* GDALProxyPoolOverviewRasterBand */
366 /* ******************************************************************** */
367
368 class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
369 {
370 private:
371 GDALProxyPoolRasterBand *poMainBand = nullptr;
372 int nOverviewBand = 0;
373
374 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
375 mutable int nRefCountUnderlyingMainRasterBand = 0;
376
377 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolOverviewRasterBand)
378
379 protected:
380 GDALRasterBand* RefUnderlyingRasterBand() const override;
381 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
382 const override;
383
384 public:
385 GDALProxyPoolOverviewRasterBand( GDALProxyPoolDataset* poDS,
386 GDALRasterBand* poUnderlyingOverviewBand,
387 GDALProxyPoolRasterBand* poMainBand,
388 int nOverviewBand );
389 ~GDALProxyPoolOverviewRasterBand() override;
390 };
391
392 /* ******************************************************************** */
393 /* GDALProxyPoolMaskBand */
394 /* ******************************************************************** */
395
396 class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
397 {
398 private:
399 GDALProxyPoolRasterBand *poMainBand = nullptr;
400
401 mutable GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
402 mutable int nRefCountUnderlyingMainRasterBand = 0;
403
404 CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolMaskBand)
405
406 protected:
407 GDALRasterBand* RefUnderlyingRasterBand() const override;
408 void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
409 const override;
410
411 public:
412 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
413 GDALRasterBand* poUnderlyingMaskBand,
414 GDALProxyPoolRasterBand* poMainBand );
415 GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
416 GDALProxyPoolRasterBand* poMainBand,
417 GDALDataType eDataType,
418 int nBlockXSize, int nBlockYSize );
419 ~GDALProxyPoolMaskBand() override;
420
421 bool IsMaskBand() const override { return true; }
422 };
423
424 #endif
425
426 /* ******************************************************************** */
427 /* C types and methods declarations */
428 /* ******************************************************************** */
429
430 CPL_C_START
431
432 typedef struct GDALProxyPoolDatasetHS *GDALProxyPoolDatasetH;
433
434 GDALProxyPoolDatasetH CPL_DLL GDALProxyPoolDatasetCreate(const char* pszSourceDatasetDescription,
435 int nRasterXSize, int nRasterYSize,
436 GDALAccess eAccess, int bShared,
437 const char * pszProjectionRef,
438 double * padfGeoTransform);
439
440 void CPL_DLL GDALProxyPoolDatasetDelete(GDALProxyPoolDatasetH hProxyPoolDataset);
441
442 void CPL_DLL GDALProxyPoolDatasetAddSrcBandDescription( GDALProxyPoolDatasetH hProxyPoolDataset,
443 GDALDataType eDataType,
444 int nBlockXSize, int nBlockYSize);
445
446 CPL_C_END
447
448 #endif /* #ifndef DOXYGEN_SKIP */
449
450 #endif /* GDAL_PROXY_H_INCLUDED */
GDALRasterBand::IWriteBlock
virtual CPLErr IWriteBlock(int nBlockXOff, int nBlockYOff, void *pData)
Definition: gdalrasterband.cpp:615
GDALRasterBand::HasArbitraryOverviews
virtual int HasArbitraryOverviews()
Check for arbitrary overviews.
Definition: gdalrasterband.cpp:2471
GDALRasterBand::SetNoDataValue
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1850
GDALRasterBand::GetColorTable
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2374
GDALRasterBand::GetMaskValueRange
virtual GDALMaskValueRange GetMaskValueRange() const
Returns the range of values that a mask band can take.
Definition: gdalrasterband.cpp:7232
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:5390
GDALRasterBand::GetUnitType
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2954
GDALRasterBand::DeleteNoDataValue
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:2052
GDALRasterBand::GetOffset
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2752
GDALRasterBand::SetColorTable
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2423
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:3825
GDALRasterBand::IsMaskBand
virtual bool IsMaskBand() const
Returns whether a band is a mask band.
Definition: gdalrasterband.cpp:7182
GDALRasterBand::Fill
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue=0)
Fill this band with a constant value.
Definition: gdalrasterband.cpp:1415
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:7554
GDALDataset::GetDriver
virtual GDALDriver * GetDriver(void)
Fetch the driver to which this dataset relates.
Definition: gdaldataset.cpp:1234
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1558
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:6488
GDALRasterBand::SetUnitType
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:3002
GDALRasterBand::GetColorInterpretation
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:2282
GDALRasterBand::GetCategoryNames
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1561
GDALColorInterp
GDALColorInterp
Definition: gdal.h:204
GDALRasterBand
A single raster band (or channel).
Definition: gdal_priv.h:1179
GDALMaskValueRange
GDALMaskValueRange
Range of values found in a mask band.
Definition: gdal_priv.h:1152
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:2722
GDALDataset::GetMetadata
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4113
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:343
GDALDataset::SetGCPs
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1714
GDALDataset::GetGCPs
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1609
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:342
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:304
GDALRasterBand::GetOverviewCount
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2508
GDALRasterBand::SetDefaultRAT
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:6635
GDALDataset::GetInternalHandle
virtual void * GetInternalHandle(const char *pszHandleName)
Fetch a format specific internally meaningful handle.
Definition: gdaldataset.cpp:1196
GDALRasterBand::GetMaskBand
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:6720
GDALMajorObject::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:248
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1056
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:4040
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:2600
GDALDataset::GetGCPSpatialRef
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1551
GDALDataset::SetSpatialRef
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition: gdaldataset.cpp:1017
GDAL_GCP
Ground Control Point.
Definition: gdal.h:892
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:306
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:1468
GDALRasterBand::GetOverview
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2550
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:6164
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:2907
GDALRasterBand::BuildOverviews
virtual CPLErr BuildOverviews(const char *pszResampling, int nOverviews, const int *panOverviewList, GDALProgressFunc pfnProgress, void *pProgressData, CSLConstList papszOptions)
Build raster overview(s)
Definition: gdalrasterband.cpp:2710
GDALDataset::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3028
GSpacing
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:292
GDALRasterBand::GetNoDataValue
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1665
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:4120
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:911
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:1058
GDALDataset::SetGeoTransform
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1151
GDALDataset::GetFileList
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2907
GDALRasterBand::GetDefaultRAT
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:6587
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:434
GDALRasterBand::GetMinimum
virtual double GetMinimum(int *pbSuccess=nullptr)
Fetch the minimum value for this band.
Definition: gdalrasterband.cpp:2195
GDALRasterBand::GetScale
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2858
GDALRWFlag
GDALRWFlag
Definition: gdal.h:122
GDALRasterBand::SetColorInterpretation
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2327
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:208
GDALRasterBand::SetStatistics
virtual CPLErr SetStatistics(double dfMin, double dfMax, double dfMean, double dfStdDev)
Set statistics on band.
Definition: gdalrasterband.cpp:5888
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:1609
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:3254
GDALRasterBand::GetMaskFlags
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:7041
GDALDataset::GetGeoTransform
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1096
GDALRasterBand::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:7122
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:2102
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:2801
GDALDataset::GetMetadataDomainList
char ** GetMetadataDomainList() override
Fetch list of metadata domains.
Definition: gdaldataset.cpp:4214
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:930
GDALColorTable
A color table / palette.
Definition: gdal_priv.h:1044