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

Generated for GDAL by doxygen 1.8.8.