GDAL

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

- File List
- File Members

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

Generated for GDAL by 1.8.8.