GDAL
gdal_priv.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: gdal_priv.h e5e7b313540f0ff913fadfe6a273fb7c356a22cb 2018-11-02 22:54:20 +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 /* -------------------------------------------------------------------- */
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  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  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 char *GetProjectionRef(void);
499  virtual CPLErr SetProjection( const char * pszProjection );
500 
501  virtual CPLErr GetGeoTransform( double * padfTransform );
502  virtual CPLErr SetGeoTransform( double * padfTransform );
503 
504  virtual CPLErr AddBand( GDALDataType eType,
505  char **papszOptions=nullptr );
506 
507  virtual void *GetInternalHandle( const char * pszHandleName );
508  virtual GDALDriver *GetDriver(void);
509  virtual char **GetFileList(void);
510 
511  virtual const char* GetDriverName();
512 
513  virtual int GetGCPCount();
514  virtual const char *GetGCPProjection();
515  virtual const GDAL_GCP *GetGCPs();
516  virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
517  const char *pszGCPProjection );
518 
519  virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
520  int nBufXSize, int nBufYSize,
521  GDALDataType eDT,
522  int nBandCount, int *panBandList,
523  char **papszOptions );
524 
525  virtual CPLErr CreateMaskBand( int nFlagsIn );
526 
527  virtual GDALAsyncReader*
528  BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize,
529  void *pBuf, int nBufXSize, int nBufYSize,
530  GDALDataType eBufType,
531  int nBandCount, int* panBandMap,
532  int nPixelSpace, int nLineSpace, int nBandSpace,
533  char **papszOptions);
534  virtual void EndAsyncReader(GDALAsyncReader *);
535 
536  CPLErr RasterIO( GDALRWFlag, int, int, int, int,
537  void *, int, int, GDALDataType,
538  int, int *, GSpacing, GSpacing, GSpacing,
539  GDALRasterIOExtraArg* psExtraArg
540 #ifndef DOXYGEN_SKIP
541  OPTIONAL_OUTSIDE_GDAL(nullptr)
542 #endif
544 
545  int Reference();
546  int Dereference();
547  int ReleaseRef();
548 
552  GDALAccess GetAccess() const { return eAccess; }
553 
554  int GetShared() const;
555  void MarkAsShared();
556 
558  void MarkSuppressOnClose() { bSuppressOnClose = true; }
559 
563  char **GetOpenOptions() { return papszOpenOptions; }
564 
565  static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
566 
567  CPLErr BuildOverviews( const char *, int, int *,
568  int, int *, GDALProgressFunc, void * );
569 
570  void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
571 
572  char ** GetMetadata(const char * pszDomain = "") override;
573 
574 // Only defined when Doxygen enabled
575 #ifdef DOXYGEN_SKIP
576  CPLErr SetMetadata( char ** papszMetadata,
577  const char * pszDomain ) override;
578  const char *GetMetadataItem( const char * pszName,
579  const char * pszDomain ) override;
580  CPLErr SetMetadataItem( const char * pszName,
581  const char * pszValue,
582  const char * pszDomain ) override;
583 #endif
584 
585  char **GetMetadataDomainList() override;
586 
590  static inline GDALDatasetH ToHandle(GDALDataset* poDS)
591  { return static_cast<GDALDatasetH>(poDS); }
592 
596  static inline GDALDataset* FromHandle(GDALDatasetH hDS)
597  { return static_cast<GDALDataset*>(hDS); }
598 
602  static GDALDataset* Open( const char* pszFilename,
603  unsigned int nOpenFlags = 0,
604  const char* const* papszAllowedDrivers = nullptr,
605  const char* const* papszOpenOptions = nullptr,
606  const char* const* papszSiblingFiles = nullptr )
607  {
608  return FromHandle(GDALOpenEx(pszFilename, nOpenFlags,
609  papszAllowedDrivers,
610  papszOpenOptions,
611  papszSiblingFiles));
612  }
613 
616  {
619 
621  OGRLayer* layer = nullptr;
622  };
623 
624 private:
625  class Private;
626  Private *m_poPrivate;
627 
628  OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
629  OGRGeometry *poSpatialFilter,
630  const char *pszDialect,
631  swq_select_parse_options* poSelectParseOptions);
632  CPLStringList oDerivedMetadataList{};
633 
634  public:
635 
636  virtual int GetLayerCount();
637  virtual OGRLayer *GetLayer(int iLayer);
638 
642  class CPL_DLL Layers
643  {
644  private:
645 
646  friend class GDALDataset;
647  GDALDataset* m_poSelf;
648  explicit Layers(GDALDataset* poSelf): m_poSelf(poSelf) {}
649 
650  public:
651 
655  class CPL_DLL Iterator
656  {
657  struct Private;
658  std::unique_ptr<Private> m_poPrivate;
659  public:
660 
661  using value_type = OGRLayer*;
662  using reference = OGRLayer*;
663  using difference_type = void;
664  using pointer = void;
665  using iterator_category = std::input_iterator_tag;
667  Iterator();
668  Iterator(GDALDataset* poDS, bool bStart);
669  Iterator(const Iterator& oOther);
670  Iterator(Iterator&& oOther) noexcept;
671  ~Iterator();
673  Iterator& operator=(const Iterator& oOther);
674  Iterator& operator=(Iterator&& oOther) noexcept;
676  OGRLayer* operator*() const;
677  Iterator& operator++();
678  Iterator operator++(int);
679  bool operator!=(const Iterator& it) const;
680  };
681 
682  Iterator begin() const;
683  Iterator end() const;
684 
685  size_t size() const;
686 
687  OGRLayer* operator[](int iLayer);
688  OGRLayer* operator[](size_t iLayer);
689  OGRLayer* operator[](const char* pszLayername);
690  };
691 
692  Layers GetLayers();
693 
694  virtual OGRLayer *GetLayerByName(const char *);
695  virtual OGRErr DeleteLayer(int iLayer);
696 
697  virtual void ResetReading();
698  virtual OGRFeature* GetNextFeature( OGRLayer** ppoBelongingLayer,
699  double* pdfProgressPct,
700  GDALProgressFunc pfnProgress,
701  void* pProgressData );
702 
703 
705  class CPL_DLL Features
706  {
707  private:
708 
709  friend class GDALDataset;
710  GDALDataset* m_poSelf;
711  explicit Features(GDALDataset* poSelf): m_poSelf(poSelf) {}
712 
713  class CPL_DLL Iterator
714  {
715  struct Private;
716  std::unique_ptr<Private> m_poPrivate;
717  public:
718  Iterator(GDALDataset* poDS, bool bStart);
719  Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
720  Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
721  ~Iterator();
722  const FeatureLayerPair& operator*() const;
723  Iterator& operator++();
724  bool operator!=(const Iterator& it) const;
725  };
726 
727  public:
728 
729  const Iterator begin() const;
730 
731  const Iterator end() const;
732  };
733 
734  Features GetFeatures();
735 
736  virtual int TestCapability( const char * );
737 
738  virtual OGRLayer *CreateLayer( const char *pszName,
739  OGRSpatialReference *poSpatialRef = nullptr,
741  char ** papszOptions = nullptr );
742  virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
743  const char *pszNewName,
744  char **papszOptions = nullptr );
745 
746  virtual OGRStyleTable *GetStyleTable();
747  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
748 
749  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
750 
751  virtual OGRLayer * ExecuteSQL( const char *pszStatement,
752  OGRGeometry *poSpatialFilter,
753  const char *pszDialect );
754  virtual void ReleaseResultSet( OGRLayer * poResultsSet );
755 
756  int GetRefCount() const;
757  int GetSummaryRefCount() const;
758  OGRErr Release();
759 
760  virtual OGRErr StartTransaction(int bForce=FALSE);
761  virtual OGRErr CommitTransaction();
762  virtual OGRErr RollbackTransaction();
763 
765  static int IsGenericSQLDialect(const char* pszDialect);
766 
767  // Semi-public methods. Only to be used by in-tree drivers.
768  GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
769  swq_select_parse_options* poSelectParseOptions);
770  static void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
771  OGRLayer * ExecuteSQL( const char *pszStatement,
772  OGRGeometry *poSpatialFilter,
773  const char *pszDialect,
774  swq_select_parse_options* poSelectParseOptions);
776 
777  protected:
778  virtual OGRLayer *ICreateLayer( const char *pszName,
779  OGRSpatialReference *poSpatialRef = nullptr,
781  char ** papszOptions = nullptr );
782 
784  OGRErr ProcessSQLCreateIndex( const char * );
785  OGRErr ProcessSQLDropIndex( const char * );
786  OGRErr ProcessSQLDropTable( const char * );
787  OGRErr ProcessSQLAlterTableAddColumn( const char * );
788  OGRErr ProcessSQLAlterTableDropColumn( const char * );
789  OGRErr ProcessSQLAlterTableAlterColumn( const char * );
790  OGRErr ProcessSQLAlterTableRenameColumn( const char * );
791 
792  OGRStyleTable *m_poStyleTable = nullptr;
794 
795  private:
797 };
798 
800 struct CPL_DLL GDALDatasetUniquePtrDeleter
801 {
802  void operator()(GDALDataset* poDataset) const
803  { GDALClose(poDataset); }
804 };
806 
812 typedef std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter> GDALDatasetUniquePtr;
813 
814 /* ******************************************************************** */
815 /* GDALRasterBlock */
816 /* ******************************************************************** */
817 
822 class CPL_DLL GDALRasterBlock
823 {
824  friend class GDALAbstractBandBlockCache;
825 
826  GDALDataType eType;
827 
828  bool bDirty;
829  volatile int nLockCount;
830 
831  int nXOff;
832  int nYOff;
833 
834  int nXSize;
835  int nYSize;
836 
837  void *pData;
838 
839  GDALRasterBand *poBand;
840 
841  GDALRasterBlock *poNext;
842  GDALRasterBlock *poPrevious;
843 
844  bool bMustDetach;
845 
846  void Detach_unlocked( void );
847  void Touch_unlocked( void );
848 
849  void RecycleFor( int nXOffIn, int nYOffIn );
850 
851  public:
852  GDALRasterBlock( GDALRasterBand *, int, int );
853  GDALRasterBlock( int nXOffIn, int nYOffIn ); /* only for lookup purpose */
854  virtual ~GDALRasterBlock();
855 
856  CPLErr Internalize( void );
857  void Touch( void );
858  void MarkDirty( void );
859  void MarkClean( void );
861  int AddLock( void ) { return CPLAtomicInc(&nLockCount); }
863  int DropLock( void ) { return CPLAtomicDec(&nLockCount); }
864  void Detach();
865 
866  CPLErr Write();
867 
871  GDALDataType GetDataType() const { return eType; }
875  int GetXOff() const { return nXOff; }
879  int GetYOff() const { return nYOff; }
883  int GetXSize() const { return nXSize; }
887  int GetYSize() const { return nYSize; }
891  int GetDirty() const { return bDirty; }
895  void *GetDataRef( void ) { return pData; }
899  int GetBlockSize() const {
900  return nXSize * nYSize * GDALGetDataTypeSizeBytes(eType); }
901 
902  int TakeLock();
903  int DropLockForRemovalFromStorage();
904 
907  GDALRasterBand *GetBand() { return poBand; }
908 
909  static void FlushDirtyBlocks();
910  static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE);
911  static void Verify();
912 
913  static void EnterDisableDirtyBlockFlush();
914  static void LeaveDisableDirtyBlockFlush();
915 
916 #ifdef notdef
917  static void CheckNonOrphanedBlocks(GDALRasterBand* poBand);
918  void DumpBlock();
919  static void DumpAll();
920 #endif
921 
922  /* Should only be called by GDALDestroyDriverManager() */
924  static void DestroyRBMutex();
926 
927  private:
929 };
930 
931 /* ******************************************************************** */
932 /* GDALColorTable */
933 /* ******************************************************************** */
934 
937 class CPL_DLL GDALColorTable
938 {
939  GDALPaletteInterp eInterp;
940 
941  std::vector<GDALColorEntry> aoEntries{};
942 
943 public:
945  ~GDALColorTable();
946 
947  GDALColorTable *Clone() const;
948  int IsSame(const GDALColorTable* poOtherCT) const;
949 
950  GDALPaletteInterp GetPaletteInterpretation() const;
951 
952  int GetColorEntryCount() const;
953  const GDALColorEntry *GetColorEntry( int ) const;
954  int GetColorEntryAsRGB( int, GDALColorEntry * ) const;
955  void SetColorEntry( int, const GDALColorEntry * );
956  int CreateColorRamp( int, const GDALColorEntry * ,
957  int, const GDALColorEntry * );
958 
963  { return static_cast<GDALColorTableH>(poCT); }
964 
969  { return static_cast<GDALColorTable*>(hCT); }
970 
971 };
972 
973 /* ******************************************************************** */
974 /* GDALAbstractBandBlockCache */
975 /* ******************************************************************** */
976 
978 
980 // CPL_DLL is just technical here. This is really a private concept
981 // only used by GDALRasterBand implementation.
982 
983 class CPL_DLL GDALAbstractBandBlockCache
984 {
985  // List of blocks that can be freed or recycled, and its lock
986  CPLLock *hSpinLock = nullptr;
987  GDALRasterBlock *psListBlocksToFree = nullptr;
988 
989  // Band keep alive counter, and its lock & condition
990  CPLCond *hCond = nullptr;
991  CPLMutex *hCondMutex = nullptr;
992  volatile int nKeepAliveCounter = 0;
993 
994  CPL_DISALLOW_COPY_ASSIGN(GDALAbstractBandBlockCache)
995 
996  protected:
997  GDALRasterBand *poBand;
998 
999  void FreeDanglingBlocks();
1000  void UnreferenceBlockBase();
1001  void WaitKeepAliveCounter();
1002 
1003  public:
1004  explicit GDALAbstractBandBlockCache(GDALRasterBand* poBand);
1005  virtual ~GDALAbstractBandBlockCache();
1006 
1007  GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff);
1008  void AddBlockToFreeList( GDALRasterBlock * );
1009 
1010  virtual bool Init() = 0;
1011  virtual bool IsInitOK() = 0;
1012  virtual CPLErr FlushCache() = 0;
1013  virtual CPLErr AdoptBlock( GDALRasterBlock* poBlock ) = 0;
1014  virtual GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff,
1015  int nYBlockYOff ) = 0;
1016  virtual CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ) = 0;
1017  virtual CPLErr FlushBlock( int nXBlockOff, int nYBlockOff,
1018  int bWriteDirtyBlock ) = 0;
1019 };
1020 
1021 GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand);
1022 GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand);
1023 
1025 
1026 /* ******************************************************************** */
1027 /* GDALRasterBand */
1028 /* ******************************************************************** */
1029 
1032 class CPL_DLL GDALRasterBand : public GDALMajorObject
1033 {
1034  private:
1035  friend class GDALArrayBandBlockCache;
1036  friend class GDALHashSetBandBlockCache;
1037  friend class GDALRasterBlock;
1038 
1039  CPLErr eFlushBlockErr = CE_None;
1040  GDALAbstractBandBlockCache* poBandBlockCache = nullptr;
1041 
1042  void SetFlushBlockErr( CPLErr eErr );
1043  CPLErr UnreferenceBlock( GDALRasterBlock* poBlock );
1044  void SetValidPercent( GUIntBig nSampleCount, GUIntBig nValidCount );
1045 
1046  protected:
1048  GDALDataset *poDS = nullptr;
1049  int nBand = 0; /* 1 based */
1050 
1051  int nRasterXSize = 0;
1052  int nRasterYSize = 0;
1053 
1054  GDALDataType eDataType = GDT_Byte;
1055  GDALAccess eAccess = GA_ReadOnly;
1056 
1057  /* stuff related to blocking, and raster cache */
1058  int nBlockXSize = -1;
1059  int nBlockYSize = -1;
1060  int nBlocksPerRow = 0;
1061  int nBlocksPerColumn = 0;
1062 
1063  int nBlockReads = 0;
1064  int bForceCachedIO = 0;
1065 
1066  GDALRasterBand *poMask = nullptr;
1067  bool bOwnMask = false;
1068  int nMaskFlags = 0;
1069 
1070  void InvalidateMaskBand();
1071 
1072  friend class GDALDataset;
1073  friend class GDALProxyRasterBand;
1074  friend class GDALDefaultOverviews;
1075 
1076  CPLErr RasterIOResampled( GDALRWFlag, int, int, int, int,
1077  void *, int, int, GDALDataType,
1079 
1080  int EnterReadWrite(GDALRWFlag eRWFlag);
1081  void LeaveReadWrite();
1082  void InitRWLock();
1084 
1085  protected:
1086  virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
1087  virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
1088 
1089  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1090  void *, int, int, GDALDataType,
1092 
1093  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
1094  int nXSize, int nYSize,
1095  int nMaskFlagStop,
1096  double* pdfDataPct);
1098  CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
1099  void *, int, int, GDALDataType,
1101 
1102  CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
1103  int nXOff, int nYOff, int nXSize, int nYSize,
1104  void * pData, int nBufXSize, int nBufYSize,
1105  GDALDataType eBufType,
1106  GSpacing nPixelSpace, GSpacing nLineSpace,
1107  GDALRasterIOExtraArg* psExtraArg,
1108  int* pbTried );
1109 
1110  int InitBlockInfo();
1111 
1112  void AddBlockToFreeList( GDALRasterBlock * );
1114 
1115  GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
1116 
1117  public:
1118  GDALRasterBand();
1119  explicit GDALRasterBand(int bForceCachedIO);
1120 
1121  ~GDALRasterBand() override;
1122 
1123  int GetXSize();
1124  int GetYSize();
1125  int GetBand();
1126  GDALDataset*GetDataset();
1127 
1128  GDALDataType GetRasterDataType( void );
1129  void GetBlockSize( int *, int * );
1130  CPLErr GetActualBlockSize ( int, int, int *, int * );
1131  GDALAccess GetAccess();
1132 
1133  CPLErr RasterIO( GDALRWFlag, int, int, int, int,
1134  void *, int, int, GDALDataType,
1135  GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg
1136 #ifndef DOXYGEN_SKIP
1137  OPTIONAL_OUTSIDE_GDAL(nullptr)
1138 #endif
1140  CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1141 
1142  CPLErr WriteBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1143 
1144  GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
1145  int bJustInitialize = FALSE ) CPL_WARN_UNUSED_RESULT;
1146  CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE );
1147 
1148  unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
1149  unsigned char* pTranslationTable = nullptr,
1150  int* pApproximateMatching = nullptr);
1151 
1152  // New OpengIS CV_SampleDimension stuff.
1153 
1154  virtual CPLErr FlushCache();
1155  virtual char **GetCategoryNames();
1156  virtual double GetNoDataValue( int *pbSuccess = nullptr );
1157  virtual double GetMinimum( int *pbSuccess = nullptr );
1158  virtual double GetMaximum(int *pbSuccess = nullptr );
1159  virtual double GetOffset( int *pbSuccess = nullptr );
1160  virtual double GetScale( int *pbSuccess = nullptr );
1161  virtual const char *GetUnitType();
1162  virtual GDALColorInterp GetColorInterpretation();
1163  virtual GDALColorTable *GetColorTable();
1164  virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
1165 
1166  virtual CPLErr SetCategoryNames( char ** papszNames );
1167  virtual CPLErr SetNoDataValue( double dfNoData );
1168  virtual CPLErr DeleteNoDataValue();
1169  virtual CPLErr SetColorTable( GDALColorTable * poCT );
1170  virtual CPLErr SetColorInterpretation( GDALColorInterp eColorInterp );
1171  virtual CPLErr SetOffset( double dfNewOffset );
1172  virtual CPLErr SetScale( double dfNewScale );
1173  virtual CPLErr SetUnitType( const char * pszNewValue );
1174 
1175  virtual CPLErr GetStatistics( int bApproxOK, int bForce,
1176  double *pdfMin, double *pdfMax,
1177  double *pdfMean, double *padfStdDev );
1178  virtual CPLErr ComputeStatistics( int bApproxOK,
1179  double *pdfMin, double *pdfMax,
1180  double *pdfMean, double *pdfStdDev,
1181  GDALProgressFunc, void *pProgressData );
1182  virtual CPLErr SetStatistics( double dfMin, double dfMax,
1183  double dfMean, double dfStdDev );
1184  virtual CPLErr ComputeRasterMinMax( int, double* );
1185 
1186 // Only defined when Doxygen enabled
1187 #ifdef DOXYGEN_SKIP
1188  char **GetMetadata( const char * pszDomain = "" ) override;
1189  CPLErr SetMetadata( char ** papszMetadata,
1190  const char * pszDomain ) override;
1191  const char *GetMetadataItem( const char * pszName,
1192  const char * pszDomain ) override;
1193  CPLErr SetMetadataItem( const char * pszName,
1194  const char * pszValue,
1195  const char * pszDomain ) override;
1196 #endif
1197 
1198  virtual int HasArbitraryOverviews();
1199  virtual int GetOverviewCount();
1200  virtual GDALRasterBand *GetOverview(int);
1201  virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
1202  virtual CPLErr BuildOverviews( const char * pszResampling,
1203  int nOverviews,
1204  int * panOverviewList,
1205  GDALProgressFunc pfnProgress,
1206  void * pProgressData );
1207 
1208  virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
1209  int nBufXSize, int nBufYSize,
1210  GDALDataType eBufType, char **papszOptions );
1211 
1212  virtual CPLErr GetHistogram( double dfMin, double dfMax,
1213  int nBuckets, GUIntBig * panHistogram,
1214  int bIncludeOutOfRange, int bApproxOK,
1215  GDALProgressFunc, void *pProgressData );
1216 
1217  virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
1218  int *pnBuckets, GUIntBig ** ppanHistogram,
1219  int bForce,
1220  GDALProgressFunc, void *pProgressData);
1221  virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
1222  int nBuckets, GUIntBig *panHistogram );
1223 
1224  virtual GDALRasterAttributeTable *GetDefaultRAT();
1225  virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT );
1226 
1227  virtual GDALRasterBand *GetMaskBand();
1228  virtual int GetMaskFlags();
1229  virtual CPLErr CreateMaskBand( int nFlagsIn );
1230 
1231  virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
1232  int *pnPixelSpace,
1233  GIntBig *pnLineSpace,
1234  char **papszOptions ) CPL_WARN_UNUSED_RESULT;
1235 
1236  int GetDataCoverageStatus( int nXOff, int nYOff,
1237  int nXSize, int nYSize,
1238  int nMaskFlagStop = 0,
1239  double* pdfDataPct = nullptr );
1240 
1241  void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
1242 
1246  static inline GDALRasterBandH ToHandle(GDALRasterBand* poBand)
1247  { return static_cast<GDALRasterBandH>(poBand); }
1248 
1253  { return static_cast<GDALRasterBand*>(hBand); }
1254 
1255 private:
1257 };
1258 
1260 /* ******************************************************************** */
1261 /* GDALAllValidMaskBand */
1262 /* ******************************************************************** */
1263 
1264 class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
1265 {
1266  protected:
1267  CPLErr IReadBlock( int, int, void * ) override;
1268 
1269  CPL_DISALLOW_COPY_ASSIGN(GDALAllValidMaskBand)
1270 
1271  public:
1272  explicit GDALAllValidMaskBand( GDALRasterBand * );
1273  ~GDALAllValidMaskBand() override;
1274 
1275  GDALRasterBand *GetMaskBand() override;
1276  int GetMaskFlags() override;
1277 
1278  CPLErr ComputeStatistics( int bApproxOK,
1279  double *pdfMin, double *pdfMax,
1280  double *pdfMean, double *pdfStdDev,
1281  GDALProgressFunc, void *pProgressData ) override;
1282 
1283 };
1284 
1285 /* ******************************************************************** */
1286 /* GDALNoDataMaskBand */
1287 /* ******************************************************************** */
1288 
1289 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
1290 {
1291  double dfNoDataValue;
1292  GDALRasterBand *poParent;
1293 
1294  CPL_DISALLOW_COPY_ASSIGN(GDALNoDataMaskBand)
1295 
1296  protected:
1297  CPLErr IReadBlock( int, int, void * ) override;
1298  CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1299  void *, int, int, GDALDataType,
1300  GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
1301 
1302  public:
1303  explicit GDALNoDataMaskBand( GDALRasterBand * );
1304  ~GDALNoDataMaskBand() override;
1305 
1306  static bool IsNoDataInRange(double dfNoDataValue,
1307  GDALDataType eDataType);
1308 };
1309 
1310 /* ******************************************************************** */
1311 /* GDALNoDataValuesMaskBand */
1312 /* ******************************************************************** */
1313 
1314 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
1315 {
1316  double *padfNodataValues;
1317 
1318  CPL_DISALLOW_COPY_ASSIGN(GDALNoDataValuesMaskBand)
1319 
1320  protected:
1321  CPLErr IReadBlock( int, int, void * ) override;
1322 
1323  public:
1324  explicit GDALNoDataValuesMaskBand( GDALDataset * );
1325  ~GDALNoDataValuesMaskBand() override;
1326 };
1327 
1328 /* ******************************************************************** */
1329 /* GDALRescaledAlphaBand */
1330 /* ******************************************************************** */
1331 
1332 class GDALRescaledAlphaBand : public GDALRasterBand
1333 {
1334  GDALRasterBand *poParent;
1335  void *pTemp;
1336 
1337  CPL_DISALLOW_COPY_ASSIGN(GDALRescaledAlphaBand)
1338 
1339  protected:
1340  CPLErr IReadBlock( int, int, void * ) override;
1341  CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1342  void *, int, int, GDALDataType,
1343  GSpacing, GSpacing,
1344  GDALRasterIOExtraArg* psExtraArg ) override;
1345 
1346  public:
1347  explicit GDALRescaledAlphaBand( GDALRasterBand * );
1348  ~GDALRescaledAlphaBand() override;
1349 };
1351 
1352 /* ******************************************************************** */
1353 /* GDALIdentifyEnum */
1354 /* ******************************************************************** */
1355 
1361 typedef enum
1362 {
1370 
1371 /* ******************************************************************** */
1372 /* GDALDriver */
1373 /* ******************************************************************** */
1374 
1386 class CPL_DLL GDALDriver : public GDALMajorObject
1387 {
1388  public:
1389  GDALDriver();
1390  ~GDALDriver() override;
1391 
1392  CPLErr SetMetadataItem( const char * pszName,
1393  const char * pszValue,
1394  const char * pszDomain = "" ) override;
1395 
1396 /* -------------------------------------------------------------------- */
1397 /* Public C++ methods. */
1398 /* -------------------------------------------------------------------- */
1399  GDALDataset *Create( const char * pszName,
1400  int nXSize, int nYSize, int nBands,
1401  GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT;
1402 
1403  CPLErr Delete( const char * pszName );
1404  CPLErr Rename( const char * pszNewName,
1405  const char * pszOldName );
1406  CPLErr CopyFiles( const char * pszNewName,
1407  const char * pszOldName );
1408 
1409  GDALDataset *CreateCopy( const char *, GDALDataset *,
1410  int, char **,
1411  GDALProgressFunc pfnProgress,
1412  void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1413 
1414 /* -------------------------------------------------------------------- */
1415 /* The following are semiprivate, not intended to be accessed */
1416 /* by anyone but the formats instantiating and populating the */
1417 /* drivers. */
1418 /* -------------------------------------------------------------------- */
1420  GDALDataset *(*pfnOpen)( GDALOpenInfo * );
1421 
1422  GDALDataset *(*pfnCreate)( const char * pszName,
1423  int nXSize, int nYSize, int nBands,
1424  GDALDataType eType,
1425  char ** papszOptions );
1426 
1427  CPLErr (*pfnDelete)( const char * pszName );
1428 
1429  GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *,
1430  int, char **,
1431  GDALProgressFunc pfnProgress,
1432  void * pProgressData );
1433 
1434  void *pDriverData;
1435 
1436  void (*pfnUnloadDriver)(GDALDriver *);
1437 
1445  int (*pfnIdentify)( GDALOpenInfo * );
1446 
1447  CPLErr (*pfnRename)( const char * pszNewName,
1448  const char * pszOldName );
1449  CPLErr (*pfnCopyFiles)( const char * pszNewName,
1450  const char * pszOldName );
1451 
1452  /* For legacy OGR drivers */
1453  GDALDataset *(*pfnOpenWithDriverArg)( GDALDriver*, GDALOpenInfo * );
1454  GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*,
1455  const char * pszName,
1456  char ** papszOptions );
1457  CPLErr (*pfnDeleteDataSource)( GDALDriver*,
1458  const char * pszName );
1460 
1461 /* -------------------------------------------------------------------- */
1462 /* Helper methods. */
1463 /* -------------------------------------------------------------------- */
1465  GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
1466  int, char **,
1467  GDALProgressFunc pfnProgress,
1468  void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1469  static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1470  GDALDataset *poDstDS,
1471  int bStrict );
1472  static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1473  GDALDataset *poDstDS,
1474  int bStrict,
1475  CSLConstList papszOptions,
1476  GDALProgressFunc pfnProgress,
1477  void * pProgressData );
1479  static CPLErr QuietDelete( const char * pszName );
1480 
1482  static CPLErr DefaultRename( const char * pszNewName,
1483  const char * pszOldName );
1484  static CPLErr DefaultCopyFiles( const char * pszNewName,
1485  const char * pszOldName );
1487 
1491  static inline GDALDriverH ToHandle(GDALDriver* poDriver)
1492  { return static_cast<GDALDriverH>(poDriver); }
1493 
1497  static inline GDALDriver* FromHandle(GDALDriverH hDriver)
1498  { return static_cast<GDALDriver*>(hDriver); }
1499 
1500 private:
1501  CPL_DISALLOW_COPY_ASSIGN(GDALDriver)
1502 };
1503 
1504 /* ******************************************************************** */
1505 /* GDALDriverManager */
1506 /* ******************************************************************** */
1507 
1515 class CPL_DLL GDALDriverManager : public GDALMajorObject
1516 {
1517  int nDrivers = 0;
1518  GDALDriver **papoDrivers = nullptr;
1519  std::map<CPLString, GDALDriver*> oMapNameToDrivers{};
1520 
1521  GDALDriver *GetDriver_unlocked( int iDriver )
1522  { return (iDriver >= 0 && iDriver < nDrivers) ?
1523  papoDrivers[iDriver] : nullptr; }
1524 
1525  GDALDriver *GetDriverByName_unlocked( const char * pszName )
1526  { return oMapNameToDrivers[CPLString(pszName).toupper()]; }
1527 
1529 
1530  public:
1532  ~GDALDriverManager();
1533 
1534  int GetDriverCount( void ) const;
1535  GDALDriver *GetDriver( int );
1536  GDALDriver *GetDriverByName( const char * );
1537 
1538  int RegisterDriver( GDALDriver * );
1539  void DeregisterDriver( GDALDriver * );
1540 
1541  // AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined.
1542  static void AutoLoadDrivers();
1543  void AutoSkipDrivers();
1544 };
1545 
1547 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
1548 CPL_C_END
1549 
1550 /* ******************************************************************** */
1551 /* GDALAsyncReader */
1552 /* ******************************************************************** */
1553 
1559 class CPL_DLL GDALAsyncReader
1560 {
1561 
1563 
1564  protected:
1566  GDALDataset* poDS;
1567  int nXOff;
1568  int nYOff;
1569  int nXSize;
1570  int nYSize;
1571  void * pBuf;
1572  int nBufXSize;
1573  int nBufYSize;
1574  GDALDataType eBufType;
1575  int nBandCount;
1576  int* panBandMap;
1577  int nPixelSpace;
1578  int nLineSpace;
1579  int nBandSpace;
1581 
1582  public:
1583  GDALAsyncReader();
1584  virtual ~GDALAsyncReader();
1585 
1589  GDALDataset* GetGDALDataset() {return poDS;}
1593  int GetXOffset() const { return nXOff; }
1597  int GetYOffset() const { return nYOff; }
1601  int GetXSize() const { return nXSize; }
1605  int GetYSize() const { return nYSize; }
1609  void * GetBuffer() {return pBuf;}
1613  int GetBufferXSize() const { return nBufXSize; }
1617  int GetBufferYSize() const { return nBufYSize; }
1621  GDALDataType GetBufferType() const { return eBufType; }
1625  int GetBandCount() const { return nBandCount; }
1629  int* GetBandMap() { return panBandMap; }
1633  int GetPixelSpace() const { return nPixelSpace; }
1637  int GetLineSpace() const { return nLineSpace; }
1641  int GetBandSpace() const { return nBandSpace; }
1642 
1643  virtual GDALAsyncStatusType
1644  GetNextUpdatedRegion(double dfTimeout,
1645  int* pnBufXOff, int* pnBufYOff,
1646  int* pnBufXSize, int* pnBufYSize) = 0;
1647  virtual int LockBuffer( double dfTimeout = -1.0 );
1648  virtual void UnlockBuffer();
1649 };
1650 
1651 /* ==================================================================== */
1652 /* An assortment of overview related stuff. */
1653 /* ==================================================================== */
1654 
1656 /* Only exported for drivers as plugin. Signature may change */
1657 CPLErr CPL_DLL
1658 GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
1659  int nOverviews,
1660  GDALRasterBand*** papapoOverviewBands,
1661  const char * pszResampling,
1662  GDALProgressFunc pfnProgress, void * pProgressData );
1663 
1664 typedef CPLErr (*GDALResampleFunction)
1665  ( double dfXRatioDstToSrc,
1666  double dfYRatioDstToSrc,
1667  double dfSrcXDelta,
1668  double dfSrcYDelta,
1669  GDALDataType eWrkDataType,
1670  void * pChunk,
1671  GByte * pabyChunkNodataMask,
1672  int nChunkXOff, int nChunkXSize,
1673  int nChunkYOff, int nChunkYSize,
1674  int nDstXOff, int nDstXOff2,
1675  int nDstYOff, int nDstYOff2,
1676  GDALRasterBand * poOverview,
1677  const char * pszResampling,
1678  int bHasNoData, float fNoDataValue,
1679  GDALColorTable* poColorTable,
1680  GDALDataType eSrcDataType,
1681  bool bPropagateNoData );
1682 
1683 GDALResampleFunction GDALGetResampleFunction(const char* pszResampling,
1684  int* pnRadius);
1685 
1686 #ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND
1687 typedef CPLErr (*GDALResampleFunctionMultiBands)
1688  ( double dfXRatioDstToSrc,
1689  double dfYRatioDstToSrc,
1690  double dfSrcXDelta,
1691  double dfSrcYDelta,
1692  GDALDataType eWrkDataType,
1693  void * pChunk, int nBands,
1694  GByte * pabyChunkNodataMask,
1695  int nChunkXOff, int nChunkXSize,
1696  int nChunkYOff, int nChunkYSize,
1697  int nDstXOff, int nDstXOff2,
1698  int nDstYOff, int nDstYOff2,
1699  GDALRasterBand ** papoDstBands,
1700  const char * pszResampling,
1701  int bHasNoData, float fNoDataValue,
1702  GDALColorTable* poColorTable,
1703  GDALDataType eSrcDataType);
1704 
1705 GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(const char* pszResampling,
1706  int* pnRadius);
1707 #endif
1708 
1709 GDALDataType GDALGetOvrWorkDataType(const char* pszResampling,
1710  GDALDataType eSrcDataType);
1711 
1713 
1714 CPLErr CPL_DLL
1715 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
1716  GDALDataset **ppoDS,
1717  int nBands, int *panBandList,
1718  int nNewOverviews, int *panNewOverviewList,
1719  const char *pszResampling,
1720  GDALProgressFunc pfnProgress,
1721  void *pProgressData );
1722 
1723 CPLErr CPL_DLL
1724 GTIFFBuildOverviews( const char * pszFilename,
1725  int nBands, GDALRasterBand **papoBandList,
1726  int nOverviews, int * panOverviewList,
1727  const char * pszResampling,
1728  GDALProgressFunc pfnProgress, void * pProgressData );
1729 
1730 CPLErr CPL_DLL
1731 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
1732  const char * pszResampling,
1733  int nOverviews, int * panOverviewList,
1734  int nBands, int * panBandList,
1735  GDALProgressFunc pfnProgress, void * pProgressData);
1736 
1737 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
1738  int &nXOff, int &nYOff,
1739  int &nXSize, int &nYSize,
1740  int nBufXSize, int nBufYSize) CPL_WARN_DEPRECATED("Use GDALBandGetBestOverviewLevel2 instead");
1741 int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand,
1742  int &nXOff, int &nYOff,
1743  int &nXSize, int &nYSize,
1744  int nBufXSize, int nBufYSize,
1745  GDALRasterIOExtraArg* psExtraArg);
1746 
1747 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize ) CPL_WARN_DEPRECATED("Use GDALOvLevelAdjust2 instead");
1748 int CPL_DLL GDALOvLevelAdjust2( int nOvLevel, int nXSize, int nYSize );
1749 int CPL_DLL GDALComputeOvFactor( int nOvrXSize, int nRasterXSize,
1750  int nOvrYSize, int nRasterYSize );
1751 
1752 GDALDataset CPL_DLL *
1753 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
1754  GDALDataset *poDependentDS );
1755 
1756 /* ==================================================================== */
1757 /* Infrastructure to check that dataset characteristics are valid */
1758 /* ==================================================================== */
1759 
1760 int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
1761 int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
1762 
1763 /* Internal use only */
1764 
1765 /* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */
1766 int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension,
1767  double *padfGeoTransform, char** papszSiblingFiles,
1768  char** ppszWorldFileNameOut);
1769 int GDALReadTabFile2( const char * pszBaseFilename,
1770  double *padfGeoTransform, char **ppszWKT,
1771  int *pnGCPCount, GDAL_GCP **ppasGCPs,
1772  char** papszSiblingFiles, char** ppszTabFileNameOut );
1773 
1774 void CPL_DLL GDALCopyRasterIOExtraArg(GDALRasterIOExtraArg* psDestArg,
1775  GDALRasterIOExtraArg* psSrcArg);
1776 
1777 CPL_C_END
1778 
1779 void GDALNullifyOpenDatasetsList();
1780 CPLMutex** GDALGetphDMMutex();
1781 CPLMutex** GDALGetphDLMutex();
1782 void GDALNullifyProxyPoolSingleton();
1783 GDALDriver* GDALGetAPIPROXYDriver();
1784 void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
1785 GIntBig GDALGetResponsiblePIDForCurrentThread();
1786 
1787 CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
1788  CSLConstList papszSiblingFiles, int nFlags );
1789 
1790 CPLErr EXIFExtractMetadata(char**& papszMetadata,
1791  void *fpL, int nOffset,
1792  int bSwabflag, int nTIFFHEADER,
1793  int& nExifOffset, int& nInterOffset, int& nGPSOffset);
1794 
1795 int GDALValidateOpenOptions( GDALDriverH hDriver,
1796  const char* const* papszOptionOptions);
1797 int GDALValidateOptions( const char* pszOptionList,
1798  const char* const* papszOptionsToValidate,
1799  const char* pszErrorMessageOptionType,
1800  const char* pszErrorMessageContainerName);
1801 
1802 GDALRIOResampleAlg GDALRasterIOGetResampleAlg(const char* pszResampling);
1803 const char* GDALRasterIOGetResampleAlg(GDALRIOResampleAlg eResampleAlg);
1804 
1805 void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
1806  int nXSize, int nYSize,
1807  int nBufXSize, int nBufYSize);
1808 
1809 
1810 GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
1811  int bThisLevelOnly);
1812 
1813 // Should cover particular cases of #3573, #4183, #4506, #6578
1814 // Behaviour is undefined if fVal1 or fVal2 are NaN (should be tested before
1815 // calling this function)
1816 template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
1817 {
1818  return fVal1 == fVal2 || /* Should cover infinity */
1819  std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
1820 }
1821 
1822 double GDALAdjustNoDataCloseToFloatMax(double dfVal);
1823 
1824 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
1825 
1826 // Number of data samples that will be used to compute approximate statistics
1827 // (minimum value, maximum value, etc.)
1828 #define GDALSTAT_APPROX_NUMSAMPLES 2500
1829 
1831 /* Caution: for technical reason this declaration is duplicated in gdal_crs.c */
1832 /* so any signature change should be reflected there too */
1833 void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode,
1834  GDAL_GCP* pasGCPList,
1835  int nGCPCount,
1836  const char* pszGCPProjection );
1837 void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList,
1838  GDAL_GCP** ppasGCPList,
1839  int* pnGCPCount,
1840  char** ppszGCPProjection );
1841 CPL_C_END
1842 
1843 void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOptions);
1844 char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode );
1845 
1846 int GDALCanFileAcceptSidecarFile(const char* pszFilename);
1848 
1849 #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:655
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:2649
int GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:899
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:780
int GetYSize() const
Return height.
Definition: gdal_priv.h:1605
GDALDataType
Definition: gdal.h:60
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1364
std::unique_ptr< GDALDataset, GDALDatasetUniquePtrDeleter > GDALDatasetUniquePtr
Unique pointer type for GDALDataset.
Definition: gdal_priv.h:812
Document node structure.
Definition: cpl_minixml.h:66
Standard C Covers.
Definitions for CPL mini XML Parser/Serializer.
void static GDALRasterBandH ToHandle(GDALRasterBand *poBand)
Convert a GDALRasterBand* to a GDALRasterBandH.
Definition: gdal_priv.h:1246
Definition: gdal.h:62
Definition: gdal.h:219
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1589
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1625
#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:615
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:300
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1593
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1629
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:863
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:563
void pointer
pointer
Definition: gdal_priv.h:664
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:297
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1637
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:282
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:871
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:128
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:292
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1617
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition: gdal_priv.h:1252
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1641
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:1044
int nOpenFlags
Open flags.
Definition: gdal_priv.h:284
A single raster block in the block cache.
Definition: gdal_priv.h:822
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:861
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:906
unknown type, non-standard
Definition: ogr_core.h:319
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:1458
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:962
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:891
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:875
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:1491
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:602
GDALAsyncStatusType
status of the asynchronous stream
Definition: gdal.h:100
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1633
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:1186
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:1609
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:907
Class for dataset open functions.
Definition: gdal_priv.h:265
GDALAccess GetAccess() const
Return access mode.
Definition: gdal_priv.h:552
void MarkSuppressOnClose()
Set that the dataset must be deleted on close.
Definition: gdal_priv.h:558
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:1497
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:1368
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()&#39;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:3432
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:895
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2460
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:147
int GetXSize() const
Return width.
Definition: gdal_priv.h:1601
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:261
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:883
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3061
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition: gdal_priv.h:590
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 GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:887
Class returned by GetLayers() that acts as a range of layers.
Definition: gdal_priv.h:642
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition: gdal_priv.h:596
std::input_iterator_tag iterator_category
iterator_category
Definition: gdal_priv.h:665
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:70
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1597
A single raster band (or channel).
Definition: gdal_priv.h:1032
GDALAccess
Definition: gdal.h:113
Simple feature classes.
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:354
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
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1621
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
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1515
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:896
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:879
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:1361
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:705
static GDALMajorObject * FromHandle(GDALMajorObjectH hMajorObject)
Convert a GDALMajorObjectH to a GDALMajorObject*.
Definition: gdal_priv.h:174
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1366
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:292
void difference_type
difference_type
Definition: gdal_priv.h:663
Definition: gdal.h:114
Format specific driver.
Definition: gdal_priv.h:1386
A color table / palette.
Definition: gdal_priv.h:937
Ground Control Point.
Definition: gdal.h:560
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:989
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1613
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:931
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:1559
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition: gdal_priv.h:968

Generated for GDAL by doxygen 1.8.13.