GDAL
gdal_priv.h
Go to the documentation of this file.
1/******************************************************************************
2 * $Id: gdal_priv.h c590dcec36eb6dcd7c5451623b859e7227475b44 2019-11-13 16:36:03 +0100 Even Rouault $
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/* -------------------------------------------------------------------- */
45class GDALMajorObject;
46class GDALDataset;
47class GDALRasterBand;
48class GDALDriver;
50class GDALProxyDataset;
51class GDALProxyRasterBand;
52class 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
87
88/************************************************************************/
89/* GDALMultiDomainMetadata */
90/************************************************************************/
91
93class CPL_DLL GDALMultiDomainMetadata
94{
95private:
96 char **papszDomainList;
97 CPLStringList **papoMetadataLists;
98
99public:
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
132class 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:
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
183class 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
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
265class 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
280
285
290
293
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:
309};
310
311/* ******************************************************************** */
312/* GDALDataset */
313/* ******************************************************************** */
314
315class OGRLayer;
316class OGRGeometry;
318class OGRStyleTable;
319class swq_select;
320class swq_select_parse_options;
321
323typedef struct GDALSQLParseInfo GDALSQLParseInfo;
325
327#ifdef GDAL_COMPILATION
328#define OPTIONAL_OUTSIDE_GDAL(val)
329#else
330#define OPTIONAL_OUTSIDE_GDAL(val) = val
331#endif
333
335class CPL_DLL GDALDataset : public GDALMajorObject
336{
337 friend GDALDatasetH CPL_STDCALL GDALOpenEx( const char* pszFilename,
338 unsigned int nOpenFlags,
339 const char* const* papszAllowedDrivers,
340 const char* const* papszOpenOptions,
341 const char* const* papszSiblingFiles );
342 friend void CPL_STDCALL GDALClose( GDALDatasetH hDS );
343
344 friend class GDALDriver;
345 friend class GDALDefaultOverviews;
346 friend class GDALProxyDataset;
347 friend class GDALDriverManager;
348
349 CPL_INTERNAL void AddToDatasetOpenList();
350
351 protected:
353 GDALDriver *poDriver = nullptr;
354 GDALAccess eAccess = GA_ReadOnly;
355
356 // Stored raster information.
357 int nRasterXSize = 512;
358 int nRasterYSize = 512;
359 int nBands = 0;
360 GDALRasterBand **papoBands = nullptr;
361
362 int nOpenFlags = 0;
363
364 int nRefCount = 1;
365 bool bForceCachedIO = false;
366 bool bShared = false;
367 bool bIsInternal = true;
368 bool bSuppressOnClose = false;
369
370 GDALDataset(void);
371 explicit GDALDataset(int bForceCachedIO);
372
373 void RasterInitialize( int, int );
374 void SetBand( int, GDALRasterBand * );
375
376 GDALDefaultOverviews oOvManager{};
377
378 virtual CPLErr IBuildOverviews( const char *, int, int *,
379 int, int *, GDALProgressFunc, void * );
380
381 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
382 void *, int, int, GDALDataType,
383 int, int *, GSpacing, GSpacing, GSpacing,
385
386 CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
387 void *, int, int, GDALDataType,
388 int, int *, GSpacing, GSpacing, GSpacing,
390 void BlockBasedFlushCache();
391
392 CPLErr BandBasedRasterIO( GDALRWFlag eRWFlag,
393 int nXOff, int nYOff, int nXSize, int nYSize,
394 void * pData, int nBufXSize, int nBufYSize,
395 GDALDataType eBufType,
396 int nBandCount, int *panBandMap,
397 GSpacing nPixelSpace, GSpacing nLineSpace,
398 GSpacing nBandSpace,
400
401 CPLErr RasterIOResampled( GDALRWFlag eRWFlag,
402 int nXOff, int nYOff, int nXSize, int nYSize,
403 void * pData, int nBufXSize, int nBufYSize,
404 GDALDataType eBufType,
405 int nBandCount, int *panBandMap,
406 GSpacing nPixelSpace, GSpacing nLineSpace,
407 GSpacing nBandSpace,
409
410 CPLErr ValidateRasterIOOrAdviseReadParameters(
411 const char* pszCallingFunc,
412 int* pbStopProcessingOnCENone,
413 int nXOff, int nYOff, int nXSize, int nYSize,
414 int nBufXSize, int nBufYSize,
415 int nBandCount, int *panBandMap);
416
417 CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
418 int nXOff, int nYOff, int nXSize, int nYSize,
419 void * pData, int nBufXSize, int nBufYSize,
420 GDALDataType eBufType,
421 int nBandCount, int *panBandMap,
422 GSpacing nPixelSpace, GSpacing nLineSpace,
423 GSpacing nBandSpace,
424 GDALRasterIOExtraArg* psExtraArg,
425 int* pbTried);
426
427 void ShareLockWithParentDataset(GDALDataset* poParentDataset);
428
430 virtual int CloseDependentDatasets();
432 int ValidateLayerCreationOptions( const char* const* papszLCO );
433
434 char **papszOpenOptions = nullptr;
435
436 friend class GDALRasterBand;
437
438 // The below methods related to read write mutex are fragile logic, and
439 // should not be used by out-of-tree code if possible.
440 int EnterReadWrite(GDALRWFlag eRWFlag);
441 void LeaveReadWrite();
442 void InitRWLock();
443
444 void TemporarilyDropReadWriteLock();
445 void ReacquireReadWriteLock();
446
447 void DisableReadWriteMutex();
448
449 int AcquireMutex();
450 void ReleaseMutex();
452
453 public:
454 ~GDALDataset() override;
455
456 int GetRasterXSize();
457 int GetRasterYSize();
458 int GetRasterCount();
459 GDALRasterBand *GetRasterBand( int );
460
462 class CPL_DLL Bands
463 {
464 private:
465
466 friend class GDALDataset;
467 GDALDataset* m_poSelf;
468 CPL_INTERNAL explicit Bands(GDALDataset* poSelf): m_poSelf(poSelf) {}
469
470 class CPL_DLL Iterator
471 {
472 struct Private;
473 std::unique_ptr<Private> m_poPrivate;
474 public:
475 Iterator(GDALDataset* poDS, bool bStart);
476 Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
477 Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
478 ~Iterator();
479 GDALRasterBand* operator*();
480 Iterator& operator++();
481 bool operator!=(const Iterator& it) const;
482 };
483
484 public:
485
486 const Iterator begin() const;
487
488 const Iterator end() const;
489
490 size_t size() const;
491
492 GDALRasterBand* operator[](int iBand);
493 GDALRasterBand* operator[](size_t iBand);
494 };
495
496 Bands GetBands();
497
498 virtual void FlushCache(void);
499
500 virtual const OGRSpatialReference* GetSpatialRef() const;
501 virtual CPLErr SetSpatialRef(const OGRSpatialReference* poSRS);
502
503 // Compatibility layer
504 const char *GetProjectionRef(void) const;
505 CPLErr SetProjection( const char * pszProjection );
506
507 virtual CPLErr GetGeoTransform( double * padfTransform );
508 virtual CPLErr SetGeoTransform( double * padfTransform );
509
510 virtual CPLErr AddBand( GDALDataType eType,
511 char **papszOptions=nullptr );
512
513 virtual void *GetInternalHandle( const char * pszHandleName );
514 virtual GDALDriver *GetDriver(void);
515 virtual char **GetFileList(void);
516
517 virtual const char* GetDriverName();
518
519 virtual const OGRSpatialReference* GetGCPSpatialRef() const;
520 virtual int GetGCPCount();
521 virtual const GDAL_GCP *GetGCPs();
522 virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
523 const OGRSpatialReference * poGCP_SRS );
524
525 // Compatibility layer
526 const char *GetGCPProjection();
527 CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
528 const char *pszGCPProjection );
529
530 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
531 int nBufXSize, int nBufYSize,
532 GDALDataType eDT,
533 int nBandCount, int *panBandList,
534 char **papszOptions );
535
536 virtual CPLErr CreateMaskBand( int nFlagsIn );
537
538 virtual GDALAsyncReader*
539 BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize,
540 void *pBuf, int nBufXSize, int nBufYSize,
541 GDALDataType eBufType,
542 int nBandCount, int* panBandMap,
543 int nPixelSpace, int nLineSpace, int nBandSpace,
544 char **papszOptions);
545 virtual void EndAsyncReader(GDALAsyncReader *);
546
547 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
548 void *, int, int, GDALDataType,
549 int, int *, GSpacing, GSpacing, GSpacing,
550 GDALRasterIOExtraArg* psExtraArg
551#ifndef DOXYGEN_SKIP
552 OPTIONAL_OUTSIDE_GDAL(nullptr)
553#endif
555
556 int Reference();
557 int Dereference();
558 int ReleaseRef();
559
563 GDALAccess GetAccess() const { return eAccess; }
564
565 int GetShared() const;
566 void MarkAsShared();
567
569 void MarkSuppressOnClose() { bSuppressOnClose = true; }
570
574 char **GetOpenOptions() { return papszOpenOptions; }
575
576 static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
577
578 CPLErr BuildOverviews( const char *, int, int *,
579 int, int *, GDALProgressFunc, void * );
580
581 void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
582
583 char ** GetMetadata(const char * pszDomain = "") override;
584
585// Only defined when Doxygen enabled
586#ifdef DOXYGEN_SKIP
587 CPLErr SetMetadata( char ** papszMetadata,
588 const char * pszDomain ) override;
589 const char *GetMetadataItem( const char * pszName,
590 const char * pszDomain ) override;
591 CPLErr SetMetadataItem( const char * pszName,
592 const char * pszValue,
593 const char * pszDomain ) override;
594#endif
595
596 char **GetMetadataDomainList() override;
597
601 static inline GDALDatasetH ToHandle(GDALDataset* poDS)
602 { return static_cast<GDALDatasetH>(poDS); }
603
608 { return static_cast<GDALDataset*>(hDS); }
609
613 static GDALDataset* Open( const char* pszFilename,
614 unsigned int nOpenFlags = 0,
615 const char* const* papszAllowedDrivers = nullptr,
616 const char* const* papszOpenOptions = nullptr,
617 const char* const* papszSiblingFiles = nullptr )
618 {
619 return FromHandle(GDALOpenEx(pszFilename, nOpenFlags,
620 papszAllowedDrivers,
621 papszOpenOptions,
622 papszSiblingFiles));
623 }
624
627 {
630
632 OGRLayer* layer = nullptr;
633 };
634
635private:
636 class Private;
637 Private *m_poPrivate;
638
639 CPL_INTERNAL OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
640 OGRGeometry *poSpatialFilter,
641 const char *pszDialect,
642 swq_select_parse_options* poSelectParseOptions);
643 CPLStringList oDerivedMetadataList{};
644
645 public:
646
647 virtual int GetLayerCount();
648 virtual OGRLayer *GetLayer(int iLayer);
649
653 class CPL_DLL Layers
654 {
655 private:
656
657 friend class GDALDataset;
658 GDALDataset* m_poSelf;
659 CPL_INTERNAL explicit Layers(GDALDataset* poSelf): m_poSelf(poSelf) {}
660
661 public:
662
666 class CPL_DLL Iterator
667 {
668 struct Private;
669 std::unique_ptr<Private> m_poPrivate;
670 public:
671
674 using difference_type = void;
675 using pointer = void;
676 using iterator_category = std::input_iterator_tag;
678 Iterator();
679 Iterator(GDALDataset* poDS, bool bStart);
680 Iterator(const Iterator& oOther);
681 Iterator(Iterator&& oOther) noexcept;
684 Iterator& operator=(const Iterator& oOther);
685 Iterator& operator=(Iterator&& oOther) noexcept;
687 OGRLayer* operator*() const;
688 Iterator& operator++();
689 Iterator operator++(int);
690 bool operator!=(const Iterator& it) const;
691 };
692
693 Iterator begin() const;
694 Iterator end() const;
695
696 size_t size() const;
697
698 OGRLayer* operator[](int iLayer);
699 OGRLayer* operator[](size_t iLayer);
700 OGRLayer* operator[](const char* pszLayername);
701 };
702
703 Layers GetLayers();
704
705 virtual OGRLayer *GetLayerByName(const char *);
706 virtual OGRErr DeleteLayer(int iLayer);
707
708 virtual void ResetReading();
709 virtual OGRFeature* GetNextFeature( OGRLayer** ppoBelongingLayer,
710 double* pdfProgressPct,
711 GDALProgressFunc pfnProgress,
712 void* pProgressData );
713
714
716 class CPL_DLL Features
717 {
718 private:
719
720 friend class GDALDataset;
721 GDALDataset* m_poSelf;
722 CPL_INTERNAL explicit Features(GDALDataset* poSelf): m_poSelf(poSelf) {}
723
724 class CPL_DLL Iterator
725 {
726 struct Private;
727 std::unique_ptr<Private> m_poPrivate;
728 public:
729 Iterator(GDALDataset* poDS, bool bStart);
730 Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
731 Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
732 ~Iterator();
733 const FeatureLayerPair& operator*() const;
734 Iterator& operator++();
735 bool operator!=(const Iterator& it) const;
736 };
737
738 public:
739
740 const Iterator begin() const;
741
742 const Iterator end() const;
743 };
744
745 Features GetFeatures();
746
747 virtual int TestCapability( const char * );
748
749 virtual OGRLayer *CreateLayer( const char *pszName,
750 OGRSpatialReference *poSpatialRef = nullptr,
752 char ** papszOptions = nullptr );
753 virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
754 const char *pszNewName,
755 char **papszOptions = nullptr );
756
757 virtual OGRStyleTable *GetStyleTable();
758 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
759
760 virtual void SetStyleTable(OGRStyleTable *poStyleTable);
761
762 virtual OGRLayer * ExecuteSQL( const char *pszStatement,
763 OGRGeometry *poSpatialFilter,
764 const char *pszDialect );
765 virtual void ReleaseResultSet( OGRLayer * poResultsSet );
766
767 int GetRefCount() const;
768 int GetSummaryRefCount() const;
769 OGRErr Release();
770
771 virtual OGRErr StartTransaction(int bForce=FALSE);
772 virtual OGRErr CommitTransaction();
773 virtual OGRErr RollbackTransaction();
774
776 static int IsGenericSQLDialect(const char* pszDialect);
777
778 // Semi-public methods. Only to be used by in-tree drivers.
779 GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
780 swq_select_parse_options* poSelectParseOptions);
781 static void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
782 OGRLayer * ExecuteSQL( const char *pszStatement,
783 OGRGeometry *poSpatialFilter,
784 const char *pszDialect,
785 swq_select_parse_options* poSelectParseOptions);
787
788 protected:
789 virtual OGRLayer *ICreateLayer( const char *pszName,
790 OGRSpatialReference *poSpatialRef = nullptr,
792 char ** papszOptions = nullptr );
793
795 OGRErr ProcessSQLCreateIndex( const char * );
796 OGRErr ProcessSQLDropIndex( const char * );
797 OGRErr ProcessSQLDropTable( const char * );
798 OGRErr ProcessSQLAlterTableAddColumn( const char * );
799 OGRErr ProcessSQLAlterTableDropColumn( const char * );
800 OGRErr ProcessSQLAlterTableAlterColumn( const char * );
801 OGRErr ProcessSQLAlterTableRenameColumn( const char * );
802
803 OGRStyleTable *m_poStyleTable = nullptr;
804
805 // Compatibility layers
806 const OGRSpatialReference* GetSpatialRefFromOldGetProjectionRef() const;
807 CPLErr OldSetProjectionFromSetSpatialRef(const OGRSpatialReference* poSRS);
808 const OGRSpatialReference* GetGCPSpatialRefFromOldGetGCPProjection() const;
809 CPLErr OldSetGCPsFromNew( int nGCPCount, const GDAL_GCP *pasGCPList,
810 const OGRSpatialReference * poGCP_SRS );
811
812 friend class GDALProxyPoolDataset;
813 virtual const char *_GetProjectionRef();
814 const char *GetProjectionRefFromSpatialRef(const OGRSpatialReference*) const;
815 virtual const char *_GetGCPProjection();
816 const char *GetGCPProjectionFromSpatialRef(const OGRSpatialReference* poSRS) const;
817 virtual CPLErr _SetProjection( const char * pszProjection );
818 virtual CPLErr _SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
819 const char *pszGCPProjection );
821
822 private:
824};
825
827struct CPL_DLL GDALDatasetUniquePtrDeleter
828{
829 void operator()(GDALDataset* poDataset) const
830 { GDALClose(poDataset); }
831};
833
839typedef std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter> GDALDatasetUniquePtr;
840
841/* ******************************************************************** */
842/* GDALRasterBlock */
843/* ******************************************************************** */
844
849class CPL_DLL GDALRasterBlock
850{
851 friend class GDALAbstractBandBlockCache;
852
853 GDALDataType eType;
854
855 bool bDirty;
856 volatile int nLockCount;
857
858 int nXOff;
859 int nYOff;
860
861 int nXSize;
862 int nYSize;
863
864 void *pData;
865
866 GDALRasterBand *poBand;
867
868 GDALRasterBlock *poNext;
869 GDALRasterBlock *poPrevious;
870
871 bool bMustDetach;
872
873 CPL_INTERNAL void Detach_unlocked( void );
874 CPL_INTERNAL void Touch_unlocked( void );
875
876 CPL_INTERNAL void RecycleFor( int nXOffIn, int nYOffIn );
877
878 public:
879 GDALRasterBlock( GDALRasterBand *, int, int );
880 GDALRasterBlock( int nXOffIn, int nYOffIn ); /* only for lookup purpose */
881 virtual ~GDALRasterBlock();
882
883 CPLErr Internalize( void );
884 void Touch( void );
885 void MarkDirty( void );
886 void MarkClean( void );
888 int AddLock( void ) { return CPLAtomicInc(&nLockCount); }
890 int DropLock( void ) { return CPLAtomicDec(&nLockCount); }
891 void Detach();
892
893 CPLErr Write();
894
898 GDALDataType GetDataType() const { return eType; }
902 int GetXOff() const { return nXOff; }
906 int GetYOff() const { return nYOff; }
910 int GetXSize() const { return nXSize; }
914 int GetYSize() const { return nYSize; }
918 int GetDirty() const { return bDirty; }
922 void *GetDataRef( void ) { return pData; }
927 return static_cast<GPtrDiff_t>(nXSize) * nYSize * GDALGetDataTypeSizeBytes(eType); }
928
929 int TakeLock();
930 int DropLockForRemovalFromStorage();
931
934 GDALRasterBand *GetBand() { return poBand; }
935
936 static void FlushDirtyBlocks();
937 static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE);
938 static void Verify();
939
940 static void EnterDisableDirtyBlockFlush();
941 static void LeaveDisableDirtyBlockFlush();
942
943#ifdef notdef
944 static void CheckNonOrphanedBlocks(GDALRasterBand* poBand);
945 void DumpBlock();
946 static void DumpAll();
947#endif
948
949 /* Should only be called by GDALDestroyDriverManager() */
951 CPL_INTERNAL static void DestroyRBMutex();
953
954 private:
956};
957
958/* ******************************************************************** */
959/* GDALColorTable */
960/* ******************************************************************** */
961
964class CPL_DLL GDALColorTable
965{
966 GDALPaletteInterp eInterp;
967
968 std::vector<GDALColorEntry> aoEntries{};
969
970public:
973
974 GDALColorTable *Clone() const;
975 int IsSame(const GDALColorTable* poOtherCT) const;
976
977 GDALPaletteInterp GetPaletteInterpretation() const;
978
979 int GetColorEntryCount() const;
980 const GDALColorEntry *GetColorEntry( int ) const;
981 int GetColorEntryAsRGB( int, GDALColorEntry * ) const;
982 void SetColorEntry( int, const GDALColorEntry * );
983 int CreateColorRamp( int, const GDALColorEntry * ,
984 int, const GDALColorEntry * );
985
990 { return static_cast<GDALColorTableH>(poCT); }
991
996 { return static_cast<GDALColorTable*>(hCT); }
997
998};
999
1000/* ******************************************************************** */
1001/* GDALAbstractBandBlockCache */
1002/* ******************************************************************** */
1003
1005
1007// only used by GDALRasterBand implementation.
1008
1009class GDALAbstractBandBlockCache
1010{
1011 // List of blocks that can be freed or recycled, and its lock
1012 CPLLock *hSpinLock = nullptr;
1013 GDALRasterBlock *psListBlocksToFree = nullptr;
1014
1015 // Band keep alive counter, and its lock & condition
1016 CPLCond *hCond = nullptr;
1017 CPLMutex *hCondMutex = nullptr;
1018 volatile int nKeepAliveCounter = 0;
1019
1020 volatile int m_nDirtyBlocks = 0;
1021
1022 CPL_DISALLOW_COPY_ASSIGN(GDALAbstractBandBlockCache)
1023
1024 protected:
1025 GDALRasterBand *poBand;
1026
1027 int m_nInitialDirtyBlocksInFlushCache = 0;
1028 int m_nLastTick = -1;
1029
1030 void FreeDanglingBlocks();
1031 void UnreferenceBlockBase();
1032
1033 void StartDirtyBlockFlushingLog();
1034 void UpdateDirtyBlockFlushingLog();
1035 void EndDirtyBlockFlushingLog();
1036
1037 public:
1038 explicit GDALAbstractBandBlockCache(GDALRasterBand* poBand);
1039 virtual ~GDALAbstractBandBlockCache();
1040
1041 GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff);
1042 void AddBlockToFreeList( GDALRasterBlock * );
1043 void IncDirtyBlocks(int nInc);
1044 void WaitCompletionPendingTasks();
1045
1046 virtual bool Init() = 0;
1047 virtual bool IsInitOK() = 0;
1048 virtual CPLErr FlushCache() = 0;
1049 virtual CPLErr AdoptBlock( GDALRasterBlock* poBlock ) = 0;
1050 virtual GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff,
1051 int nYBlockYOff ) = 0;
1052 virtual CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ) = 0;
1053 virtual CPLErr FlushBlock( int nXBlockOff, int nYBlockOff,
1054 int bWriteDirtyBlock ) = 0;
1055};
1056
1057GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand);
1058GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand);
1059
1061
1062/* ******************************************************************** */
1063/* GDALRasterBand */
1064/* ******************************************************************** */
1065
1068class CPL_DLL GDALRasterBand : public GDALMajorObject
1069{
1070 private:
1071 friend class GDALArrayBandBlockCache;
1072 friend class GDALHashSetBandBlockCache;
1073 friend class GDALRasterBlock;
1074 friend class GDALDataset;
1075
1076 CPLErr eFlushBlockErr = CE_None;
1077 GDALAbstractBandBlockCache* poBandBlockCache = nullptr;
1078
1079 CPL_INTERNAL void SetFlushBlockErr( CPLErr eErr );
1080 CPL_INTERNAL CPLErr UnreferenceBlock( GDALRasterBlock* poBlock );
1081 CPL_INTERNAL void SetValidPercent( GUIntBig nSampleCount, GUIntBig nValidCount );
1082 CPL_INTERNAL void IncDirtyBlocks(int nInc);
1083
1084 protected:
1086 GDALDataset *poDS = nullptr;
1087 int nBand = 0; /* 1 based */
1088
1089 int nRasterXSize = 0;
1090 int nRasterYSize = 0;
1091
1092 GDALDataType eDataType = GDT_Byte;
1093 GDALAccess eAccess = GA_ReadOnly;
1094
1095 /* stuff related to blocking, and raster cache */
1096 int nBlockXSize = -1;
1097 int nBlockYSize = -1;
1098 int nBlocksPerRow = 0;
1099 int nBlocksPerColumn = 0;
1100
1101 int nBlockReads = 0;
1102 int bForceCachedIO = 0;
1103
1104 GDALRasterBand *poMask = nullptr;
1105 bool bOwnMask = false;
1106 int nMaskFlags = 0;
1107
1108 void InvalidateMaskBand();
1109
1110 friend class GDALProxyRasterBand;
1111 friend class GDALDefaultOverviews;
1112
1113 CPLErr RasterIOResampled( GDALRWFlag, int, int, int, int,
1114 void *, int, int, GDALDataType,
1116
1117 int EnterReadWrite(GDALRWFlag eRWFlag);
1118 void LeaveReadWrite();
1119 void InitRWLock();
1121
1122 protected:
1123 virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
1124 virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
1125
1126 virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1127 void *, int, int, GDALDataType,
1129
1130 virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
1131 int nXSize, int nYSize,
1132 int nMaskFlagStop,
1133 double* pdfDataPct);
1135 CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
1136 void *, int, int, GDALDataType,
1138
1139 CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
1140 int nXOff, int nYOff, int nXSize, int nYSize,
1141 void * pData, int nBufXSize, int nBufYSize,
1142 GDALDataType eBufType,
1143 GSpacing nPixelSpace, GSpacing nLineSpace,
1144 GDALRasterIOExtraArg* psExtraArg,
1145 int* pbTried );
1146
1147 int InitBlockInfo();
1148
1149 void AddBlockToFreeList( GDALRasterBlock * );
1151
1152 GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
1153
1154 public:
1156 explicit GDALRasterBand(int bForceCachedIO);
1157
1158 ~GDALRasterBand() override;
1159
1160 int GetXSize();
1161 int GetYSize();
1162 int GetBand();
1163 GDALDataset*GetDataset();
1164
1165 GDALDataType GetRasterDataType( void );
1166 void GetBlockSize( int *, int * );
1167 CPLErr GetActualBlockSize ( int, int, int *, int * );
1168 GDALAccess GetAccess();
1169
1170 CPLErr RasterIO( GDALRWFlag, int, int, int, int,
1171 void *, int, int, GDALDataType,
1173#ifndef DOXYGEN_SKIP
1174 OPTIONAL_OUTSIDE_GDAL(nullptr)
1175#endif
1177 CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1178
1179 CPLErr WriteBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1180
1181 GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
1182 int bJustInitialize = FALSE ) CPL_WARN_UNUSED_RESULT;
1183 CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE );
1184
1185 unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
1186 unsigned char* pTranslationTable = nullptr,
1187 int* pApproximateMatching = nullptr);
1188
1189 // New OpengIS CV_SampleDimension stuff.
1190
1191 virtual CPLErr FlushCache();
1192 virtual char **GetCategoryNames();
1193 virtual double GetNoDataValue( int *pbSuccess = nullptr );
1194 virtual double GetMinimum( int *pbSuccess = nullptr );
1195 virtual double GetMaximum(int *pbSuccess = nullptr );
1196 virtual double GetOffset( int *pbSuccess = nullptr );
1197 virtual double GetScale( int *pbSuccess = nullptr );
1198 virtual const char *GetUnitType();
1199 virtual GDALColorInterp GetColorInterpretation();
1200 virtual GDALColorTable *GetColorTable();
1201 virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
1202
1203 virtual CPLErr SetCategoryNames( char ** papszNames );
1204 virtual CPLErr SetNoDataValue( double dfNoData );
1205 virtual CPLErr DeleteNoDataValue();
1206 virtual CPLErr SetColorTable( GDALColorTable * poCT );
1207 virtual CPLErr SetColorInterpretation( GDALColorInterp eColorInterp );
1208 virtual CPLErr SetOffset( double dfNewOffset );
1209 virtual CPLErr SetScale( double dfNewScale );
1210 virtual CPLErr SetUnitType( const char * pszNewValue );
1211
1212 virtual CPLErr GetStatistics( int bApproxOK, int bForce,
1213 double *pdfMin, double *pdfMax,
1214 double *pdfMean, double *padfStdDev );
1215 virtual CPLErr ComputeStatistics( int bApproxOK,
1216 double *pdfMin, double *pdfMax,
1217 double *pdfMean, double *pdfStdDev,
1218 GDALProgressFunc, void *pProgressData );
1219 virtual CPLErr SetStatistics( double dfMin, double dfMax,
1220 double dfMean, double dfStdDev );
1221 virtual CPLErr ComputeRasterMinMax( int, double* );
1222
1223// Only defined when Doxygen enabled
1224#ifdef DOXYGEN_SKIP
1225 char **GetMetadata( const char * pszDomain = "" ) override;
1226 CPLErr SetMetadata( char ** papszMetadata,
1227 const char * pszDomain ) override;
1228 const char *GetMetadataItem( const char * pszName,
1229 const char * pszDomain ) override;
1230 CPLErr SetMetadataItem( const char * pszName,
1231 const char * pszValue,
1232 const char * pszDomain ) override;
1233#endif
1234
1235 virtual int HasArbitraryOverviews();
1236 virtual int GetOverviewCount();
1237 virtual GDALRasterBand *GetOverview(int);
1238 virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
1239 virtual CPLErr BuildOverviews( const char * pszResampling,
1240 int nOverviews,
1241 int * panOverviewList,
1242 GDALProgressFunc pfnProgress,
1243 void * pProgressData );
1244
1245 virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
1246 int nBufXSize, int nBufYSize,
1247 GDALDataType eBufType, char **papszOptions );
1248
1249 virtual CPLErr GetHistogram( double dfMin, double dfMax,
1250 int nBuckets, GUIntBig * panHistogram,
1251 int bIncludeOutOfRange, int bApproxOK,
1252 GDALProgressFunc, void *pProgressData );
1253
1254 virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
1255 int *pnBuckets, GUIntBig ** ppanHistogram,
1256 int bForce,
1257 GDALProgressFunc, void *pProgressData);
1258 virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
1259 int nBuckets, GUIntBig *panHistogram );
1260
1261 virtual GDALRasterAttributeTable *GetDefaultRAT();
1262 virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT );
1263
1264 virtual GDALRasterBand *GetMaskBand();
1265 virtual int GetMaskFlags();
1266 virtual CPLErr CreateMaskBand( int nFlagsIn );
1267
1268 virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
1269 int *pnPixelSpace,
1270 GIntBig *pnLineSpace,
1271 char **papszOptions ) CPL_WARN_UNUSED_RESULT;
1272
1273 int GetDataCoverageStatus( int nXOff, int nYOff,
1274 int nXSize, int nYSize,
1275 int nMaskFlagStop = 0,
1276 double* pdfDataPct = nullptr );
1277
1278 void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
1279
1283 static inline GDALRasterBandH ToHandle(GDALRasterBand* poBand)
1284 { return static_cast<GDALRasterBandH>(poBand); }
1285
1290 { return static_cast<GDALRasterBand*>(hBand); }
1291
1292private:
1294};
1295
1297/* ******************************************************************** */
1298/* GDALAllValidMaskBand */
1299/* ******************************************************************** */
1300
1301class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
1302{
1303 protected:
1304 CPLErr IReadBlock( int, int, void * ) override;
1305
1306 CPL_DISALLOW_COPY_ASSIGN(GDALAllValidMaskBand)
1307
1308 public:
1309 explicit GDALAllValidMaskBand( GDALRasterBand * );
1310 ~GDALAllValidMaskBand() override;
1311
1312 GDALRasterBand *GetMaskBand() override;
1313 int GetMaskFlags() override;
1314
1315 CPLErr ComputeStatistics( int bApproxOK,
1316 double *pdfMin, double *pdfMax,
1317 double *pdfMean, double *pdfStdDev,
1318 GDALProgressFunc, void *pProgressData ) override;
1319
1320};
1321
1322/* ******************************************************************** */
1323/* GDALNoDataMaskBand */
1324/* ******************************************************************** */
1325
1326class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
1327{
1328 double dfNoDataValue;
1329 GDALRasterBand *poParent;
1330
1331 CPL_DISALLOW_COPY_ASSIGN(GDALNoDataMaskBand)
1332
1333 protected:
1334 CPLErr IReadBlock( int, int, void * ) override;
1335 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1336 void *, int, int, GDALDataType,
1337 GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
1338
1339 public:
1340 explicit GDALNoDataMaskBand( GDALRasterBand * );
1341 ~GDALNoDataMaskBand() override;
1342
1343 static bool IsNoDataInRange(double dfNoDataValue,
1344 GDALDataType eDataType);
1345};
1346
1347/* ******************************************************************** */
1348/* GDALNoDataValuesMaskBand */
1349/* ******************************************************************** */
1350
1351class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
1352{
1353 double *padfNodataValues;
1354
1355 CPL_DISALLOW_COPY_ASSIGN(GDALNoDataValuesMaskBand)
1356
1357 protected:
1358 CPLErr IReadBlock( int, int, void * ) override;
1359
1360 public:
1361 explicit GDALNoDataValuesMaskBand( GDALDataset * );
1362 ~GDALNoDataValuesMaskBand() override;
1363};
1364
1365/* ******************************************************************** */
1366/* GDALRescaledAlphaBand */
1367/* ******************************************************************** */
1368
1369class GDALRescaledAlphaBand : public GDALRasterBand
1370{
1371 GDALRasterBand *poParent;
1372 void *pTemp;
1373
1374 CPL_DISALLOW_COPY_ASSIGN(GDALRescaledAlphaBand)
1375
1376 protected:
1377 CPLErr IReadBlock( int, int, void * ) override;
1378 CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1379 void *, int, int, GDALDataType,
1381 GDALRasterIOExtraArg* psExtraArg ) override;
1382
1383 public:
1384 explicit GDALRescaledAlphaBand( GDALRasterBand * );
1385 ~GDALRescaledAlphaBand() override;
1386};
1388
1389/* ******************************************************************** */
1390/* GDALIdentifyEnum */
1391/* ******************************************************************** */
1392
1398typedef enum
1399{
1407
1408/* ******************************************************************** */
1409/* GDALDriver */
1410/* ******************************************************************** */
1411
1423class CPL_DLL GDALDriver : public GDALMajorObject
1424{
1425 public:
1426 GDALDriver();
1427 ~GDALDriver() override;
1428
1429 CPLErr SetMetadataItem( const char * pszName,
1430 const char * pszValue,
1431 const char * pszDomain = "" ) override;
1432
1433/* -------------------------------------------------------------------- */
1434/* Public C++ methods. */
1435/* -------------------------------------------------------------------- */
1436 GDALDataset *Create( const char * pszName,
1437 int nXSize, int nYSize, int nBands,
1438 GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT;
1439
1440 CPLErr Delete( const char * pszName );
1441 CPLErr Rename( const char * pszNewName,
1442 const char * pszOldName );
1443 CPLErr CopyFiles( const char * pszNewName,
1444 const char * pszOldName );
1445
1446 GDALDataset *CreateCopy( const char *, GDALDataset *,
1447 int, char **,
1448 GDALProgressFunc pfnProgress,
1449 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1450
1451/* -------------------------------------------------------------------- */
1452/* The following are semiprivate, not intended to be accessed */
1453/* by anyone but the formats instantiating and populating the */
1454/* drivers. */
1455/* -------------------------------------------------------------------- */
1457 GDALDataset *(*pfnOpen)( GDALOpenInfo * );
1458
1459 GDALDataset *(*pfnCreate)( const char * pszName,
1460 int nXSize, int nYSize, int nBands,
1461 GDALDataType eType,
1462 char ** papszOptions );
1463
1464 CPLErr (*pfnDelete)( const char * pszName );
1465
1466 GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *,
1467 int, char **,
1468 GDALProgressFunc pfnProgress,
1469 void * pProgressData );
1470
1471 void *pDriverData;
1472
1473 void (*pfnUnloadDriver)(GDALDriver *);
1474
1482 int (*pfnIdentify)( GDALOpenInfo * );
1483
1484 CPLErr (*pfnRename)( const char * pszNewName,
1485 const char * pszOldName );
1486 CPLErr (*pfnCopyFiles)( const char * pszNewName,
1487 const char * pszOldName );
1488
1489 /* For legacy OGR drivers */
1490 GDALDataset *(*pfnOpenWithDriverArg)( GDALDriver*, GDALOpenInfo * );
1491 GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*,
1492 const char * pszName,
1493 char ** papszOptions );
1494 CPLErr (*pfnDeleteDataSource)( GDALDriver*,
1495 const char * pszName );
1497
1498/* -------------------------------------------------------------------- */
1499/* Helper methods. */
1500/* -------------------------------------------------------------------- */
1502 GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
1503 int, char **,
1504 GDALProgressFunc pfnProgress,
1505 void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1506 static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1507 GDALDataset *poDstDS,
1508 int bStrict );
1509 static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1510 GDALDataset *poDstDS,
1511 int bStrict,
1512 CSLConstList papszOptions,
1513 GDALProgressFunc pfnProgress,
1514 void * pProgressData );
1516 static CPLErr QuietDelete( const char * pszName );
1517
1519 static CPLErr DefaultRename( const char * pszNewName,
1520 const char * pszOldName );
1521 static CPLErr DefaultCopyFiles( const char * pszNewName,
1522 const char * pszOldName );
1524
1528 static inline GDALDriverH ToHandle(GDALDriver* poDriver)
1529 { return static_cast<GDALDriverH>(poDriver); }
1530
1534 static inline GDALDriver* FromHandle(GDALDriverH hDriver)
1535 { return static_cast<GDALDriver*>(hDriver); }
1536
1537private:
1539};
1540
1541/* ******************************************************************** */
1542/* GDALDriverManager */
1543/* ******************************************************************** */
1544
1553{
1554 int nDrivers = 0;
1555 GDALDriver **papoDrivers = nullptr;
1556 std::map<CPLString, GDALDriver*> oMapNameToDrivers{};
1557
1558 GDALDriver *GetDriver_unlocked( int iDriver )
1559 { return (iDriver >= 0 && iDriver < nDrivers) ?
1560 papoDrivers[iDriver] : nullptr; }
1561
1562 GDALDriver *GetDriverByName_unlocked( const char * pszName )
1563 { return oMapNameToDrivers[CPLString(pszName).toupper()]; }
1564
1566
1567 public:
1570
1571 int GetDriverCount( void ) const;
1572 GDALDriver *GetDriver( int );
1573 GDALDriver *GetDriverByName( const char * );
1574
1575 int RegisterDriver( GDALDriver * );
1576 void DeregisterDriver( GDALDriver * );
1577
1578 // AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined.
1579 static void AutoLoadDrivers();
1580 void AutoSkipDrivers();
1581};
1582
1584GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
1586
1587/* ******************************************************************** */
1588/* GDALAsyncReader */
1589/* ******************************************************************** */
1590
1596class CPL_DLL GDALAsyncReader
1597{
1598
1600
1601 protected:
1603 GDALDataset* poDS;
1604 int nXOff;
1605 int nYOff;
1606 int nXSize;
1607 int nYSize;
1608 void * pBuf;
1609 int nBufXSize;
1610 int nBufYSize;
1611 GDALDataType eBufType;
1612 int nBandCount;
1613 int* panBandMap;
1614 int nPixelSpace;
1615 int nLineSpace;
1616 int nBandSpace;
1618
1619 public:
1621 virtual ~GDALAsyncReader();
1622
1626 GDALDataset* GetGDALDataset() {return poDS;}
1630 int GetXOffset() const { return nXOff; }
1634 int GetYOffset() const { return nYOff; }
1638 int GetXSize() const { return nXSize; }
1642 int GetYSize() const { return nYSize; }
1646 void * GetBuffer() {return pBuf;}
1650 int GetBufferXSize() const { return nBufXSize; }
1654 int GetBufferYSize() const { return nBufYSize; }
1658 GDALDataType GetBufferType() const { return eBufType; }
1662 int GetBandCount() const { return nBandCount; }
1666 int* GetBandMap() { return panBandMap; }
1670 int GetPixelSpace() const { return nPixelSpace; }
1674 int GetLineSpace() const { return nLineSpace; }
1678 int GetBandSpace() const { return nBandSpace; }
1679
1680 virtual GDALAsyncStatusType
1681 GetNextUpdatedRegion(double dfTimeout,
1682 int* pnBufXOff, int* pnBufYOff,
1683 int* pnBufXSize, int* pnBufYSize) = 0;
1684 virtual int LockBuffer( double dfTimeout = -1.0 );
1685 virtual void UnlockBuffer();
1686};
1687
1688/* ==================================================================== */
1689/* An assortment of overview related stuff. */
1690/* ==================================================================== */
1691
1693/* Only exported for drivers as plugin. Signature may change */
1694CPLErr CPL_DLL
1695GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
1696 int nOverviews,
1697 GDALRasterBand*** papapoOverviewBands,
1698 const char * pszResampling,
1699 GDALProgressFunc pfnProgress, void * pProgressData );
1700
1701typedef CPLErr (*GDALResampleFunction)
1702 ( double dfXRatioDstToSrc,
1703 double dfYRatioDstToSrc,
1704 double dfSrcXDelta,
1705 double dfSrcYDelta,
1706 GDALDataType eWrkDataType,
1707 void * pChunk,
1708 GByte * pabyChunkNodataMask,
1709 int nChunkXOff, int nChunkXSize,
1710 int nChunkYOff, int nChunkYSize,
1711 int nDstXOff, int nDstXOff2,
1712 int nDstYOff, int nDstYOff2,
1713 GDALRasterBand * poOverview,
1714 const char * pszResampling,
1715 int bHasNoData, float fNoDataValue,
1716 GDALColorTable* poColorTable,
1717 GDALDataType eSrcDataType,
1718 bool bPropagateNoData );
1719
1720GDALResampleFunction GDALGetResampleFunction(const char* pszResampling,
1721 int* pnRadius);
1722
1723#ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND
1724typedef CPLErr (*GDALResampleFunctionMultiBands)
1725 ( double dfXRatioDstToSrc,
1726 double dfYRatioDstToSrc,
1727 double dfSrcXDelta,
1728 double dfSrcYDelta,
1729 GDALDataType eWrkDataType,
1730 void * pChunk, int nBands,
1731 GByte * pabyChunkNodataMask,
1732 int nChunkXOff, int nChunkXSize,
1733 int nChunkYOff, int nChunkYSize,
1734 int nDstXOff, int nDstXOff2,
1735 int nDstYOff, int nDstYOff2,
1736 GDALRasterBand ** papoDstBands,
1737 const char * pszResampling,
1738 int bHasNoData, float fNoDataValue,
1739 GDALColorTable* poColorTable,
1740 GDALDataType eSrcDataType);
1741
1742GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(const char* pszResampling,
1743 int* pnRadius);
1744#endif
1745
1746GDALDataType GDALGetOvrWorkDataType(const char* pszResampling,
1747 GDALDataType eSrcDataType);
1748
1750
1751CPLErr CPL_DLL
1752HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
1753 GDALDataset **ppoDS,
1754 int nBands, int *panBandList,
1755 int nNewOverviews, int *panNewOverviewList,
1756 const char *pszResampling,
1757 GDALProgressFunc pfnProgress,
1758 void *pProgressData );
1759
1760CPLErr CPL_DLL
1761GTIFFBuildOverviews( const char * pszFilename,
1762 int nBands, GDALRasterBand **papoBandList,
1763 int nOverviews, int * panOverviewList,
1764 const char * pszResampling,
1765 GDALProgressFunc pfnProgress, void * pProgressData );
1766
1767CPLErr CPL_DLL
1768GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
1769 const char * pszResampling,
1770 int nOverviews, int * panOverviewList,
1771 int nBands, int * panBandList,
1772 GDALProgressFunc pfnProgress, void * pProgressData);
1773
1774int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
1775 int &nXOff, int &nYOff,
1776 int &nXSize, int &nYSize,
1777 int nBufXSize, int nBufYSize) CPL_WARN_DEPRECATED("Use GDALBandGetBestOverviewLevel2 instead");
1778int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand,
1779 int &nXOff, int &nYOff,
1780 int &nXSize, int &nYSize,
1781 int nBufXSize, int nBufYSize,
1782 GDALRasterIOExtraArg* psExtraArg);
1783
1784int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize ) CPL_WARN_DEPRECATED("Use GDALOvLevelAdjust2 instead");
1785int CPL_DLL GDALOvLevelAdjust2( int nOvLevel, int nXSize, int nYSize );
1786int CPL_DLL GDALComputeOvFactor( int nOvrXSize, int nRasterXSize,
1787 int nOvrYSize, int nRasterYSize );
1788
1789GDALDataset CPL_DLL *
1790GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
1791 GDALDataset *poDependentDS );
1792
1793/* ==================================================================== */
1794/* Infrastructure to check that dataset characteristics are valid */
1795/* ==================================================================== */
1796
1797int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
1798int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
1799
1800/* Internal use only */
1801
1802/* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */
1803int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension,
1804 double *padfGeoTransform, char** papszSiblingFiles,
1805 char** ppszWorldFileNameOut);
1806int GDALReadTabFile2( const char * pszBaseFilename,
1807 double *padfGeoTransform, char **ppszWKT,
1808 int *pnGCPCount, GDAL_GCP **ppasGCPs,
1809 char** papszSiblingFiles, char** ppszTabFileNameOut );
1810
1811void CPL_DLL GDALCopyRasterIOExtraArg(GDALRasterIOExtraArg* psDestArg,
1812 GDALRasterIOExtraArg* psSrcArg);
1813
1815
1816void GDALNullifyOpenDatasetsList();
1817CPLMutex** GDALGetphDMMutex();
1818CPLMutex** GDALGetphDLMutex();
1819void GDALNullifyProxyPoolSingleton();
1820GDALDriver* GDALGetAPIPROXYDriver();
1821void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
1822GIntBig GDALGetResponsiblePIDForCurrentThread();
1823
1824CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
1825 CSLConstList papszSiblingFiles, int nFlags );
1826
1827CPLErr EXIFExtractMetadata(char**& papszMetadata,
1828 void *fpL, int nOffset,
1829 int bSwabflag, int nTIFFHEADER,
1830 int& nExifOffset, int& nInterOffset, int& nGPSOffset);
1831
1832int GDALValidateOpenOptions( GDALDriverH hDriver,
1833 const char* const* papszOptionOptions);
1834int GDALValidateOptions( const char* pszOptionList,
1835 const char* const* papszOptionsToValidate,
1836 const char* pszErrorMessageOptionType,
1837 const char* pszErrorMessageContainerName);
1838
1839GDALRIOResampleAlg GDALRasterIOGetResampleAlg(const char* pszResampling);
1840const char* GDALRasterIOGetResampleAlg(GDALRIOResampleAlg eResampleAlg);
1841
1842void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
1843 int nXSize, int nYSize,
1844 int nBufXSize, int nBufYSize);
1845
1846
1847GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
1848 int bThisLevelOnly);
1849
1850// Should cover particular cases of #3573, #4183, #4506, #6578
1851// Behaviour is undefined if fVal1 or fVal2 are NaN (should be tested before
1852// calling this function)
1853template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
1854{
1855 return fVal1 == fVal2 || /* Should cover infinity */
1856 std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
1857}
1858
1859double GDALAdjustNoDataCloseToFloatMax(double dfVal);
1860
1861#define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
1862
1863// Number of data samples that will be used to compute approximate statistics
1864// (minimum value, maximum value, etc.)
1865#define GDALSTAT_APPROX_NUMSAMPLES 2500
1866
1867void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode,
1868 GDAL_GCP* pasGCPList,
1869 int nGCPCount,
1870 const OGRSpatialReference* poGCP_SRS );
1871void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList,
1872 GDAL_GCP** ppasGCPList,
1873 int* pnGCPCount,
1874 OGRSpatialReference** ppoGCP_SRS );
1875
1876void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOptions);
1877char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode );
1878
1879int GDALCanFileAcceptSidecarFile(const char* pszFilename);
1881
1882#endif /* ndef GDAL_PRIV_H_INCLUDED */
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:439
Convenient string class based on std::string.
Definition: cpl_string.h:330
CPLSTRING_METHOD_DLL CPLString & toupper(void)
Convert to upper case in place.
Definition: cplstring.cpp:316
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:1597
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1630
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1634
int GetYSize() const
Return height.
Definition: gdal_priv.h:1642
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1662
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1658
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1678
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1654
int GetXSize() const
Return width.
Definition: gdal_priv.h:1638
virtual GDALAsyncStatusType GetNextUpdatedRegion(double dfTimeout, int *pnBufXOff, int *pnBufYOff, int *pnBufXSize, int *pnBufYSize)=0
Get async IO update.
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:1646
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1670
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1666
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1626
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1674
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1650
A color table / palette.
Definition: gdal_priv.h:965
static GDALColorTableH ToHandle(GDALColorTable *poCT)
Convert a GDALColorTable* to a GDALRasterBandH.
Definition: gdal_priv.h:989
~GDALColorTable()
Destructor.
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition: gdal_priv.h:995
Class returned by GetBands() that act as a container for raster bands.
Definition: gdal_priv.h:463
Class returned by GetFeatures() that act as a container for vector features.
Definition: gdal_priv.h:717
Layer iterator.
Definition: gdal_priv.h:667
void pointer
pointer
Definition: gdal_priv.h:675
void difference_type
difference_type
Definition: gdal_priv.h:674
std::input_iterator_tag iterator_category
iterator_category
Definition: gdal_priv.h:676
Class returned by GetLayers() that acts as a range of layers.
Definition: gdal_priv.h:654
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:336
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3959
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1925
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2941
void MarkSuppressOnClose()
Set that the dataset must be deleted on close.
Definition: gdal_priv.h:569
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:613
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
char ** GetOpenOptions()
Return open options.
Definition: gdal_priv.h:574
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition: gdal_priv.h:607
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition: gdal_priv.h:601
const char * GetMetadataItem(const char *pszName, const char *pszDomain) override
Fetch single metadata item.
GDALAccess GetAccess() const
Return access mode.
Definition: gdal_priv.h:563
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1553
Format specific driver.
Definition: gdal_priv.h:1424
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition: gdal_priv.h:1534
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition: gdal_priv.h:1528
Object with metadata.
Definition: gdal_priv.h:133
static GDALMajorObject * FromHandle(GDALMajorObjectH hMajorObject)
Convert a GDALMajorObjectH to a GDALMajorObject*.
Definition: gdal_priv.h:174
static GDALMajorObjectH ToHandle(GDALMajorObject *poMajorObject)
Convert a GDALMajorObject* to a GDALMajorObjectH.
Definition: gdal_priv.h:168
Class for dataset open functions.
Definition: gdal_priv.h:266
int bStatOK
Whether stat()'ing the file was successful.
Definition: gdal_priv.h:287
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:297
int bIsDirectory
Whether the file is a directory.
Definition: gdal_priv.h:289
char ** papszOpenOptions
Open options.
Definition: gdal_priv.h:279
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:282
int nOpenFlags
Open flags.
Definition: gdal_priv.h:284
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:292
char * pszFilename
Filename.
Definition: gdal_priv.h:277
int nHeaderBytes
Number of bytes in pabyHeader.
Definition: gdal_priv.h:295
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:300
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:48
A single raster band (or channel).
Definition: gdal_priv.h:1069
const char * GetMetadataItem(const char *pszName, const char *pszDomain) override
Fetch single metadata item.
char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
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
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition: gdal_priv.h:1289
A single raster block in the block cache.
Definition: gdal_priv.h:850
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:918
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:934
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:910
GPtrDiff_t GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:926
int GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:914
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:898
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:902
int AddLock(void)
Increment the lock count.
Definition: gdal_priv.h:888
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:922
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:906
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:890
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:355
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:287
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:71
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
This class represents a style table.
Definition: ogr_featurestyle.h:85
Various convenience functions for CPL.
CPLErr
Error category.
Definition: cpl_error.h:53
int CPLErrorNum
Error number.
Definition: cpl_error.h:94
Definitions for CPL mini XML Parser/Serializer.
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition: cpl_port.h:904
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:914
GIntBig GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition: cpl_port.h:286
#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:997
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1194
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:939
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
Various convenience functions for working with strings and string lists.
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
Standard C Covers.
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:156
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:273
GDALAccess
Definition: gdal.h:113
@ GA_ReadOnly
Definition: gdal.h:114
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3588
GDALPaletteInterp
Definition: gdal.h:217
@ GPI_RGB
Definition: gdal.h:219
GDALDataType
Definition: gdal.h:60
@ GDT_Byte
Definition: gdal.h:62
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:255
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:129
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition: gdal_misc.cpp:305
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:3206
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition: gdal.h:252
GDALColorInterp
Definition: gdal.h:191
GDALAsyncStatusType
status of the asynchronous stream
Definition: gdal.h:101
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:261
GDALRWFlag
Definition: gdal.h:119
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:258
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition: gdal.h:264
GDALDriverManager * GetGDALDriverManager(void)
Fetch the global GDAL driver manager.
Definition: gdaldrivermanager.cpp:97
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1399
@ GDAL_IDENTIFY_TRUE
Identify determined the file is recognized by the probed driver.
Definition: gdal_priv.h:1405
@ GDAL_IDENTIFY_FALSE
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1403
@ GDAL_IDENTIFY_UNKNOWN
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1401
std::unique_ptr< GDALDataset, GDALDatasetUniquePtrDeleter > GDALDatasetUniquePtr
Unique pointer type for GDALDataset.
Definition: gdal_priv.h:839
Core portability services for cross-platform OGR code.
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:318
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:319
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
Simple feature classes.
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:780
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:287
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:292
Document node structure.
Definition: cpl_minixml.h:67
Color tuple.
Definition: gdal.h:1060
Object returned by GetFeatures() iterators.
Definition: gdal_priv.h:627
Structure to pass extra arguments to RasterIO() method.
Definition: gdal.h:148
Ground Control Point.
Definition: gdal.h:564

Generated for GDAL by doxygen 1.9.4.