GDAL

- Main Page
- Related Pages
- Classes
- Files
- Download
- Issue Tracker

- File List
- File Members

gdal_priv.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id$
3 *
4 * Name: gdal_priv.h
5 * Project: GDAL Core
6 * Purpose: GDAL Core C++/Private declarations.
7 * Author: Frank Warmerdam, warmerdam@pobox.com
8 *
9 ******************************************************************************
10 * Copyright (c) 1998, Frank Warmerdam
11 * Copyright (c) 2007-2014, Even Rouault <even dot rouault at mines-paris dot org>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef GDAL_PRIV_H_INCLUDED
33 #define GDAL_PRIV_H_INCLUDED
34
41 /* -------------------------------------------------------------------- */
42 /* Predeclare various classes before pulling in gdal.h, the */
43 /* public declarations. */
44 /* -------------------------------------------------------------------- */
45 class GDALMajorObject;
46 class GDALDataset;
47 class GDALRasterBand;
48 class GDALDriver;
49 class GDALRasterAttributeTable;
50 class GDALProxyDataset;
51 class GDALProxyRasterBand;
52 class GDALAsyncReader;
53
54 /* -------------------------------------------------------------------- */
55 /* Pull in the public declarations. This gets the C apis, and */
56 /* also various constants. However, we will still get to */
57 /* provide the real class definitions for the GDAL classes. */
58 /* -------------------------------------------------------------------- */
59
60 #include "gdal.h"
61 #include "gdal_frmts.h"
62 #include "cpl_vsi.h"
63 #include "cpl_conv.h"
64 #include "cpl_string.h"
65 #include "cpl_minixml.h"
66 #include "cpl_multiproc.h"
67 #include "cpl_atomic_ops.h"
68
69 #include <cmath>
70 #include <iterator>
71 #include <limits>
72 #include <map>
73 #include <memory>
74 #include <vector>
75
76 #include "ogr_core.h"
77 #include "ogr_feature.h"
78
80 #define GMO_VALID 0x0001
81 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
82 #define GMO_SUPPORT_MD 0x0004
83 #define GMO_SUPPORT_MDMD 0x0008
84 #define GMO_MD_DIRTY 0x0010
85 #define GMO_PAM_CLASS 0x0020
86
88 /************************************************************************/
89 /* GDALMultiDomainMetadata */
90 /************************************************************************/
91
93 class CPL_DLL GDALMultiDomainMetadata
94 {
95 private:
96 char **papszDomainList;
97 CPLStringList **papoMetadataLists;
98
99 public:
100 GDALMultiDomainMetadata();
101 ~GDALMultiDomainMetadata();
102
103 int XMLInit( CPLXMLNode *psMetadata, int bMerge );
104 CPLXMLNode *Serialize();
105
106 char **GetDomainList() { return papszDomainList; }
107
108 char **GetMetadata( const char * pszDomain = "" );
109 CPLErr SetMetadata( char ** papszMetadata,
110 const char * pszDomain = "" );
111 const char *GetMetadataItem( const char * pszName,
112 const char * pszDomain = "" );
113 CPLErr SetMetadataItem( const char * pszName,
114 const char * pszValue,
115 const char * pszDomain = "" );
116
117 void Clear();
118
119 private:
120 CPL_DISALLOW_COPY_ASSIGN(GDALMultiDomainMetadata)
121 };
123
124 /* ******************************************************************** */
125 /* GDALMajorObject */
126 /* */
127 /* Base class providing metadata, description and other */
128 /* services shared by major objects. */
129 /* ******************************************************************** */
130
132 class CPL_DLL GDALMajorObject
133 {
134 protected:
136 int nFlags; // GMO_* flags.
137 CPLString sDescription;
138 GDALMultiDomainMetadata oMDMD;
139
141
142 char **BuildMetadataDomainList( char** papszList,
143 int bCheckNonEmpty, ... ) CPL_NULL_TERMINATED;
144 public:
145 GDALMajorObject();
146 virtual ~GDALMajorObject();
147
148 int GetMOFlags() const;
149 void SetMOFlags( int nFlagsIn );
150
151 virtual const char *GetDescription() const;
152 virtual void SetDescription( const char * );
153
154 virtual char **GetMetadataDomainList();
155
156 virtual char **GetMetadata( const char * pszDomain = "" );
157 virtual CPLErr SetMetadata( char ** papszMetadata,
158 const char * pszDomain = "" );
159 virtual const char *GetMetadataItem( const char * pszName,
160 const char * pszDomain = "" );
161 virtual CPLErr SetMetadataItem( const char * pszName,
162 const char * pszValue,
163 const char * pszDomain = "" );
164
168 static inline GDALMajorObjectH ToHandle(GDALMajorObject* poMajorObject)
169 { return static_cast<GDALMajorObjectH>(poMajorObject); }
170
174 static inline GDALMajorObject* FromHandle(GDALMajorObjectH hMajorObject)
175 { return static_cast<GDALMajorObject*>(hMajorObject); }
176 };
177
178 /* ******************************************************************** */
179 /* GDALDefaultOverviews */
180 /* ******************************************************************** */
181
183 class CPL_DLL GDALDefaultOverviews
184 {
185 friend class GDALDataset;
186
187 GDALDataset *poDS;
188 GDALDataset *poODS;
189
190 CPLString osOvrFilename;
191
192 bool bOvrIsAux;
193
194 bool bCheckedForMask;
195 bool bOwnMaskDS;
196 GDALDataset *poMaskDS;
197
198 // For "overview datasets" we record base level info so we can
199 // find our way back to get overview masks.
200 GDALDataset *poBaseDS;
201
202 // Stuff for deferred initialize/overviewscans.
203 bool bCheckedForOverviews;
204 void OverviewScan();
205 char *pszInitName;
206 bool bInitNameIsOVR;
207 char **papszInitSiblingFiles;
208
209 public:
210 GDALDefaultOverviews();
211 ~GDALDefaultOverviews();
212
213 void Initialize( GDALDataset *poDSIn, const char *pszName = nullptr,
214 char **papszSiblingFiles = nullptr,
215 int bNameIsOVR = FALSE );
216
217 void TransferSiblingFiles( char** papszSiblingFiles );
218
219 int IsInitialized();
220
221 int CloseDependentDatasets();
222
223 // Overview Related
224
225 int GetOverviewCount( int nBand );
226 GDALRasterBand *GetOverview( int nBand, int iOverview );
227
228 CPLErr BuildOverviews( const char * pszBasename,
229 const char * pszResampling,
230 int nOverviews, int * panOverviewList,
231 int nBands, int * panBandList,
232 GDALProgressFunc pfnProgress,
233 void *pProgressData );
234
235 CPLErr BuildOverviewsSubDataset( const char * pszPhysicalFile,
236 const char * pszResampling,
237 int nOverviews, int * panOverviewList,
238 int nBands, int * panBandList,
239 GDALProgressFunc pfnProgress,
240 void *pProgressData );
241
242 CPLErr CleanOverviews();
243
244 // Mask Related
245
246 CPLErr CreateMaskBand( int nFlags, int nBand = -1 );
247 GDALRasterBand *GetMaskBand( int nBand );
248 int GetMaskFlags( int nBand );
249
250 int HaveMaskFile( char **papszSiblings = nullptr,
251 const char *pszBasename = nullptr );
252
253 char** GetSiblingFiles() { return papszInitSiblingFiles; }
254
255 private:
256 CPL_DISALLOW_COPY_ASSIGN(GDALDefaultOverviews)
257 };
259
260 /* ******************************************************************** */
261 /* GDALOpenInfo */
262 /* ******************************************************************** */
263
265 class CPL_DLL GDALOpenInfo
266 {
267 bool bHasGotSiblingFiles;
268 char **papszSiblingFiles;
269 int nHeaderBytesTried;
270
271 public:
272 GDALOpenInfo( const char * pszFile, int nOpenFlagsIn,
273 const char * const * papszSiblingFiles = nullptr );
274 ~GDALOpenInfo( void );
275
277 char *pszFilename;
279 char** papszOpenOptions;
280
282 GDALAccess eAccess;
284 int nOpenFlags;
285
287 int bStatOK;
289 int bIsDirectory;
290
292 VSILFILE *fpL;
293
295 int nHeaderBytes;
297 GByte *pabyHeader;
298
300 const char* const* papszAllowedDrivers;
301
302 int TryToIngest(int nBytes);
303 char **GetSiblingFiles();
304 char **StealSiblingFiles();
305 bool AreSiblingFilesLoaded() const;
306
307 private:
308 CPL_DISALLOW_COPY_ASSIGN(GDALOpenInfo)
309 };
310
311 /* ******************************************************************** */
312 /* GDALDataset */
313 /* ******************************************************************** */
314
315 class OGRLayer;
316 class OGRGeometry;
317 class OGRSpatialReference;
318 class OGRStyleTable;
319 class swq_select;
320 class swq_select_parse_options;
321
323 typedef struct GDALSQLParseInfo GDALSQLParseInfo;
325
326 #ifdef DETECT_OLD_IRASTERIO
327 typedef void signature_changed;
328 #endif
329
331 #ifdef GDAL_COMPILATION
332 #define OPTIONAL_OUTSIDE_GDAL(val)
333 #else
334 #define OPTIONAL_OUTSIDE_GDAL(val) = val
335 #endif
336
339 class CPL_DLL GDALDataset : public GDALMajorObject
340 {
341 friend GDALDatasetH CPL_STDCALL GDALOpenEx( const char* pszFilename,
342 unsigned int nOpenFlags,
343 const char* const* papszAllowedDrivers,
344 const char* const* papszOpenOptions,
345 const char* const* papszSiblingFiles );
346 friend void CPL_STDCALL GDALClose( GDALDatasetH hDS );
347
348 friend class GDALDriver;
349 friend class GDALDefaultOverviews;
350 friend class GDALProxyDataset;
351 friend class GDALDriverManager;
352
353 void AddToDatasetOpenList();
354
355 void Init( bool bForceCachedIO );
356
357 protected:
359 GDALDriver *poDriver;
360 GDALAccess eAccess;
361
362 // Stored raster information.
363 int nRasterXSize;
364 int nRasterYSize;
365 int nBands;
366 GDALRasterBand **papoBands;
367
368 int nOpenFlags;
369
370 int nRefCount;
371 bool bForceCachedIO;
372 bool bShared;
373 bool bIsInternal;
374 bool bSuppressOnClose;
375
376 GDALDataset(void);
377 explicit GDALDataset(int bForceCachedIO);
378
379 void RasterInitialize( int, int );
380 void SetBand( int, GDALRasterBand * );
381
382 GDALDefaultOverviews oOvManager;
383
384 virtual CPLErr IBuildOverviews( const char *, int, int *,
385 int, int *, GDALProgressFunc, void * );
386
387 #ifdef DETECT_OLD_IRASTERIO
388 virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int,
389 void *, int, int, GDALDataType,
390 int, int *, int, int, int ) {};
391 #endif
392
393 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
394 void *, int, int, GDALDataType,
395 int, int *, GSpacing, GSpacing, GSpacing,
396 GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
397
398 CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
399 void *, int, int, GDALDataType,
400 int, int *, GSpacing, GSpacing, GSpacing,
401 GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
402 void BlockBasedFlushCache();
403
404 CPLErr BandBasedRasterIO( GDALRWFlag eRWFlag,
405 int nXOff, int nYOff, int nXSize, int nYSize,
406 void * pData, int nBufXSize, int nBufYSize,
407 GDALDataType eBufType,
408 int nBandCount, int *panBandMap,
409 GSpacing nPixelSpace, GSpacing nLineSpace,
410 GSpacing nBandSpace,
411 GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
412
413 CPLErr RasterIOResampled( GDALRWFlag eRWFlag,
414 int nXOff, int nYOff, int nXSize, int nYSize,
415 void * pData, int nBufXSize, int nBufYSize,
416 GDALDataType eBufType,
417 int nBandCount, int *panBandMap,
418 GSpacing nPixelSpace, GSpacing nLineSpace,
419 GSpacing nBandSpace,
420 GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
421
422 CPLErr ValidateRasterIOOrAdviseReadParameters(
423 const char* pszCallingFunc,
424 int* pbStopProcessingOnCENone,
425 int nXOff, int nYOff, int nXSize, int nYSize,
426 int nBufXSize, int nBufYSize,
427 int nBandCount, int *panBandMap);
428
429 CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
430 int nXOff, int nYOff, int nXSize, int nYSize,
431 void * pData, int nBufXSize, int nBufYSize,
432 GDALDataType eBufType,
433 int nBandCount, int *panBandMap,
434 GSpacing nPixelSpace, GSpacing nLineSpace,
435 GSpacing nBandSpace,
436 GDALRasterIOExtraArg* psExtraArg,
437 int* pbTried);
438
440 virtual int CloseDependentDatasets();
442 int ValidateLayerCreationOptions( const char* const* papszLCO );
443
444 char **papszOpenOptions;
445
446 friend class GDALRasterBand;
447
448 // The below methods related to read write mutex are fragile logic, and
449 // should not be used by out-of-tree code if possible.
450 int EnterReadWrite(GDALRWFlag eRWFlag);
451 void LeaveReadWrite();
452 void InitRWLock();
453
454 void TemporarilyDropReadWriteLock();
455 void ReacquireReadWriteLock();
456
457 void DisableReadWriteMutex();
458
459 int AcquireMutex();
460 void ReleaseMutex();
462
463 public:
464 ~GDALDataset() override;
465
466 int GetRasterXSize();
467 int GetRasterYSize();
468 int GetRasterCount();
469 GDALRasterBand *GetRasterBand( int );
470
472 class CPL_DLL Bands
473 {
474 private:
475
476 friend class GDALDataset;
477 GDALDataset* m_poSelf;
478 explicit Bands(GDALDataset* poSelf): m_poSelf(poSelf) {}
479
480 class CPL_DLL Iterator
481 {
482 struct Private;
483 std::unique_ptr<Private> m_poPrivate;
484 public:
485 Iterator(GDALDataset* poDS, bool bStart);
486 Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
487 Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
488 ~Iterator();
489 GDALRasterBand* operator*();
490 Iterator& operator++();
491 bool operator!=(const Iterator& it) const;
492 };
493
494 public:
495
496 const Iterator begin() const;
497
498 const Iterator end() const;
499
500 size_t size() const;
501
502 GDALRasterBand* operator[](int iBand);
503 GDALRasterBand* operator[](size_t iBand);
504 };
505
506 Bands GetBands();
507
508 virtual void FlushCache(void);
509
510 virtual const char *GetProjectionRef(void);
511 virtual CPLErr SetProjection( const char * pszProjection );
512
513 virtual CPLErr GetGeoTransform( double * padfTransform );
514 virtual CPLErr SetGeoTransform( double * padfTransform );
515
516 virtual CPLErr AddBand( GDALDataType eType,
517 char **papszOptions=nullptr );
518
519 virtual void *GetInternalHandle( const char * pszHandleName );
520 virtual GDALDriver *GetDriver(void);
521 virtual char **GetFileList(void);
522
523 virtual const char* GetDriverName();
524
525 virtual int GetGCPCount();
526 virtual const char *GetGCPProjection();
527 virtual const GDAL_GCP *GetGCPs();
528 virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
529 const char *pszGCPProjection );
530
531 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
532 int nBufXSize, int nBufYSize,
533 GDALDataType eDT,
534 int nBandCount, int *panBandList,
535 char **papszOptions );
536
537 virtual CPLErr CreateMaskBand( int nFlagsIn );
538
539 virtual GDALAsyncReader*
540 BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize,
541 void *pBuf, int nBufXSize, int nBufYSize,
542 GDALDataType eBufType,
543 int nBandCount, int* panBandMap,
544 int nPixelSpace, int nLineSpace, int nBandSpace,
545 char **papszOptions);
546 virtual void EndAsyncReader(GDALAsyncReader *);
547
548 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
549 void *, int, int, GDALDataType,
550 int, int *, GSpacing, GSpacing, GSpacing,
551 GDALRasterIOExtraArg* psExtraArg
552 #ifndef DOXYGEN_SKIP
553 OPTIONAL_OUTSIDE_GDAL(nullptr)
554 #endif
555 ) CPL_WARN_UNUSED_RESULT;
556
557 int Reference();
558 int Dereference();
559 int ReleaseRef();
560
564 GDALAccess GetAccess() const { return eAccess; }
565
566 int GetShared() const;
567 void MarkAsShared();
568
570 void MarkSuppressOnClose() { bSuppressOnClose = true; }
571
575 char **GetOpenOptions() { return papszOpenOptions; }
576
577 static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
578
579 CPLErr BuildOverviews( const char *, int, int *,
580 int, int *, GDALProgressFunc, void * );
581
582 void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
583
584 char ** GetMetadata(const char * pszDomain = "") override;
585
586 // Only defined when Doxygen enabled
587 #ifdef DOXYGEN_SKIP
588 CPLErr SetMetadata( char ** papszMetadata,
589 const char * pszDomain ) override;
590 const char *GetMetadataItem( const char * pszName,
591 const char * pszDomain ) override;
592 CPLErr SetMetadataItem( const char * pszName,
593 const char * pszValue,
594 const char * pszDomain ) override;
595 #endif
596
597 char **GetMetadataDomainList() override;
598
602 static inline GDALDatasetH ToHandle(GDALDataset* poDS)
603 { return static_cast<GDALDatasetH>(poDS); }
604
608 static inline GDALDataset* FromHandle(GDALDatasetH hDS)
609 { return static_cast<GDALDataset*>(hDS); }
610
614 static GDALDataset* Open( const char* pszFilename,
615 unsigned int nOpenFlags = 0,
616 const char* const* papszAllowedDrivers = nullptr,
617 const char* const* papszOpenOptions = nullptr,
618 const char* const* papszSiblingFiles = nullptr )
619 {
620 return FromHandle(GDALOpenEx(pszFilename, nOpenFlags,
621 papszAllowedDrivers,
622 papszOpenOptions,
623 papszSiblingFiles));
624 }
625
627 struct FeatureLayerPair
628 {
630 OGRFeatureUniquePtr feature;
631
633 OGRLayer* layer;
634 };
635
636 private:
637 class Private;
638 Private *m_poPrivate;
639
640 OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
641 OGRGeometry *poSpatialFilter,
642 const char *pszDialect,
643 swq_select_parse_options* poSelectParseOptions);
644 CPLStringList oDerivedMetadataList;
645
646 public:
647
648 virtual int GetLayerCount();
649 virtual OGRLayer *GetLayer(int iLayer);
650
654 class CPL_DLL Layers
655 {
656 private:
657
658 friend class GDALDataset;
659 GDALDataset* m_poSelf;
660 explicit Layers(GDALDataset* poSelf): m_poSelf(poSelf) {}
661
662 public:
663
667 class CPL_DLL Iterator
668 {
669 struct Private;
670 std::unique_ptr<Private> m_poPrivate;
671 public:
672
673 using value_type = OGRLayer*;
674 using reference = OGRLayer*;
675 using difference_type = void;
676 using pointer = void;
677 using iterator_category = std::input_iterator_tag;
679 Iterator();
680 Iterator(GDALDataset* poDS, bool bStart);
681 Iterator(const Iterator& oOther);
682 Iterator(Iterator&& oOther);
683 ~Iterator();
685 Iterator& operator=(const Iterator& oOther);
686 Iterator& operator=(Iterator&& oOther);
688 OGRLayer* operator*() const;
689 Iterator& operator++();
690 Iterator operator++(int);
691 bool operator!=(const Iterator& it) const;
692 };
693
694 Iterator begin() const;
695 Iterator end() const;
696
697 size_t size() const;
698
699 OGRLayer* operator[](int iLayer);
700 OGRLayer* operator[](size_t iLayer);
701 OGRLayer* operator[](const char* pszLayername);
702 };
703
704 Layers GetLayers();
705
706 virtual OGRLayer *GetLayerByName(const char *);
707 virtual OGRErr DeleteLayer(int iLayer);
708
709 virtual void ResetReading();
710 virtual OGRFeature* GetNextFeature( OGRLayer** ppoBelongingLayer,
711 double* pdfProgressPct,
712 GDALProgressFunc pfnProgress,
713 void* pProgressData );
714
715
717 class CPL_DLL Features
718 {
719 private:
720
721 friend class GDALDataset;
722 GDALDataset* m_poSelf;
723 explicit Features(GDALDataset* poSelf): m_poSelf(poSelf) {}
724
725 class CPL_DLL Iterator
726 {
727 struct Private;
728 std::unique_ptr<Private> m_poPrivate;
729 public:
730 Iterator(GDALDataset* poDS, bool bStart);
731 Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
732 Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
733 ~Iterator();
734 const FeatureLayerPair& operator*() const;
735 Iterator& operator++();
736 bool operator!=(const Iterator& it) const;
737 };
738
739 public:
740
741 const Iterator begin() const;
742
743 const Iterator end() const;
744 };
745
746 Features GetFeatures();
747
748 virtual int TestCapability( const char * );
749
750 virtual OGRLayer *CreateLayer( const char *pszName,
751 OGRSpatialReference *poSpatialRef = nullptr,
752 OGRwkbGeometryType eGType = wkbUnknown,
753 char ** papszOptions = nullptr );
754 virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
755 const char *pszNewName,
756 char **papszOptions = nullptr );
757
758 virtual OGRStyleTable *GetStyleTable();
759 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
760
761 virtual void SetStyleTable(OGRStyleTable *poStyleTable);
762
763 virtual OGRLayer * ExecuteSQL( const char *pszStatement,
764 OGRGeometry *poSpatialFilter,
765 const char *pszDialect );
766 virtual void ReleaseResultSet( OGRLayer * poResultsSet );
767
768 int GetRefCount() const;
769 int GetSummaryRefCount() const;
770 OGRErr Release();
771
772 virtual OGRErr StartTransaction(int bForce=FALSE);
773 virtual OGRErr CommitTransaction();
774 virtual OGRErr RollbackTransaction();
775
777 static int IsGenericSQLDialect(const char* pszDialect);
778
779 // Semi-public methods. Only to be used by in-tree drivers.
780 GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
781 swq_select_parse_options* poSelectParseOptions);
782 static void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
783 OGRLayer * ExecuteSQL( const char *pszStatement,
784 OGRGeometry *poSpatialFilter,
785 const char *pszDialect,
786 swq_select_parse_options* poSelectParseOptions);
788
789 protected:
790 virtual OGRLayer *ICreateLayer( const char *pszName,
791 OGRSpatialReference *poSpatialRef = nullptr,
792 OGRwkbGeometryType eGType = wkbUnknown,
793 char ** papszOptions = nullptr );
794
796 OGRErr ProcessSQLCreateIndex( const char * );
797 OGRErr ProcessSQLDropIndex( const char * );
798 OGRErr ProcessSQLDropTable( const char * );
799 OGRErr ProcessSQLAlterTableAddColumn( const char * );
800 OGRErr ProcessSQLAlterTableDropColumn( const char * );
801 OGRErr ProcessSQLAlterTableAlterColumn( const char * );
802 OGRErr ProcessSQLAlterTableRenameColumn( const char * );
803
804 OGRStyleTable *m_poStyleTable;
806
807 private:
808 CPL_DISALLOW_COPY_ASSIGN(GDALDataset)
809 };
810
812 struct CPL_DLL GDALDatasetUniquePtrDeleter
813 {
814 void operator()(GDALDataset* poDataset) const
815 { GDALClose(poDataset); }
816 };
818
824 typedef std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter> GDALDatasetUniquePtr;
825
826 /* ******************************************************************** */
827 /* GDALRasterBlock */
828 /* ******************************************************************** */
829
834 class CPL_DLL GDALRasterBlock
835 {
836 friend class GDALAbstractBandBlockCache;
837
838 GDALDataType eType;
839
840 bool bDirty;
841 volatile int nLockCount;
842
843 int nXOff;
844 int nYOff;
845
846 int nXSize;
847 int nYSize;
848
849 void *pData;
850
851 GDALRasterBand *poBand;
852
853 GDALRasterBlock *poNext;
854 GDALRasterBlock *poPrevious;
855
856 bool bMustDetach;
857
858 void Detach_unlocked( void );
859 void Touch_unlocked( void );
860
861 void RecycleFor( int nXOffIn, int nYOffIn );
862
863 public:
864 GDALRasterBlock( GDALRasterBand *, int, int );
865 GDALRasterBlock( int nXOffIn, int nYOffIn ); /* only for lookup purpose */
866 virtual ~GDALRasterBlock();
867
868 CPLErr Internalize( void );
869 void Touch( void );
870 void MarkDirty( void );
871 void MarkClean( void );
873 int AddLock( void ) { return CPLAtomicInc(&nLockCount); }
875 int DropLock( void ) { return CPLAtomicDec(&nLockCount); }
876 void Detach();
877
878 CPLErr Write();
879
883 GDALDataType GetDataType() const { return eType; }
887 int GetXOff() const { return nXOff; }
891 int GetYOff() const { return nYOff; }
895 int GetXSize() const { return nXSize; }
899 int GetYSize() const { return nYSize; }
903 int GetDirty() const { return bDirty; }
907 void *GetDataRef( void ) { return pData; }
911 int GetBlockSize() const {
912 return nXSize * nYSize * GDALGetDataTypeSizeBytes(eType); }
913
914 int TakeLock();
915 int DropLockForRemovalFromStorage();
916
919 GDALRasterBand *GetBand() { return poBand; }
920
921 static void FlushDirtyBlocks();
922 static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE);
923 static void Verify();
924
925 static void EnterDisableDirtyBlockFlush();
926 static void LeaveDisableDirtyBlockFlush();
927
928 #ifdef notdef
929 static void CheckNonOrphanedBlocks(GDALRasterBand* poBand);
930 void DumpBlock();
931 static void DumpAll();
932 #endif
933
934 /* Should only be called by GDALDestroyDriverManager() */
936 static void DestroyRBMutex();
938
939 private:
940 CPL_DISALLOW_COPY_ASSIGN(GDALRasterBlock)
941 };
942
943 /* ******************************************************************** */
944 /* GDALColorTable */
945 /* ******************************************************************** */
946
949 class CPL_DLL GDALColorTable
950 {
951 GDALPaletteInterp eInterp;
952
953 std::vector<GDALColorEntry> aoEntries;
954
955 public:
956 explicit GDALColorTable( GDALPaletteInterp = GPI_RGB );
957 ~GDALColorTable();
958
959 GDALColorTable *Clone() const;
960 int IsSame(const GDALColorTable* poOtherCT) const;
961
962 GDALPaletteInterp GetPaletteInterpretation() const;
963
964 int GetColorEntryCount() const;
965 const GDALColorEntry *GetColorEntry( int ) const;
966 int GetColorEntryAsRGB( int, GDALColorEntry * ) const;
967 void SetColorEntry( int, const GDALColorEntry * );
968 int CreateColorRamp( int, const GDALColorEntry * ,
969 int, const GDALColorEntry * );
970
974 static inline GDALColorTableH ToHandle(GDALColorTable* poCT)
975 { return static_cast<GDALColorTableH>(poCT); }
976
980 static inline GDALColorTable* FromHandle(GDALColorTableH hCT)
981 { return static_cast<GDALColorTable*>(hCT); }
982
983 };
984
985 /* ******************************************************************** */
986 /* GDALAbstractBandBlockCache */
987 /* ******************************************************************** */
988
990
992 // CPL_DLL is just technical here. This is really a private concept
993 // only used by GDALRasterBand implementation.
994
995 class CPL_DLL GDALAbstractBandBlockCache
996 {
997 // List of blocks that can be freed or recycled, and its lock
998 CPLLock *hSpinLock;
999 GDALRasterBlock *psListBlocksToFree;
1000
1001 // Band keep alive counter, and its lock & condition
1002 CPLCond *hCond;
1003 CPLMutex *hCondMutex;
1004 volatile int nKeepAliveCounter;
1005
1006 protected:
1007 GDALRasterBand *poBand;
1008
1009 void FreeDanglingBlocks();
1010 void UnreferenceBlockBase();
1011 void WaitKeepAliveCounter();
1012
1013 public:
1014 explicit GDALAbstractBandBlockCache(GDALRasterBand* poBand);
1015 virtual ~GDALAbstractBandBlockCache();
1016
1017 GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff);
1018 void AddBlockToFreeList( GDALRasterBlock * );
1019
1020 virtual bool Init() = 0;
1021 virtual bool IsInitOK() = 0;
1022 virtual CPLErr FlushCache() = 0;
1023 virtual CPLErr AdoptBlock( GDALRasterBlock* poBlock ) = 0;
1024 virtual GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff,
1025 int nYBlockYOff ) = 0;
1026 virtual CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ) = 0;
1027 virtual CPLErr FlushBlock( int nXBlockOff, int nYBlockOff,
1028 int bWriteDirtyBlock ) = 0;
1029 };
1030
1031 GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand);
1032 GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand);
1033
1035
1036 /* ******************************************************************** */
1037 /* GDALRasterBand */
1038 /* ******************************************************************** */
1039
1042 class CPL_DLL GDALRasterBand : public GDALMajorObject
1043 {
1044 private:
1045 friend class GDALArrayBandBlockCache;
1046 friend class GDALHashSetBandBlockCache;
1047 friend class GDALRasterBlock;
1048
1049 CPLErr eFlushBlockErr;
1050 GDALAbstractBandBlockCache* poBandBlockCache;
1051
1052 void SetFlushBlockErr( CPLErr eErr );
1053 CPLErr UnreferenceBlock( GDALRasterBlock* poBlock );
1054
1055 void Init(int bForceCachedIO);
1056
1057 protected:
1059 GDALDataset *poDS;
1060 int nBand; /* 1 based */
1061
1062 int nRasterXSize;
1063 int nRasterYSize;
1064
1065 GDALDataType eDataType;
1066 GDALAccess eAccess;
1067
1068 /* stuff related to blocking, and raster cache */
1069 int nBlockXSize;
1070 int nBlockYSize;
1071 int nBlocksPerRow;
1072 int nBlocksPerColumn;
1073
1074 int nBlockReads;
1075 int bForceCachedIO;
1076
1077 GDALRasterBand *poMask;
1078 bool bOwnMask;
1079 int nMaskFlags;
1080
1081 void InvalidateMaskBand();
1082
1083 friend class GDALDataset;
1084 friend class GDALProxyRasterBand;
1085 friend class GDALDefaultOverviews;
1086
1087 CPLErr RasterIOResampled( GDALRWFlag, int, int, int, int,
1088 void *, int, int, GDALDataType,
1089 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
1090
1091 int EnterReadWrite(GDALRWFlag eRWFlag);
1092 void LeaveReadWrite();
1093 void InitRWLock();
1095
1096 protected:
1097 virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
1098 virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
1099
1100 #ifdef DETECT_OLD_IRASTERIO
1101 virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int,
1102 void *, int, int, GDALDataType,
1103 int, int ) {};
1104 #endif
1105
1106 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1107 void *, int, int, GDALDataType,
1108 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
1109
1110 virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
1111 int nXSize, int nYSize,
1112 int nMaskFlagStop,
1113 double* pdfDataPct);
1115 CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
1116 void *, int, int, GDALDataType,
1117 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
1118
1119 CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
1120 int nXOff, int nYOff, int nXSize, int nYSize,
1121 void * pData, int nBufXSize, int nBufYSize,
1122 GDALDataType eBufType,
1123 GSpacing nPixelSpace, GSpacing nLineSpace,
1124 GDALRasterIOExtraArg* psExtraArg,
1125 int* pbTried );
1126
1127 int InitBlockInfo();
1128
1129 void AddBlockToFreeList( GDALRasterBlock * );
1131
1132 GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
1133
1134 public:
1135 GDALRasterBand();
1136 explicit GDALRasterBand(int bForceCachedIO);
1137
1138 ~GDALRasterBand() override;
1139
1140 int GetXSize();
1141 int GetYSize();
1142 int GetBand();
1143 GDALDataset*GetDataset();
1144
1145 GDALDataType GetRasterDataType( void );
1146 void GetBlockSize( int *, int * );
1147 CPLErr GetActualBlockSize ( int, int, int *, int * );
1148 GDALAccess GetAccess();
1149
1150 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
1151 void *, int, int, GDALDataType,
1152 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg
1153 #ifndef DOXYGEN_SKIP
1154 OPTIONAL_OUTSIDE_GDAL(nullptr)
1155 #endif
1156 ) CPL_WARN_UNUSED_RESULT;
1157 CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1158
1159 CPLErr WriteBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1160
1161 GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
1162 int bJustInitialize = FALSE ) CPL_WARN_UNUSED_RESULT;
1163 CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE );
1164
1165 unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
1166 unsigned char* pTranslationTable = nullptr,
1167 int* pApproximateMatching = nullptr);
1168
1169 // New OpengIS CV_SampleDimension stuff.
1170
1171 virtual CPLErr FlushCache();
1172 virtual char **GetCategoryNames();
1173 virtual double GetNoDataValue( int *pbSuccess = nullptr );
1174 virtual double GetMinimum( int *pbSuccess = nullptr );
1175 virtual double GetMaximum(int *pbSuccess = nullptr );
1176 virtual double GetOffset( int *pbSuccess = nullptr );
1177 virtual double GetScale( int *pbSuccess = nullptr );
1178 virtual const char *GetUnitType();
1179 virtual GDALColorInterp GetColorInterpretation();
1180 virtual GDALColorTable *GetColorTable();
1181 virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
1182
1183 virtual CPLErr SetCategoryNames( char ** papszNames );
1184 virtual CPLErr SetNoDataValue( double dfNoData );
1185 virtual CPLErr DeleteNoDataValue();
1186 virtual CPLErr SetColorTable( GDALColorTable * poCT );
1187 virtual CPLErr SetColorInterpretation( GDALColorInterp eColorInterp );
1188 virtual CPLErr SetOffset( double dfNewOffset );
1189 virtual CPLErr SetScale( double dfNewScale );
1190 virtual CPLErr SetUnitType( const char * pszNewValue );
1191
1192 virtual CPLErr GetStatistics( int bApproxOK, int bForce,
1193 double *pdfMin, double *pdfMax,
1194 double *pdfMean, double *padfStdDev );
1195 virtual CPLErr ComputeStatistics( int bApproxOK,
1196 double *pdfMin, double *pdfMax,
1197 double *pdfMean, double *pdfStdDev,
1198 GDALProgressFunc, void *pProgressData );
1199 virtual CPLErr SetStatistics( double dfMin, double dfMax,
1200 double dfMean, double dfStdDev );
1201 virtual CPLErr ComputeRasterMinMax( int, double* );
1202
1203 // Only defined when Doxygen enabled
1204 #ifdef DOXYGEN_SKIP
1205 char **GetMetadata( const char * pszDomain = "" ) override;
1206 CPLErr SetMetadata( char ** papszMetadata,
1207 const char * pszDomain ) override;
1208 const char *GetMetadataItem( const char * pszName,
1209 const char * pszDomain ) override;
1210 CPLErr SetMetadataItem( const char * pszName,
1211 const char * pszValue,
1212 const char * pszDomain ) override;
1213 #endif
1214
1215 virtual int HasArbitraryOverviews();
1216 virtual int GetOverviewCount();
1217 virtual GDALRasterBand *GetOverview(int);
1218 virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
1219 virtual CPLErr BuildOverviews( const char * pszResampling,
1220 int nOverviews,
1221 int * panOverviewList,
1222 GDALProgressFunc pfnProgress,
1223 void * pProgressData );
1224
1225 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
1226 int nBufXSize, int nBufYSize,
1227 GDALDataType eBufType, char **papszOptions );
1228
1229 virtual CPLErr GetHistogram( double dfMin, double dfMax,
1230 int nBuckets, GUIntBig * panHistogram,
1231 int bIncludeOutOfRange, int bApproxOK,
1232 GDALProgressFunc, void *pProgressData );
1233
1234 virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
1235 int *pnBuckets, GUIntBig ** ppanHistogram,
1236 int bForce,
1237 GDALProgressFunc, void *pProgressData);
1238 virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
1239 int nBuckets, GUIntBig *panHistogram );
1240
1241 virtual GDALRasterAttributeTable *GetDefaultRAT();
1242 virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT );
1243
1244 virtual GDALRasterBand *GetMaskBand();
1245 virtual int GetMaskFlags();
1246 virtual CPLErr CreateMaskBand( int nFlagsIn );
1247
1248 virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
1249 int *pnPixelSpace,
1250 GIntBig *pnLineSpace,
1251 char **papszOptions ) CPL_WARN_UNUSED_RESULT;
1252
1253 int GetDataCoverageStatus( int nXOff, int nYOff,
1254 int nXSize, int nYSize,
1255 int nMaskFlagStop = 0,
1256 double* pdfDataPct = nullptr );
1257
1258 void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
1259
1263 static inline GDALRasterBandH ToHandle(GDALRasterBand* poBand)
1264 { return static_cast<GDALRasterBandH>(poBand); }
1265
1269 static inline GDALRasterBand* FromHandle(GDALRasterBandH hBand)
1270 { return static_cast<GDALRasterBand*>(hBand); }
1271
1272 private:
1273 CPL_DISALLOW_COPY_ASSIGN(GDALRasterBand)
1274 };
1275
1277 /* ******************************************************************** */
1278 /* GDALAllValidMaskBand */
1279 /* ******************************************************************** */
1280
1281 class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
1282 {
1283 protected:
1284 CPLErr IReadBlock( int, int, void * ) override;
1285
1286 public:
1287 explicit GDALAllValidMaskBand( GDALRasterBand * );
1288 ~GDALAllValidMaskBand() override;
1289
1290 GDALRasterBand *GetMaskBand() override;
1291 int GetMaskFlags() override;
1292 };
1293
1294 /* ******************************************************************** */
1295 /* GDALNoDataMaskBand */
1296 /* ******************************************************************** */
1297
1298 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
1299 {
1300 double dfNoDataValue;
1301 GDALRasterBand *poParent;
1302
1303 protected:
1304 CPLErr IReadBlock( int, int, void * ) override;
1305 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1306 void *, int, int, GDALDataType,
1307 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
1308
1309 public:
1310 explicit GDALNoDataMaskBand( GDALRasterBand * );
1311 ~GDALNoDataMaskBand() override;
1312 };
1313
1314 /* ******************************************************************** */
1315 /* GDALNoDataValuesMaskBand */
1316 /* ******************************************************************** */
1317
1318 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
1319 {
1320 double *padfNodataValues;
1321
1322 protected:
1323 CPLErr IReadBlock( int, int, void * ) override;
1324
1325 public:
1326 explicit GDALNoDataValuesMaskBand( GDALDataset * );
1327 ~GDALNoDataValuesMaskBand() override;
1328 };
1329
1330 /* ******************************************************************** */
1331 /* GDALRescaledAlphaBand */
1332 /* ******************************************************************** */
1333
1334 class GDALRescaledAlphaBand : public GDALRasterBand
1335 {
1336 GDALRasterBand *poParent;
1337 void *pTemp;
1338
1339 protected:
1340 CPLErr IReadBlock( int, int, void * ) override;
1341 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1342 void *, int, int, GDALDataType,
1343 GSpacing, GSpacing,
1344 GDALRasterIOExtraArg* psExtraArg ) override;
1345
1346 public:
1347 explicit GDALRescaledAlphaBand( GDALRasterBand * );
1348 ~GDALRescaledAlphaBand() override;
1349 };
1351
1352 /* ******************************************************************** */
1353 /* GDALIdentifyEnum */
1354 /* ******************************************************************** */
1355
1361 typedef enum
1362 {
1364 GDAL_IDENTIFY_UNKNOWN = -1,
1366 GDAL_IDENTIFY_FALSE = 0,
1368 GDAL_IDENTIFY_TRUE = 1
1369 } GDALIdentifyEnum;
1370
1371 /* ******************************************************************** */
1372 /* GDALDriver */
1373 /* ******************************************************************** */
1374
1386 class CPL_DLL GDALDriver : public GDALMajorObject
1387 {
1388 public:
1389 GDALDriver();
1390 ~GDALDriver() override;
1391
1392 CPLErr SetMetadataItem( const char * pszName,
1393 const char * pszValue,
1394 const char * pszDomain = "" ) override;
1395
1396 /* -------------------------------------------------------------------- */
1397 /* Public C++ methods. */
1398 /* -------------------------------------------------------------------- */
1399 GDALDataset *Create( const char * pszName,
1400 int nXSize, int nYSize, int nBands,
1401 GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT;
1402
1403 CPLErr Delete( const char * pszName );
1404 CPLErr Rename( const char * pszNewName,
1405 const char * pszOldName );
1406 CPLErr CopyFiles( const char * pszNewName,
1407 const char * pszOldName );
1408
1409 GDALDataset *CreateCopy( const char *, GDALDataset *,
1410 int, char **,
1411 GDALProgressFunc pfnProgress,
1412 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1413
1414 /* -------------------------------------------------------------------- */
1415 /* The following are semiprivate, not intended to be accessed */
1416 /* by anyone but the formats instantiating and populating the */
1417 /* drivers. */
1418 /* -------------------------------------------------------------------- */
1420 GDALDataset *(*pfnOpen)( GDALOpenInfo * );
1421
1422 GDALDataset *(*pfnCreate)( const char * pszName,
1423 int nXSize, int nYSize, int nBands,
1424 GDALDataType eType,
1425 char ** papszOptions );
1426
1427 CPLErr (*pfnDelete)( const char * pszName );
1428
1429 GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *,
1430 int, char **,
1431 GDALProgressFunc pfnProgress,
1432 void * pProgressData );
1433
1434 void *pDriverData;
1435
1436 void (*pfnUnloadDriver)(GDALDriver *);
1437
1445 int (*pfnIdentify)( GDALOpenInfo * );
1446
1447 CPLErr (*pfnRename)( const char * pszNewName,
1448 const char * pszOldName );
1449 CPLErr (*pfnCopyFiles)( const char * pszNewName,
1450 const char * pszOldName );
1451
1452 /* For legacy OGR drivers */
1453 GDALDataset *(*pfnOpenWithDriverArg)( GDALDriver*, GDALOpenInfo * );
1454 GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*,
1455 const char * pszName,
1456 char ** papszOptions );
1457 CPLErr (*pfnDeleteDataSource)( GDALDriver*,
1458 const char * pszName );
1460
1461 /* -------------------------------------------------------------------- */
1462 /* Helper methods. */
1463 /* -------------------------------------------------------------------- */
1465 GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
1466 int, char **,
1467 GDALProgressFunc pfnProgress,
1468 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1469 static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1470 GDALDataset *poDstDS,
1471 int bStrict );
1473 static CPLErr QuietDelete( const char * pszName );
1474
1476 static CPLErr DefaultRename( const char * pszNewName,
1477 const char * pszOldName );
1478 static CPLErr DefaultCopyFiles( const char * pszNewName,
1479 const char * pszOldName );
1481
1485 static inline GDALDriverH ToHandle(GDALDriver* poDriver)
1486 { return static_cast<GDALDriverH>(poDriver); }
1487
1491 static inline GDALDriver* FromHandle(GDALDriverH hDriver)
1492 { return static_cast<GDALDriver*>(hDriver); }
1493
1494 private:
1495 CPL_DISALLOW_COPY_ASSIGN(GDALDriver)
1496 };
1497
1498 /* ******************************************************************** */
1499 /* GDALDriverManager */
1500 /* ******************************************************************** */
1501
1509 class CPL_DLL GDALDriverManager : public GDALMajorObject
1510 {
1511 int nDrivers;
1512 GDALDriver **papoDrivers;
1513 std::map<CPLString, GDALDriver*> oMapNameToDrivers;
1514
1515 GDALDriver *GetDriver_unlocked( int iDriver )
1516 { return (iDriver >= 0 && iDriver < nDrivers) ?
1517 papoDrivers[iDriver] : nullptr; }
1518
1519 GDALDriver *GetDriverByName_unlocked( const char * pszName )
1520 { return oMapNameToDrivers[CPLString(pszName).toupper()]; }
1521
1522 public:
1523 GDALDriverManager();
1524 ~GDALDriverManager();
1525
1526 int GetDriverCount( void ) const;
1527 GDALDriver *GetDriver( int );
1528 GDALDriver *GetDriverByName( const char * );
1529
1530 int RegisterDriver( GDALDriver * );
1531 void DeregisterDriver( GDALDriver * );
1532
1533 // AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined.
1534 static void AutoLoadDrivers();
1535 void AutoSkipDrivers();
1536 };
1537
1538 CPL_C_START
1539 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
1540 CPL_C_END
1541
1542 /* ******************************************************************** */
1543 /* GDALAsyncReader */
1544 /* ******************************************************************** */
1545
1551 class CPL_DLL GDALAsyncReader
1552 {
1553 protected:
1555 GDALDataset* poDS;
1556 int nXOff;
1557 int nYOff;
1558 int nXSize;
1559 int nYSize;
1560 void * pBuf;
1561 int nBufXSize;
1562 int nBufYSize;
1563 GDALDataType eBufType;
1564 int nBandCount;
1565 int* panBandMap;
1566 int nPixelSpace;
1567 int nLineSpace;
1568 int nBandSpace;
1570
1571 public:
1572 GDALAsyncReader();
1573 virtual ~GDALAsyncReader();
1574
1578 GDALDataset* GetGDALDataset() {return poDS;}
1582 int GetXOffset() const { return nXOff; }
1586 int GetYOffset() const { return nYOff; }
1590 int GetXSize() const { return nXSize; }
1594 int GetYSize() const { return nYSize; }
1598 void * GetBuffer() {return pBuf;}
1602 int GetBufferXSize() const { return nBufXSize; }
1606 int GetBufferYSize() const { return nBufYSize; }
1610 GDALDataType GetBufferType() const { return eBufType; }
1614 int GetBandCount() const { return nBandCount; }
1618 int* GetBandMap() { return panBandMap; }
1622 int GetPixelSpace() const { return nPixelSpace; }
1626 int GetLineSpace() const { return nLineSpace; }
1630 int GetBandSpace() const { return nBandSpace; }
1631
1632 virtual GDALAsyncStatusType
1633 GetNextUpdatedRegion(double dfTimeout,
1634 int* pnBufXOff, int* pnBufYOff,
1635 int* pnBufXSize, int* pnBufYSize) = 0;
1636 virtual int LockBuffer( double dfTimeout = -1.0 );
1637 virtual void UnlockBuffer();
1638 };
1639
1640 /* ==================================================================== */
1641 /* An assortment of overview related stuff. */
1642 /* ==================================================================== */
1643
1645 /* Only exported for drivers as plugin. Signature may change */
1646 CPLErr CPL_DLL
1647 GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
1648 int nOverviews,
1649 GDALRasterBand*** papapoOverviewBands,
1650 const char * pszResampling,
1651 GDALProgressFunc pfnProgress, void * pProgressData );
1652
1653 typedef CPLErr (*GDALResampleFunction)
1654 ( double dfXRatioDstToSrc,
1655 double dfYRatioDstToSrc,
1656 double dfSrcXDelta,
1657 double dfSrcYDelta,
1658 GDALDataType eWrkDataType,
1659 void * pChunk,
1660 GByte * pabyChunkNodataMask,
1661 int nChunkXOff, int nChunkXSize,
1662 int nChunkYOff, int nChunkYSize,
1663 int nDstXOff, int nDstXOff2,
1664 int nDstYOff, int nDstYOff2,
1665 GDALRasterBand * poOverview,
1666 const char * pszResampling,
1667 int bHasNoData, float fNoDataValue,
1668 GDALColorTable* poColorTable,
1669 GDALDataType eSrcDataType,
1670 bool bPropagateNoData );
1671
1672 GDALResampleFunction GDALGetResampleFunction(const char* pszResampling,
1673 int* pnRadius);
1674
1675 #ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND
1676 typedef CPLErr (*GDALResampleFunctionMultiBands)
1677 ( double dfXRatioDstToSrc,
1678 double dfYRatioDstToSrc,
1679 double dfSrcXDelta,
1680 double dfSrcYDelta,
1681 GDALDataType eWrkDataType,
1682 void * pChunk, int nBands,
1683 GByte * pabyChunkNodataMask,
1684 int nChunkXOff, int nChunkXSize,
1685 int nChunkYOff, int nChunkYSize,
1686 int nDstXOff, int nDstXOff2,
1687 int nDstYOff, int nDstYOff2,
1688 GDALRasterBand ** papoDstBands,
1689 const char * pszResampling,
1690 int bHasNoData, float fNoDataValue,
1691 GDALColorTable* poColorTable,
1692 GDALDataType eSrcDataType);
1693
1694 GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(const char* pszResampling,
1695 int* pnRadius);
1696 #endif
1697
1698 GDALDataType GDALGetOvrWorkDataType(const char* pszResampling,
1699 GDALDataType eSrcDataType);
1700
1701 CPL_C_START
1702
1703 CPLErr CPL_DLL
1704 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
1705 GDALDataset **ppoDS,
1706 int nBands, int *panBandList,
1707 int nNewOverviews, int *panNewOverviewList,
1708 const char *pszResampling,
1709 GDALProgressFunc pfnProgress,
1710 void *pProgressData );
1711
1712 CPLErr CPL_DLL
1713 GTIFFBuildOverviews( const char * pszFilename,
1714 int nBands, GDALRasterBand **papoBandList,
1715 int nOverviews, int * panOverviewList,
1716 const char * pszResampling,
1717 GDALProgressFunc pfnProgress, void * pProgressData );
1718
1719 CPLErr CPL_DLL
1720 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
1721 const char * pszResampling,
1722 int nOverviews, int * panOverviewList,
1723 int nBands, int * panBandList,
1724 GDALProgressFunc pfnProgress, void * pProgressData);
1725
1726 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
1727 int &nXOff, int &nYOff,
1728 int &nXSize, int &nYSize,
1729 int nBufXSize, int nBufYSize) CPL_WARN_DEPRECATED("Use GDALBandGetBestOverviewLevel2 instead");
1730 int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand,
1731 int &nXOff, int &nYOff,
1732 int &nXSize, int &nYSize,
1733 int nBufXSize, int nBufYSize,
1734 GDALRasterIOExtraArg* psExtraArg);
1735
1736 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize ) CPL_WARN_DEPRECATED("Use GDALOvLevelAdjust2 instead");
1737 int CPL_DLL GDALOvLevelAdjust2( int nOvLevel, int nXSize, int nYSize );
1738 int CPL_DLL GDALComputeOvFactor( int nOvrXSize, int nRasterXSize,
1739 int nOvrYSize, int nRasterYSize );
1740
1741 GDALDataset CPL_DLL *
1742 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
1743 GDALDataset *poDependentDS );
1744
1745 /* ==================================================================== */
1746 /* Infrastructure to check that dataset characteristics are valid */
1747 /* ==================================================================== */
1748
1749 int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
1750 int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
1751
1752 /* Internal use only */
1753
1754 /* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */
1755 int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension,
1756 double *padfGeoTransform, char** papszSiblingFiles,
1757 char** ppszWorldFileNameOut);
1758 int GDALReadTabFile2( const char * pszBaseFilename,
1759 double *padfGeoTransform, char **ppszWKT,
1760 int *pnGCPCount, GDAL_GCP **ppasGCPs,
1761 char** papszSiblingFiles, char** ppszTabFileNameOut );
1762
1763 void CPL_DLL GDALCopyRasterIOExtraArg(GDALRasterIOExtraArg* psDestArg,
1764 GDALRasterIOExtraArg* psSrcArg);
1765
1766 CPL_C_END
1767
1768 void GDALNullifyOpenDatasetsList();
1769 CPLMutex** GDALGetphDMMutex();
1770 CPLMutex** GDALGetphDLMutex();
1771 void GDALNullifyProxyPoolSingleton();
1772 GDALDriver* GDALGetAPIPROXYDriver();
1773 void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
1774 GIntBig GDALGetResponsiblePIDForCurrentThread();
1775
1776 CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
1777 CSLConstList papszSiblingFiles, int nFlags );
1778
1779 CPLErr EXIFExtractMetadata(char**& papszMetadata,
1780 void *fpL, int nOffset,
1781 int bSwabflag, int nTIFFHEADER,
1782 int& nExifOffset, int& nInterOffset, int& nGPSOffset);
1783
1784 int GDALValidateOpenOptions( GDALDriverH hDriver,
1785 const char* const* papszOptionOptions);
1786 int GDALValidateOptions( const char* pszOptionList,
1787 const char* const* papszOptionsToValidate,
1788 const char* pszErrorMessageOptionType,
1789 const char* pszErrorMessageContainerName);
1790
1791 GDALRIOResampleAlg GDALRasterIOGetResampleAlg(const char* pszResampling);
1792 const char* GDALRasterIOGetResampleAlg(GDALRIOResampleAlg eResampleAlg);
1793
1794 void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
1795 int nXSize, int nYSize,
1796 int nBufXSize, int nBufYSize);
1797
1798
1799 GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
1800 int bThisLevelOnly);
1801
1802 // Should cover particular cases of #3573, #4183, #4506, #6578
1803 // Behaviour is undefined if fVal1 or fVal2 are NaN (should be tested before
1804 // calling this function)
1805 template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
1806 {
1807 return fVal1 == fVal2 || /* Should cover infinity */
1808 std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
1809 }
1810
1811 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
1812
1813 // Number of data samples that will be used to compute approximate statistics
1814 // (minimum value, maximum value, etc.)
1815 #define GDALSTAT_APPROX_NUMSAMPLES 2500
1816
1817 CPL_C_START
1818 /* Caution: for technical reason this declaration is duplicated in gdal_crs.c */
1819 /* so any signature change should be reflected there too */
1820 void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode,
1821 GDAL_GCP* pasGCPList,
1822 int nGCPCount,
1823 const char* pszGCPProjection );
1824 void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList,
1825 GDAL_GCP** ppasGCPList,
1826 int* pnGCPCount,
1827 char** ppszGCPProjection );
1828 CPL_C_END
1829
1830 void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOptions);
1831 char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode );
1832
1833 int GDALCanFileAcceptSidecarFile(const char* pszFilename);
1835
1836 #endif /* ndef GDAL_PRIV_H_INCLUDED */
GDALRasterAttributeTable
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
GDALDataset::Layers::Iterator
Layer iterator.
Definition: gdal_priv.h:667
GDALOpenEx
GDALDatasetH GDALOpenEx(const char *pszFilename, unsigned int nOpenFlags, const char *const *papszAllowedDrivers, const char *const *papszOpenOptions, const char *const *papszSiblingFiles) CPL_WARN_UNUSED_RESULT
Open a raster or vector file as a GDALDataset.
Definition: gdaldataset.cpp:2665
OGRFeatureUniquePtr
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:779
GDALDataType
GDALDataType
Definition: gdal.h:60
GDALAsyncReader::GetBufferType
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1610
GDAL_IDENTIFY_UNKNOWN
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1364
GDALDatasetUniquePtr
std::unique_ptr< GDALDataset, GDALDatasetUniquePtrDeleter > GDALDatasetUniquePtr
Unique pointer type for GDALDataset.
Definition: gdal_priv.h:824
CPLXMLNode
Document node structure.
Definition: cpl_minixml.h:66
cpl_vsi.h
Standard C Covers.
GDALRasterBand::GetMaskBand
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:5959
cpl_minixml.h
Definitions for CPL mini XML Parser/Serializer.
GDALRasterBlock::GetYOff
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:891
GDALRasterBand::ToHandle
void static GDALRasterBandH ToHandle(GDALRasterBand *poBand)
Convert a GDALRasterBand* to a GDALRasterBandH.
Definition: gdal_priv.h:1263
GPI_RGB
Definition: gdal.h:219
GDALAsyncReader::GetGDALDataset
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1578
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:341
GDALDataset::FeatureLayerPair
Object returned by GetFeatures() iterators.
Definition: gdal_priv.h:627
GDALOpenInfo::papszAllowedDrivers
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:300
GDALRasterBand::IRasterIO
virtual CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT
Read/write a region of image data for this band.
Definition: rasterio.cpp:68
GDALAsyncReader::GetBandMap
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1618
GDALRasterBlock::DropLock
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:875
VSILFILE
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:155
GDALDataset::GetOpenOptions
char ** GetOpenOptions()
Return open options.
Definition: gdal_priv.h:575
GDALDataset::Layers::Iterator::pointer
void pointer
pointer
Definition: gdal_priv.h:676
GDALOpenInfo::pabyHeader
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:297
GDALRasterBlock::GetXOff
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:887
GDALOpenInfo::eAccess
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:282
GDALRIOResampleAlg
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:128
GDALOpenInfo::fpL
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:292
GDALAsyncReader::GetXSize
int GetXSize() const
Return width.
Definition: gdal_priv.h:1590
GDALRasterBand::FromHandle
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition: gdal_priv.h:1269
GDALRWFlag
GDALRWFlag
Definition: gdal.h:119
GDALDatasetH
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:255
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:213
GDALOpenInfo::pszFilename
char * pszFilename
Filename.
Definition: gdal_priv.h:277
GDALColorEntry
Color tuple.
Definition: gdal.h:1044
GDALOpenInfo::nOpenFlags
int nOpenFlags
Open flags.
Definition: gdal_priv.h:284
GDALRasterBlock
A single raster block in the block cache.
Definition: gdal_priv.h:834
GDALRasterBand::GetMaskFlags
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:6206
GDALRasterBandH
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:258
GDALMajorObject::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
GDALRasterBlock::AddLock
int AddLock(void)
Increment the lock count.
Definition: gdal_priv.h:873
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:334
CPL_PRINT_FUNC_FORMAT
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:910
wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:319
GDALAsyncReader::GetLineSpace
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1626
CPLVirtualMem
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
GDALDataset::FeatureLayerPair::layer
OGRLayer * layer
Layer to which the feature belongs to.
Definition: gdal_priv.h:633
GDALRasterBand::IReadBlock
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
GDALDataset::BuildOverviews
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1489
cpl_string.h
Various convenience functions for working with strings and string lists.
GSpacing
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:273
GDALOpenInfo::bIsDirectory
int bIsDirectory
Whether the file is a directory.
Definition: gdal_priv.h:289
GDALColorTable::ToHandle
static GDALColorTableH ToHandle(GDALColorTable *poCT)
Convert a GDALColorTable* to a GDALRasterBandH.
Definition: gdal_priv.h:974
GDALMajorObject::GetMetadataItem
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
GDALRasterBlock::GetYSize
int GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:899
GDALRasterBlock::GetXSize
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:895
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:317
GDALDriver::ToHandle
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition: gdal_priv.h:1485
gdal.h
Public (C callable) GDAL entry points.
GDALDataset::Open
static GDALDataset * Open(const char *pszFilename, unsigned int nOpenFlags=0, const char *const *papszAllowedDrivers=nullptr, const char *const *papszOpenOptions=nullptr, const char *const *papszSiblingFiles=nullptr)
Definition: gdal_priv.h:614
GDALAsyncStatusType
GDALAsyncStatusType
status of the asynchronous stream
Definition: gdal.h:100
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:286
GDALMajorObject::SetMetadata
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: gdalmajorobject.cpp:292
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1190
GDALAsyncReader::GetBuffer
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:1598
GDALRasterBlock::GetBand
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:919
GDALOpenInfo
Class for dataset open functions.
Definition: gdal_priv.h:265
GDALAsyncReader::GetYOffset
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1586
GDALDataset::MarkSuppressOnClose
void MarkSuppressOnClose()
Set that the dataset must be deleted on close.
Definition: gdal_priv.h:570
CPLStringList
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:445
GDALDriver::FromHandle
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition: gdal_priv.h:1491
GDALRasterIOExtraArg
Structure to pass extra arguments to RasterIO() method.
Definition: gdal.h:147
GDAL_IDENTIFY_TRUE
Identify determined the file is recognized by the probed driver.
Definition: gdal_priv.h:1368
GDALMajorObject::ToHandle
static GDALMajorObjectH ToHandle(GDALMajorObject *poMajorObject)
Convert a GDALMajorObject* to a GDALMajorObjectH.
Definition: gdal_priv.h:168
GDALPaletteInterp
GDALPaletteInterp
Definition: gdal.h:216
ogr_core.h
Core portability services for cross-platform OGR code.
GDALOpenInfo::bStatOK
int bStatOK
Whether stat()'ing the file was successful.
Definition: gdal_priv.h:287
GDALOpenInfo::nHeaderBytes
int nHeaderBytes
Number of bytes in pabyHeader.
Definition: gdal_priv.h:295
GDALDataset::Bands
Class returned by GetBands() that act as a container for raster bands.
Definition: gdal_priv.h:472
GDALDataset::CloseDependentDatasets
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3432
GDALRasterBlock::GetDataRef
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:907
GDALAsyncReader::GetYSize
int GetYSize() const
Return height.
Definition: gdal_priv.h:1594
GDALDataset::CreateMaskBand
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2477
GUIntBig
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:249
CPLErrorNum
int CPLErrorNum
Error number.
Definition: cpl_error.h:94
cpl_conv.h
Various convenience functions for CPL.
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:139
GDALAsyncReader::GetBufferXSize
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1602
GDALDriverH
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:261
GDALClose
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3059
GDALDataset::ToHandle
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition: gdal_priv.h:602
GDALMajorObjectH
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition: gdal.h:252
GDALOpenInfo::papszOpenOptions
char ** papszOpenOptions
Open options.
Definition: gdal_priv.h:279
GDALMajorObject
Object with metadata.
Definition: gdal_priv.h:132
GDALAsyncReader::GetBufferYSize
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1606
GDALDataset::Layers
Class returned by GetLayers() that acts as a range of layers.
Definition: gdal_priv.h:654
GDALDataset::FromHandle
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition: gdal_priv.h:608
GDALDataset::Layers::Iterator::iterator_category
std::input_iterator_tag iterator_category
iterator_category
Definition: gdal_priv.h:677
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:70
GDALRasterBlock::GetDirty
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:903
GDALRasterBand
A single raster band (or channel).
Definition: gdal_priv.h:1042
GDALAccess
GDALAccess
Definition: gdal.h:113
ogr_feature.h
Simple feature classes.
GDALAsyncReader::GetPixelSpace
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1622
CPLString::toupper
CPLSTRING_DLL CPLString & toupper(void)
Convert to upper case in place.
Definition: cplstring.cpp:331
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:353
GDALAsyncReader::GetBandSpace
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1630
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:84
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:339
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:343
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:246
GDALColorTableH
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition: gdal.h:264
GDALAsyncReader::GetXOffset
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1582
GDALDriverManager
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1509
begin
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:285
CPL_NULL_TERMINATED
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition: cpl_port.h:900
GDALIdentifyEnum
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1361
OGRErr
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
GDALColorInterp
GDALColorInterp
Definition: gdal.h:190
GDALGetDataTypeSizeBytes
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition: gdal_misc.cpp:305
GDALMajorObject::SetMetadataItem
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: gdalmajorobject.cpp:388
GDALDataset::Features
Class returned by GetFeatures() that act as a container for vector features.
Definition: gdal_priv.h:717
GDALMajorObject::FromHandle
static GDALMajorObject * FromHandle(GDALMajorObjectH hMajorObject)
Convert a GDALMajorObjectH to a GDALMajorObject*.
Definition: gdal_priv.h:174
GDALRasterBlock::GetDataType
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:883
GDAL_IDENTIFY_FALSE
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1366
end
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:290
GDALAsyncReader::GetBandCount
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1614
GDALDataset::Layers::Iterator::difference_type
void difference_type
difference_type
Definition: gdal_priv.h:675
GDALDriver
Format specific driver.
Definition: gdal_priv.h:1386
GDALRasterBlock::GetBlockSize
int GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:911
GDALColorTable
A color table / palette.
Definition: gdal_priv.h:949
GDALDataset::FeatureLayerPair::feature
OGRFeatureUniquePtr feature
Unique pointer to a OGRFeature.
Definition: gdal_priv.h:630
GDAL_GCP
Ground Control Point.
Definition: gdal.h:560
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:52
GetGDALDriverManager
GDALDriverManager * GetGDALDriverManager(void)
Fetch the global GDAL driver manager.
Definition: gdaldrivermanager.cpp:97
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:993
CPL_WARN_UNUSED_RESULT
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:935
GDALAsyncReader
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:1551
GDALColorTable::FromHandle
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition: gdal_priv.h:980

Generated for GDAL by 1.8.8.