32#ifndef GDAL_PRIV_H_INCLUDED
33#define GDAL_PRIV_H_INCLUDED
50class GDALProxyDataset;
51class GDALProxyRasterBand;
62#include "gdal_frmts.h"
63#include "gdalsubdatasetinfo.h"
68#include "cpl_multiproc.h"
69#include "cpl_atomic_ops.h"
86#define GMO_VALID 0x0001
87#define GMO_IGNORE_UNIMPLEMENTED 0x0002
88#define GMO_SUPPORT_MD 0x0004
89#define GMO_SUPPORT_MDMD 0x0008
90#define GMO_MD_DIRTY 0x0010
91#define GMO_PAM_CLASS 0x0020
100class CPL_DLL GDALMultiDomainMetadata
107 bool operator()(
const char *a,
const char *b)
const
113 std::map<const char *, CPLStringList, Comparator> oMetadata{};
116 GDALMultiDomainMetadata();
117 ~GDALMultiDomainMetadata();
119 int XMLInit(
const CPLXMLNode *psMetadata,
int bMerge);
124 return aosDomainList.List();
127 char **GetMetadata(
const char *pszDomain =
"");
129 const char *GetMetadataItem(
const char *pszName,
130 const char *pszDomain =
"");
131 CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
132 const char *pszDomain =
"");
161 GDALMultiDomainMetadata oMDMD{};
165 char **BuildMetadataDomainList(
char **papszList,
int bCheckNonEmpty,
172 int GetMOFlags()
const;
173 void SetMOFlags(
int nFlagsIn);
175 virtual const char *GetDescription()
const;
176 virtual void SetDescription(
const char *);
178 virtual char **GetMetadataDomainList();
180 virtual char **GetMetadata(
const char *pszDomain =
"");
181 virtual CPLErr SetMetadata(
char **papszMetadata,
182 const char *pszDomain =
"");
183 virtual const char *GetMetadataItem(
const char *pszName,
184 const char *pszDomain =
"");
185 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
186 const char *pszDomain =
"");
212class CPL_DLL GDALDefaultOverviews
223 bool bCheckedForMask;
232 bool bCheckedForOverviews;
236 char **papszInitSiblingFiles;
239 GDALDefaultOverviews();
240 ~GDALDefaultOverviews();
242 void Initialize(
GDALDataset *poDSIn,
const char *pszName =
nullptr,
244 bool bNameIsOVR =
false);
247 const char *pszName =
nullptr,
248 bool bTransferSiblingFilesIfLoaded =
true);
250 void TransferSiblingFiles(
char **papszSiblingFiles);
254 int CloseDependentDatasets();
258 int GetOverviewCount(
int nBand);
261 CPLErr BuildOverviews(
const char *pszBasename,
const char *pszResampling,
262 int nOverviews,
const int *panOverviewList,
263 int nBands,
const int *panBandList,
264 GDALProgressFunc pfnProgress,
void *pProgressData,
267 CPLErr BuildOverviewsSubDataset(
const char *pszPhysicalFile,
268 const char *pszResampling,
int nOverviews,
269 const int *panOverviewList,
int nBands,
270 const int *panBandList,
271 GDALProgressFunc pfnProgress,
275 CPLErr BuildOverviewsMask(
const char *pszResampling,
int nOverviews,
276 const int *panOverviewList,
277 GDALProgressFunc pfnProgress,
void *pProgressData,
284 CPLErr CreateMaskBand(
int nFlags,
int nBand = -1);
286 int GetMaskFlags(
int nBand);
288 int HaveMaskFile(
char **papszSiblings =
nullptr,
289 const char *pszBasename =
nullptr);
291 char **GetSiblingFiles()
293 return papszInitSiblingFiles;
309 bool bHasGotSiblingFiles;
310 char **papszSiblingFiles;
311 int nHeaderBytesTried;
315 const char *
const *papszSiblingFiles =
nullptr);
344 int TryToIngest(
int nBytes);
345 char **GetSiblingFiles();
346 char **StealSiblingFiles();
347 bool AreSiblingFilesLoaded()
const;
349 bool IsSingleAllowedDriver(
const char *pszDriverName)
const;
371 explicit GCP(
const char *pszId =
"",
const char *pszInfo =
"",
372 double dfPixel = 0,
double dfLine = 0,
double dfX = 0,
373 double dfY = 0,
double dfZ = 0);
376 explicit GCP(
const GDAL_GCP &other);
377 GCP &operator=(
const GCP &);
379 GCP &operator=(GCP &&);
382 inline const char *Id()
const
387 void SetId(
const char *pszId);
390 inline const char *Info()
const
395 void SetInfo(
const char *pszInfo);
398 inline double Pixel()
const
400 return gcp.dfGCPPixel;
404 inline double &Pixel()
406 return gcp.dfGCPPixel;
410 inline double Line()
const
412 return gcp.dfGCPLine;
416 inline double &Line()
418 return gcp.dfGCPLine;
422 inline double X()
const
434 inline double Y()
const
446 inline double Z()
const
458 inline const GDAL_GCP *c_ptr()
const
463 static const GDAL_GCP *c_ptr(
const std::vector<GCP> &asGCPs);
465 static std::vector<GCP> fromC(
const GDAL_GCP *pasGCPList,
int nGCPCount);
482class swq_select_parse_options;
486typedef struct GDALSQLParseInfo GDALSQLParseInfo;
490#ifdef GDAL_COMPILATION
491#define OPTIONAL_OUTSIDE_GDAL(val)
493#define OPTIONAL_OUTSIDE_GDAL(val) = val
501#if defined(GDAL_BANDMAP_TYPE_CONST_SAFE)
502#define BANDMAP_TYPE const int *
504#define BANDMAP_TYPE int *
512 GDALOpenEx(
const char *pszFilename,
unsigned int nOpenFlags,
513 const char *
const *papszAllowedDrivers,
514 const char *
const *papszOpenOptions,
515 const char *
const *papszSiblingFiles);
519 friend class GDALDefaultOverviews;
520 friend class GDALProxyDataset;
523 CPL_INTERNAL
void AddToDatasetOpenList();
525 CPL_INTERNAL
void UnregisterFromSharedDataset();
527 CPL_INTERNAL
static void ReportErrorV(
const char *pszDSName,
529 const char *fmt, va_list args);
537 int nRasterXSize = 512;
538 int nRasterYSize = 512;
542 static constexpr int OPEN_FLAGS_CLOSED = -1;
547 bool bForceCachedIO =
false;
548 bool bShared =
false;
549 bool bIsInternal =
true;
550 bool bSuppressOnClose =
false;
552 mutable std::map<std::string, std::unique_ptr<OGRFieldDomain>>
553 m_oMapFieldDomains{};
558 void RasterInitialize(
int,
int);
560 void SetBand(
int nNewBand, std::unique_ptr<GDALRasterBand> poBand);
562 GDALDefaultOverviews oOvManager{};
564 virtual CPLErr IBuildOverviews(
const char *pszResampling,
int nOverviews,
565 const int *panOverviewList,
int nListBands,
566 const int *panBandList,
567 GDALProgressFunc pfnProgress,
572 IRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
573 void *pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
574 int nBandCount, BANDMAP_TYPE panBandMap,
GSpacing nPixelSpace,
579 BlockBasedRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
580 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
582 const int *panBandMap,
GSpacing nPixelSpace,
585 CPLErr BlockBasedFlushCache(
bool bAtClosing);
588 BandBasedRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
589 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
591 const int *panBandMap,
GSpacing nPixelSpace,
596 RasterIOResampled(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
597 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
599 const int *panBandMap,
GSpacing nPixelSpace,
603 CPLErr ValidateRasterIOOrAdviseReadParameters(
604 const char *pszCallingFunc,
int *pbStopProcessingOnCENone,
int nXOff,
605 int nYOff,
int nXSize,
int nYSize,
int nBufXSize,
int nBufYSize,
606 int nBandCount,
const int *panBandMap);
609 int nXSize,
int nYSize,
void *pData,
610 int nBufXSize,
int nBufYSize,
612 const int *panBandMap,
GSpacing nPixelSpace,
616 void ShareLockWithParentDataset(
GDALDataset *poParentDataset);
620 void CleanupPostFileClosing();
622 virtual int CloseDependentDatasets();
624 int ValidateLayerCreationOptions(
const char *
const *papszLCO);
626 char **papszOpenOptions =
nullptr;
633 void LeaveReadWrite();
636 void TemporarilyDropReadWriteLock();
637 void ReacquireReadWriteLock();
639 void DisableReadWriteMutex();
644 bool IsAllBands(
int nBandCount,
const int *panBandList)
const;
652 int GetRasterXSize()
const;
653 int GetRasterYSize()
const;
654 int GetRasterCount()
const;
665 void *poQueryLoggerArgIn);
679 class CPL_DLL Iterator
682 std::unique_ptr<Private> m_poPrivate;
686 Iterator(
const Iterator &oOther);
688 Iterator(Iterator &&oOther)
noexcept;
692 Iterator &operator++();
693 bool operator!=(
const Iterator &it)
const;
697 const Iterator
begin()
const;
699 const Iterator
end()
const;
709 virtual CPLErr FlushCache(
bool bAtClosing =
false);
710 virtual CPLErr DropCache();
712 virtual GIntBig GetEstimatedRAMUsage();
718 const char *GetProjectionRef(
void)
const;
719 CPLErr SetProjection(
const char *pszProjection);
721 virtual CPLErr GetGeoTransform(
double *padfTransform);
722 virtual CPLErr SetGeoTransform(
double *padfTransform);
726 virtual void *GetInternalHandle(
const char *pszHandleName);
728 virtual char **GetFileList(
void);
730 virtual const char *GetDriverName();
733 virtual int GetGCPCount();
739 const char *GetGCPProjection();
741 const char *pszGCPProjection);
743 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
745 int nBandCount,
int *panBandList,
746 char **papszOptions);
748 virtual CPLErr CreateMaskBand(
int nFlagsIn);
751 BeginAsyncReader(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
void *pBuf,
753 int nBandCount,
int *panBandMap,
int nPixelSpace,
754 int nLineSpace,
int nBandSpace,
char **papszOptions);
758 struct RawBinaryLayout
760 enum class Interleaving
767 std::string osRawFilename{};
768 Interleaving eInterleaving = Interleaving::UNKNOWN;
770 bool bLittleEndianOrder =
false;
778 virtual bool GetRawBinaryLayout(RawBinaryLayout &);
783 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
785 const int *panBandMap,
GSpacing nPixelSpace,
791 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
793 const int *panBandMap,
GSpacing nPixelSpace,
798 virtual CPLStringList GetCompressionFormats(
int nXOff,
int nYOff,
799 int nXSize,
int nYSize,
801 const int *panBandList);
802 virtual CPLErr ReadCompressedData(
const char *pszFormat,
int nXOff,
803 int nYOff,
int nXSize,
int nYSize,
804 int nBands,
const int *panBandList,
805 void **ppBuffer,
size_t *pnBufferSize,
806 char **ppszDetailedFormat);
820 int GetShared()
const;
823 void MarkSuppressOnClose();
824 void UnMarkSuppressOnClose();
831 return bSuppressOnClose;
839 return papszOpenOptions;
842 static GDALDataset **GetOpenDatasets(
int *pnDatasetCount);
846 BuildOverviews(
const char *pszResampling,
int nOverviews,
847 const int *panOverviewList,
int nListBands,
848 const int *panBandList, GDALProgressFunc pfnProgress,
850 CSLConstList papszOptions OPTIONAL_OUTSIDE_GDAL(
nullptr));
852 CPLErr BuildOverviews(
const char *pszResampling,
int nOverviews,
853 const int *panOverviewList,
int nListBands,
854 const int *panBandList, GDALProgressFunc pfnProgress,
862 static
void ReportError(const
char *pszDSName,
CPLErr eErrClass,
867 char **GetMetadata(
const char *pszDomain =
"")
override;
873 const char *pszDomain)
override;
876 char **GetMetadataDomainList()
override;
878 virtual void ClearStatistics();
900 unsigned int nOpenFlags = 0,
901 const char *
const *papszAllowedDrivers =
nullptr,
902 const char *
const *papszOpenOptions =
nullptr,
903 const char *
const *papszSiblingFiles =
nullptr)
905 return FromHandle(
GDALOpenEx(pszFilename, nOpenFlags,
906 papszAllowedDrivers, papszOpenOptions,
922 void SetEnableOverviews(
bool bEnable);
925 bool AreOverviewsEnabled()
const;
930 Private *m_poPrivate;
932 CPL_INTERNAL
OGRLayer *BuildLayerFromSelectInfo(
933 swq_select *psSelectInfo,
OGRGeometry *poSpatialFilter,
934 const char *pszDialect, swq_select_parse_options *poSelectParseOptions);
938 virtual int GetLayerCount();
939 virtual OGRLayer *GetLayer(
int iLayer);
941 virtual bool IsLayerPrivate(
int iLayer)
const;
963 std::unique_ptr<Private> m_poPrivate;
971 std::input_iterator_tag;
997 OGRLayer *operator[](
size_t iLayer);
998 OGRLayer *operator[](
const char *pszLayername);
1003 virtual OGRLayer *GetLayerByName(
const char *);
1004 virtual OGRErr DeleteLayer(
int iLayer);
1006 virtual void ResetReading();
1008 double *pdfProgressPct,
1009 GDALProgressFunc pfnProgress,
1010 void *pProgressData);
1024 class CPL_DLL Iterator
1027 std::unique_ptr<Private> m_poPrivate;
1031 Iterator(
const Iterator &oOther);
1033 Iterator(Iterator &&oOther)
noexcept;
1037 Iterator &operator++();
1038 bool operator!=(
const Iterator &it)
const;
1042 const Iterator
begin()
const;
1044 const Iterator
end()
const;
1049 virtual int TestCapability(
const char *);
1051 virtual std::vector<std::string>
1052 GetFieldDomainNames(
CSLConstList papszOptions =
nullptr)
const;
1054 virtual const OGRFieldDomain *GetFieldDomain(
const std::string &name)
const;
1056 virtual bool AddFieldDomain(std::unique_ptr<OGRFieldDomain> &&domain,
1057 std::string &failureReason);
1059 virtual bool DeleteFieldDomain(
const std::string &name,
1060 std::string &failureReason);
1062 virtual bool UpdateFieldDomain(std::unique_ptr<OGRFieldDomain> &&domain,
1063 std::string &failureReason);
1065 virtual std::vector<std::string>
1066 GetRelationshipNames(
CSLConstList papszOptions =
nullptr)
const;
1069 GetRelationship(
const std::string &name)
const;
1072 AddRelationship(std::unique_ptr<GDALRelationship> &&relationship,
1073 std::string &failureReason);
1075 virtual bool DeleteRelationship(
const std::string &name,
1076 std::string &failureReason);
1079 UpdateRelationship(std::unique_ptr<GDALRelationship> &&relationship,
1080 std::string &failureReason);
1083 OGRLayer *CreateLayer(
const char *pszName);
1085 OGRLayer *CreateLayer(
const char *pszName, std::nullptr_t);
1088 OGRLayer *CreateLayer(
const char *pszName,
1093 OGRLayer *CreateLayer(
const char *pszName,
1098 char **papszOptions =
nullptr);
1101 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1105 virtual OGRLayer *ExecuteSQL(
const char *pszStatement,
1107 const char *pszDialect);
1108 virtual void ReleaseResultSet(
OGRLayer *poResultsSet);
1109 virtual OGRErr AbortSQL();
1111 int GetRefCount()
const;
1112 int GetSummaryRefCount()
const;
1115 virtual OGRErr StartTransaction(
int bForce = FALSE);
1116 virtual OGRErr CommitTransaction();
1117 virtual OGRErr RollbackTransaction();
1119 virtual std::shared_ptr<GDALGroup> GetRootGroup()
const;
1122 static int IsGenericSQLDialect(
const char *pszDialect);
1126 BuildParseInfo(swq_select *psSelectInfo,
1127 swq_select_parse_options *poSelectParseOptions);
1128 static void DestroyParseInfo(GDALSQLParseInfo *psParseInfo);
1130 const char *pszDialect,
1131 swq_select_parse_options *poSelectParseOptions);
1135 virtual OGRLayer *ICreateLayer(
const char *pszName,
1140 OGRErr ProcessSQLCreateIndex(
const char *);
1141 OGRErr ProcessSQLDropIndex(
const char *);
1142 OGRErr ProcessSQLDropTable(
const char *);
1143 OGRErr ProcessSQLAlterTableAddColumn(
const char *);
1144 OGRErr ProcessSQLAlterTableDropColumn(
const char *);
1145 OGRErr ProcessSQLAlterTableAlterColumn(
const char *);
1146 OGRErr ProcessSQLAlterTableRenameColumn(
const char *);
1150 friend class GDALProxyPoolDataset;
1158struct CPL_DLL GDALDatasetUniquePtrDeleter
1169struct CPL_DLL GDALDatasetUniquePtrReleaser
1186 std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter>;
1198 friend class GDALAbstractBandBlockCache;
1203 volatile int nLockCount;
1220 CPL_INTERNAL
void Detach_unlocked(
void);
1221 CPL_INTERNAL
void Touch_unlocked(
void);
1223 CPL_INTERNAL
void RecycleFor(
int nXOffIn,
int nYOffIn);
1230 CPLErr Internalize(
void);
1232 void MarkDirty(
void);
1233 void MarkClean(
void);
1238 return CPLAtomicInc(&nLockCount);
1244 return CPLAtomicDec(&nLockCount);
1312 return static_cast<GPtrDiff_t>(nXSize) * nYSize *
1317 int DropLockForRemovalFromStorage();
1326 static void FlushDirtyBlocks();
1327 static int FlushCacheBlock(
int bDirtyBlocksOnly = FALSE);
1328 static void Verify();
1330 static void EnterDisableDirtyBlockFlush();
1331 static void LeaveDisableDirtyBlockFlush();
1336 static void DumpAll();
1341 CPL_INTERNAL
static void DestroyRBMutex();
1358 std::vector<GDALColorEntry> aoEntries{};
1369 int GetColorEntryCount()
const;
1373 int CreateColorRamp(
int nStartIndex,
const GDALColorEntry *psStartColor,
1375 bool IsIdentity()
const;
1403class GDALAbstractBandBlockCache
1406 CPLLock *hSpinLock =
nullptr;
1410 CPLCond *hCond =
nullptr;
1411 CPLMutex *hCondMutex =
nullptr;
1412 volatile int nKeepAliveCounter = 0;
1414 volatile int m_nDirtyBlocks = 0;
1421 int m_nInitialDirtyBlocksInFlushCache = 0;
1422 int m_nLastTick = -1;
1423 size_t m_nWriteDirtyBlocksDisabled = 0;
1425 void FreeDanglingBlocks();
1426 void UnreferenceBlockBase();
1428 void StartDirtyBlockFlushingLog();
1429 void UpdateDirtyBlockFlushingLog();
1430 void EndDirtyBlockFlushingLog();
1434 virtual ~GDALAbstractBandBlockCache();
1438 void IncDirtyBlocks(
int nInc);
1439 void WaitCompletionPendingTasks();
1441 void EnableDirtyBlockWriting()
1443 --m_nWriteDirtyBlocksDisabled;
1446 void DisableDirtyBlockWriting()
1448 ++m_nWriteDirtyBlocksDisabled;
1451 bool HasDirtyBlocks()
const
1453 return m_nDirtyBlocks > 0;
1456 virtual bool Init() = 0;
1457 virtual bool IsInitOK() = 0;
1458 virtual CPLErr FlushCache() = 0;
1461 int nYBlockYOff) = 0;
1463 virtual CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
1464 int bWriteDirtyBlock) = 0;
1467GDALAbstractBandBlockCache *
1469GDALAbstractBandBlockCache *
1479class GDALDoublePointsCache;
1514 friend class GDALArrayBandBlockCache;
1515 friend class GDALHashSetBandBlockCache;
1519 CPLErr eFlushBlockErr = CE_None;
1520 GDALAbstractBandBlockCache *poBandBlockCache =
nullptr;
1522 CPL_INTERNAL
void SetFlushBlockErr(
CPLErr eErr);
1524 CPL_INTERNAL
void IncDirtyBlocks(
int nInc);
1531 int nRasterXSize = 0;
1532 int nRasterYSize = 0;
1538 int nBlockXSize = -1;
1539 int nBlockYSize = -1;
1540 int nBlocksPerRow = 0;
1541 int nBlocksPerColumn = 0;
1543 int nBlockReads = 0;
1544 int bForceCachedIO = 0;
1546 class GDALRasterBandOwnedOrNot
1549 GDALRasterBandOwnedOrNot()
1554 : m_poBandOwned(bOwned ? poBand :
nullptr),
1555 m_poBandRef(bOwned ?
nullptr : poBand)
1561 m_poBandOwned.reset();
1562 m_poBandRef =
nullptr;
1567 m_poBandOwned.reset(bOwned ? poBand :
nullptr);
1568 m_poBandRef = bOwned ? nullptr : poBand;
1576 bool IsOwned()
const
1578 return m_poBandOwned !=
nullptr;
1583 return m_poBandOwned ? m_poBandOwned.get() : m_poBandRef;
1588 std::unique_ptr<GDALRasterBand> m_poBandOwned{};
1592 GDALRasterBandOwnedOrNot poMask{};
1593 bool m_bEnablePixelTypeSignedByteWarning =
1597 void InvalidateMaskBand();
1599 friend class GDALProxyRasterBand;
1600 friend class GDALDefaultOverviews;
1603 RasterIOResampled(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
1604 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
1610 void LeaveReadWrite();
1614 mutable std::unique_ptr<GDALDoublePointsCache> m_oPointsCache{};
1620 virtual CPLErr IWriteBlock(
int nBlockXOff,
int nBlockYOff,
void *pData);
1623 IRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1624 void *pData,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
1628 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
1629 int nYSize,
int nMaskFlagStop,
1630 double *pdfDataPct);
1633 OverviewRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
1634 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
1640 int nXSize,
int nYSize,
void *pData,
1641 int nBufXSize,
int nBufYSize,
1646 int InitBlockInfo();
1650 bool HasBlockCache()
const
1652 return poBandBlockCache !=
nullptr;
1655 bool HasDirtyBlocks()
const
1657 return poBandBlockCache && poBandBlockCache->HasDirtyBlocks();
1674 void GetBlockSize(
int *pnXSize,
int *pnYSize);
1675 CPLErr GetActualBlockSize(
int nXBlockOff,
int nYBlockOff,
int *pnXValid,
1679 GetSuggestedBlockAccessPattern()
const;
1685 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
1692 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
1697 CPLErr ReadBlock(
int nXBlockOff,
int nYBlockOff,
1700 CPLErr WriteBlock(
int nXBlockOff,
int nYBlockOff,
1704 GetLockedBlockRef(
int nXBlockOff,
int nYBlockOff,
1706 GDALRasterBlock *TryGetLockedBlockRef(
int nXBlockOff,
int nYBlockYOff)
1708 CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
1709 int bWriteDirtyBlock = TRUE);
1713 unsigned char *pTranslationTable =
nullptr,
1714 int *pApproximateMatching =
nullptr);
1718 virtual CPLErr FlushCache(
bool bAtClosing =
false);
1719 virtual CPLErr DropCache();
1720 virtual char **GetCategoryNames();
1721 virtual double GetNoDataValue(
int *pbSuccess =
nullptr);
1722 virtual int64_t GetNoDataValueAsInt64(
int *pbSuccess =
nullptr);
1723 virtual uint64_t GetNoDataValueAsUInt64(
int *pbSuccess =
nullptr);
1724 virtual double GetMinimum(
int *pbSuccess =
nullptr);
1725 virtual double GetMaximum(
int *pbSuccess =
nullptr);
1726 virtual double GetOffset(
int *pbSuccess =
nullptr);
1727 virtual double GetScale(
int *pbSuccess =
nullptr);
1728 virtual const char *GetUnitType();
1731 virtual CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0);
1733 virtual CPLErr SetCategoryNames(
char **papszNames);
1734 virtual CPLErr SetNoDataValue(
double dfNoData);
1735 virtual CPLErr SetNoDataValueAsInt64(int64_t nNoData);
1736 virtual CPLErr SetNoDataValueAsUInt64(uint64_t nNoData);
1737 virtual CPLErr DeleteNoDataValue();
1740 virtual CPLErr SetOffset(
double dfNewOffset);
1741 virtual CPLErr SetScale(
double dfNewScale);
1742 virtual CPLErr SetUnitType(
const char *pszNewValue);
1744 virtual CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
1745 double *pdfMax,
double *pdfMean,
1746 double *padfStdDev);
1747 virtual CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
1748 double *pdfMax,
double *pdfMean,
1749 double *pdfStdDev, GDALProgressFunc,
1750 void *pProgressData);
1751 virtual CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
1753 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double *adfMinMax);
1759 const char *pszDomain)
override;
1761 virtual const char *GetMetadataItem(
const char *pszName,
1762 const char *pszDomain =
"")
override;
1764 virtual int HasArbitraryOverviews();
1765 virtual int GetOverviewCount();
1768 virtual CPLErr BuildOverviews(
const char *pszResampling,
int nOverviews,
1769 const int *panOverviewList,
1770 GDALProgressFunc pfnProgress,
1771 void *pProgressData,
1774 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1775 int nBufXSize,
int nBufYSize,
1778 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
1779 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1780 int bApproxOK, GDALProgressFunc,
1781 void *pProgressData);
1783 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
1784 int *pnBuckets,
GUIntBig **ppanHistogram,
1785 int bForce, GDALProgressFunc,
1786 void *pProgressData);
1787 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
1794 virtual int GetMaskFlags();
1795 virtual CPLErr CreateMaskBand(
int nFlagsIn);
1796 virtual bool IsMaskBand()
const;
1800 GetVirtualMemAuto(
GDALRWFlag eRWFlag,
int *pnPixelSpace,
1804 int GetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1805 int nMaskFlagStop = 0,
1806 double *pdfDataPct =
nullptr);
1808 std::shared_ptr<GDALMDArray> AsMDArray()
const;
1810 CPLErr InterpolateAtPoint(
double dfPixel,
double dfLine,
1812 double *pdfRealValue,
1813 double *pdfImagValue =
nullptr)
const;
1839 void EnablePixelTypeSignedByteWarning(
bool b)
1840#ifndef GDAL_COMPILATION
1841 CPL_WARN_DEPRECATED(
"Do not use that method outside of GDAL!")
1859 CPLErr IReadBlock(
int,
int,
void *)
override;
1865 ~GDALAllValidMaskBand()
override;
1868 int GetMaskFlags()
override;
1870 bool IsMaskBand()
const override
1880 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
1881 double *pdfMean,
double *pdfStdDev,
1882 GDALProgressFunc,
void *pProgressData)
override;
1892 double m_dfNoDataValue = 0;
1893 int64_t m_nNoDataValueInt64 = 0;
1894 uint64_t m_nNoDataValueUInt64 = 0;
1900 CPLErr IReadBlock(
int,
int,
void *)
override;
1907 explicit GDALNoDataMaskBand(
GDALRasterBand *,
double dfNoDataValue);
1908 ~GDALNoDataMaskBand()
override;
1910 bool IsMaskBand()
const override
1920 static bool IsNoDataInRange(
double dfNoDataValue,
GDALDataType eDataType);
1929 double *padfNodataValues;
1934 CPLErr IReadBlock(
int,
int,
void *)
override;
1938 ~GDALNoDataValuesMaskBand()
override;
1940 bool IsMaskBand()
const override
1970 ~GDALRescaledAlphaBand()
override;
2021 CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
2022 const char *pszDomain =
"")
override;
2027 GDALDataset *Create(
const char *pszName,
int nXSize,
int nYSize,
int nBands,
2032 CreateMultiDimensional(
const char *pszName,
2036 CPLErr Delete(
const char *pszName);
2037 CPLErr Rename(
const char *pszNewName,
const char *pszOldName);
2038 CPLErr CopyFiles(
const char *pszNewName,
const char *pszOldName);
2042 GDALProgressFunc pfnProgress,
2045 bool CanVectorTranslateFrom(
const char *pszDestName,
2048 char ***ppapszFailureReasons);
2051 VectorTranslateFrom(
const char *pszDestName,
GDALDataset *poSourceDS,
2053 GDALProgressFunc pfnProgress,
2068 OpenCallback pfnOpen =
nullptr;
2070 virtual OpenCallback GetOpenCallback()
2075 typedef GDALDataset *(*CreateCallback)(
const char *pszName,
int nXSize,
2076 int nYSize,
int nBands,
2078 char **papszOptions);
2080 CreateCallback pfnCreate =
nullptr;
2082 virtual CreateCallback GetCreateCallback()
2089 char **papszOptions) =
nullptr;
2091 typedef GDALDataset *(*CreateMultiDimensionalCallback)(
2092 const char *pszName,
CSLConstList papszRootGroupOptions,
2095 CreateMultiDimensionalCallback pfnCreateMultiDimensional =
nullptr;
2097 virtual CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
2099 return pfnCreateMultiDimensional;
2102 typedef CPLErr (*DeleteCallback)(
const char *pszName);
2103 DeleteCallback pfnDelete =
nullptr;
2105 virtual DeleteCallback GetDeleteCallback()
2112 GDALProgressFunc pfnProgress,
2113 void *pProgressData);
2115 CreateCopyCallback pfnCreateCopy =
nullptr;
2117 virtual CreateCopyCallback GetCreateCopyCallback()
2119 return pfnCreateCopy;
2122 void *pDriverData =
nullptr;
2124 void (*pfnUnloadDriver)(
GDALDriver *) =
nullptr;
2137 typedef CPLErr (*RenameCallback)(
const char *pszNewName,
2138 const char *pszOldName);
2139 RenameCallback pfnRename =
nullptr;
2141 virtual RenameCallback GetRenameCallback()
2146 typedef CPLErr (*CopyFilesCallback)(
const char *pszNewName,
2147 const char *pszOldName);
2148 CopyFilesCallback pfnCopyFiles =
nullptr;
2150 virtual CopyFilesCallback GetCopyFilesCallback()
2152 return pfnCopyFiles;
2161 char **papszOptions) =
nullptr;
2162 CPLErr (*pfnDeleteDataSource)(
GDALDriver *,
const char *pszName) =
nullptr;
2168 bool (*pfnCanVectorTranslateFrom)(
2171 char ***ppapszFailureReasons) =
nullptr;
2180 GDALProgressFunc pfnProgress,
void *pProgressData) =
nullptr;
2197 GDALProgressFunc pfnProgress,
2200 static CPLErr DefaultCreateCopyMultiDimensional(
2203 void *pProgressData);
2209 GDALProgressFunc pfnProgress,
2210 void *pProgressData);
2212 CPLErr QuietDeleteForCreateCopy(
const char *pszFilename,
2216 static CPLErr QuietDelete(
const char *pszName,
2220 static CPLErr DefaultRename(
const char *pszNewName,
const char *pszOldName);
2221 static CPLErr DefaultCopyFiles(
const char *pszNewName,
2222 const char *pszOldName);
2295 const std::string m_osPluginFileName;
2296 std::string m_osPluginFullPath{};
2297 std::unique_ptr<GDALDriver> m_poRealDriver{};
2298 std::set<std::string> m_oSetMetadataItems{};
2308 void SetPluginFullPath(
const std::string &osFullPath)
2310 m_osPluginFullPath = osFullPath;
2321 return m_osPluginFileName;
2325 OpenCallback GetOpenCallback()
override;
2327 CreateCallback GetCreateCallback()
override;
2329 CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
override;
2331 CreateCopyCallback GetCreateCopyCallback()
override;
2333 DeleteCallback GetDeleteCallback()
override;
2335 RenameCallback GetRenameCallback()
override;
2337 CopyFilesCallback GetCopyFilesCallback()
override;
2341 const char *pszDomain =
"")
override;
2343 char **
GetMetadata(
const char *pszDomain)
override;
2346 const char *pszDomain =
"")
override;
2364 std::map<CPLString, GDALDriver *> oMapNameToDrivers{};
2365 std::string m_osPluginPath{};
2366 std::string m_osDriversIniPath{};
2367 mutable std::string m_osLastTriedDirectory{};
2368 std::set<std::string> m_oSetPluginFileNames{};
2369 bool m_bInDeferredDriverLoading =
false;
2370 std::map<std::string, std::unique_ptr<GDALDriver>> m_oMapRealDrivers{};
2371 std::vector<std::unique_ptr<GDALDriver>> m_aoHiddenDrivers{};
2375 return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver]
2379 GDALDriver *GetDriverByName_unlocked(
const char *pszName)
const
2381 auto oIter = oMapNameToDrivers.find(
CPLString(pszName).toupper());
2382 return oIter == oMapNameToDrivers.end() ? nullptr : oIter->second;
2385 static void CleanupPythonDrivers();
2387 std::string GetPluginFullPath(
const char *pszFilename)
const;
2389 int RegisterDriver(
GDALDriver *,
bool bHidden);
2396 GDALOpenEx(
const char *pszFilename,
unsigned int nOpenFlags,
2397 const char *
const *papszAllowedDrivers,
2398 const char *
const *papszOpenOptions,
2399 const char *
const *papszSiblingFiles);
2402 static char **GetSearchPaths(
const char *pszGDAL_DRIVER_PATH);
2409 int GetDriverCount(
void)
const;
2417 void AutoLoadDrivers();
2418 void AutoSkipDrivers();
2419 void ReorderDrivers();
2420 static CPLErr LoadPlugin(
const char *name);
2422 static void AutoLoadPythonDrivers();
2427 int GetDriverCount(
bool bIncludeHidden)
const;
2428 GDALDriver *GetDriver(
int iDriver,
bool bIncludeHidden);
2586 int *pnBufXSize,
int *pnBufYSize) = 0;
2587 virtual int LockBuffer(
double dfTimeout = -1.0);
2588 virtual void UnlockBuffer();
2623 Create(
const std::string &osName,
size_t nTotalSize,
2624 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
2626 CreateString(
size_t nMaxStringLength = 0,
2634 return !(operator==(other));
2662 return m_eNumericDT;
2683 return m_aoComponents;
2703 return m_nMaxStringLength;
2708 bool NeedsFreeDynamicMemory()
const;
2710 void FreeDynamicMemory(
void *pBuffer)
const;
2715 static bool CopyValues(
const void *pSrc,
2719 GPtrDiff_t nDstStrideInElts,
size_t nValues);
2726 const std::string &osName,
size_t nTotalSize,
2727 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
2729 std::string m_osName{};
2733 std::vector<std::unique_ptr<GDALEDTComponent>> m_aoComponents{};
2735 size_t m_nMaxStringLength = 0;
2785 std::string m_osName;
2802 std::shared_ptr<GDALAttribute>
2803 GetAttributeFromAttributes(
const std::string &osName)
const;
2808 virtual std::shared_ptr<GDALAttribute>
2809 GetAttribute(
const std::string &osName)
const;
2811 virtual std::vector<std::shared_ptr<GDALAttribute>>
2812 GetAttributes(
CSLConstList papszOptions =
nullptr)
const;
2814 virtual std::shared_ptr<GDALAttribute>
2815 CreateAttribute(
const std::string &osName,
2816 const std::vector<GUInt64> &anDimensions,
2820 virtual bool DeleteAttribute(
const std::string &osName,
2844 std::string m_osName{};
2847 std::string m_osFullName{};
2851 const std::string m_osContext{};
2853 std::weak_ptr<GDALGroup> m_pSelf{};
2856 bool m_bValid =
true;
2858 GDALGroup(
const std::string &osParentName,
const std::string &osName,
2859 const std::string &osContext = std::string());
2862 GetInnerMostGroup(
const std::string &osPathOrArrayOrDim,
2863 std::shared_ptr<GDALGroup> &curGroupHolder,
2864 std::string &osLastPart)
const;
2866 void BaseRename(
const std::string &osNewName);
2868 bool CheckValidAndErrorOutIfNot()
const;
2870 void SetSelf(
const std::shared_ptr<GDALGroup> &self)
2875 virtual void NotifyChildrenOfRenaming()
2879 virtual void NotifyChildrenOfDeletion()
2903 return m_osFullName;
2906 virtual std::vector<std::string>
2907 GetMDArrayNames(
CSLConstList papszOptions =
nullptr)
const;
2908 virtual std::shared_ptr<GDALMDArray>
2909 OpenMDArray(
const std::string &osName,
2912 virtual std::vector<std::string>
2913 GetGroupNames(
CSLConstList papszOptions =
nullptr)
const;
2914 virtual std::shared_ptr<GDALGroup>
2915 OpenGroup(
const std::string &osName,
2918 virtual std::vector<std::string>
2919 GetVectorLayerNames(
CSLConstList papszOptions =
nullptr)
const;
2921 OpenVectorLayer(
const std::string &osName,
2924 virtual std::vector<std::shared_ptr<GDALDimension>>
2925 GetDimensions(
CSLConstList papszOptions =
nullptr)
const;
2927 virtual std::shared_ptr<GDALGroup>
2928 CreateGroup(
const std::string &osName,
CSLConstList papszOptions =
nullptr);
2930 virtual bool DeleteGroup(
const std::string &osName,
2933 virtual std::shared_ptr<GDALDimension>
2934 CreateDimension(
const std::string &osName,
const std::string &osType,
2935 const std::string &osDirection,
GUInt64 nSize,
2938 virtual std::shared_ptr<GDALMDArray> CreateMDArray(
2939 const std::string &osName,
2940 const std::vector<std::shared_ptr<GDALDimension>> &aoDimensions,
2944 virtual bool DeleteMDArray(
const std::string &osName,
2947 GUInt64 GetTotalCopyCost()
const;
2949 virtual bool CopyFrom(
const std::shared_ptr<GDALGroup> &poDstRootGroup,
2951 const std::shared_ptr<GDALGroup> &poSrcGroup,
2952 bool bStrict,
GUInt64 &nCurCost,
2954 GDALProgressFunc pfnProgress,
void *pProgressData,
2959 std::shared_ptr<GDALMDArray>
2960 OpenMDArrayFromFullname(
const std::string &osFullName,
2963 std::shared_ptr<GDALMDArray>
2964 ResolveMDArray(
const std::string &osName,
const std::string &osStartingPath,
2967 std::shared_ptr<GDALGroup>
2968 OpenGroupFromFullname(
const std::string &osFullName,
2971 std::shared_ptr<GDALDimension>
2972 OpenDimensionFromFullname(
const std::string &osFullName)
const;
2974 virtual void ClearStatistics();
2976 virtual bool Rename(
const std::string &osNewName);
2978 std::shared_ptr<GDALGroup>
2979 SubsetDimensionFromSelection(
const std::string &osSelection)
const;
2982 virtual void ParentRenamed(
const std::string &osNewParentFullName);
2984 virtual void Deleted();
2986 virtual void ParentDeleted();
2988 const std::string &GetContext()
const
2996 static constexpr GUInt64 COPY_COST = 1000;
3013 std::string m_osName{};
3016 std::string m_osFullName{};
3017 std::weak_ptr<GDALAbstractMDArray> m_pSelf{};
3020 bool m_bValid =
true;
3023 const std::string &osName);
3025 void SetSelf(
const std::shared_ptr<GDALAbstractMDArray> &self)
3030 bool CheckValidAndErrorOutIfNot()
const;
3032 bool CheckReadWriteParams(
const GUInt64 *arrayStartIdx,
const size_t *count,
3033 const GInt64 *&arrayStep,
3037 const void *buffer_alloc_start,
3038 size_t buffer_alloc_size,
3039 std::vector<GInt64> &tmp_arrayStep,
3040 std::vector<GPtrDiff_t> &tmp_bufferStride)
const;
3043 IRead(
const GUInt64 *arrayStartIdx,
3044 const size_t *count,
3048 void *pDstBuffer)
const = 0;
3051 IWrite(
const GUInt64 *arrayStartIdx,
3052 const size_t *count,
3057 void BaseRename(
const std::string &osNewName);
3059 virtual void NotifyChildrenOfRenaming()
3063 virtual void NotifyChildrenOfDeletion()
3089 return m_osFullName;
3092 GUInt64 GetTotalElementsCount()
const;
3094 virtual size_t GetDimensionCount()
const;
3096 virtual const std::vector<std::shared_ptr<GDALDimension>> &
3101 virtual std::vector<GUInt64> GetBlockSize()
const;
3103 virtual std::vector<size_t>
3104 GetProcessingChunkSize(
size_t nMaxChunkMemory)
const;
3122 typedef bool (*FuncProcessPerChunkType)(
3124 const GUInt64 *chunkArrayStartIdx,
3125 const size_t *chunkCount,
3131 virtual bool ProcessPerChunk(
const GUInt64 *arrayStartIdx,
3132 const GUInt64 *count,
const size_t *chunkSize,
3133 FuncProcessPerChunkType pfnFunc,
3137 Read(
const GUInt64 *arrayStartIdx,
3138 const size_t *count,
3142 const void *pDstBufferAllocStart =
nullptr,
3143 size_t nDstBufferAllocSize = 0)
const;
3146 Write(
const GUInt64 *arrayStartIdx,
3147 const size_t *count,
3151 const void *pSrcBufferAllocStart =
nullptr,
3152 size_t nSrcBufferAllocSize = 0);
3154 virtual bool Rename(
const std::string &osNewName);
3157 virtual void Deleted();
3159 virtual void ParentDeleted();
3161 virtual void ParentRenamed(
const std::string &osNewParentFullName);
3242 mutable std::string m_osCachedVal{};
3246 GDALAttribute(
const std::string &osParentName,
const std::string &osName);
3250 std::vector<GUInt64> GetDimensionsSize()
const;
3253 const char *ReadAsString()
const;
3254 int ReadAsInt()
const;
3255 int64_t ReadAsInt64()
const;
3256 double ReadAsDouble()
const;
3258 std::vector<int> ReadAsIntArray()
const;
3259 std::vector<int64_t> ReadAsInt64Array()
const;
3260 std::vector<double> ReadAsDoubleArray()
const;
3263 bool Write(
const void *pabyValue,
size_t nLen);
3264 bool Write(
const char *);
3266 bool WriteInt64(int64_t);
3269 bool Write(
const int *,
size_t);
3270 bool Write(
const int64_t *,
size_t);
3271 bool Write(
const double *,
size_t);
3274 static constexpr GUInt64 COPY_COST = 100;
3283class CPL_DLL GDALAttributeString final :
public GDALAttribute
3285 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
3287 std::string m_osValue;
3292 void *pDstBuffer)
const override;
3295 GDALAttributeString(
const std::string &osParentName,
3296 const std::string &osName,
const std::string &osValue,
3299 const std::vector<std::shared_ptr<GDALDimension>> &
3300 GetDimensions()
const override;
3312class CPL_DLL GDALAttributeNumeric final :
public GDALAttribute
3314 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
3317 double m_dfValue = 0;
3318 std::vector<GUInt32> m_anValuesUInt32{};
3323 void *pDstBuffer)
const override;
3326 GDALAttributeNumeric(
const std::string &osParentName,
3327 const std::string &osName,
double dfValue);
3328 GDALAttributeNumeric(
const std::string &osParentName,
3329 const std::string &osName,
int nValue);
3330 GDALAttributeNumeric(
const std::string &osParentName,
3331 const std::string &osName,
3332 const std::vector<GUInt32> &anValues);
3334 const std::vector<std::shared_ptr<GDALDimension>> &
3335 GetDimensions()
const override;
3361 friend class GDALMDArrayResampled;
3362 std::shared_ptr<GDALMDArray>
3363 GetView(
const std::vector<GUInt64> &indices)
const;
3365 inline std::shared_ptr<GDALMDArray>
3366 atInternal(
const std::vector<GUInt64> &indices)
const
3368 return GetView(indices);
3371 template <
typename... GUInt64VarArg>
3373 inline std::shared_ptr<GDALMDArray>
3374 atInternal(std::vector<GUInt64> &indices,
GUInt64 idx,
3375 GUInt64VarArg... tail)
const
3377 indices.push_back(idx);
3378 return atInternal(indices, tail...);
3383 const std::string m_osContext{};
3385 mutable bool m_bHasTriedCachedArray =
false;
3386 mutable std::shared_ptr<GDALMDArray> m_poCachedArray{};
3390 GDALMDArray(
const std::string &osParentName,
const std::string &osName,
3391 const std::string &osContext = std::string());
3393 virtual bool IAdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
3396 virtual bool IsCacheable()
const
3401 virtual bool SetStatistics(
bool bApproxStats,
double dfMin,
double dfMax,
3402 double dfMean,
double dfStdDev,
3405 static std::string MassageName(
const std::string &inputName);
3407 std::shared_ptr<GDALGroup>
3408 GetCacheRootGroup(
bool bCanCreate, std::string &osCacheFilenameOut)
const;
3411 bool IsTransposedRequest(
const size_t *count,
3415 bool ReadForTransposedRequest(
const GUInt64 *arrayStartIdx,
3416 const size_t *count,
const GInt64 *arrayStep,
3419 void *pDstBuffer)
const;
3421 bool IsStepOneContiguousRowMajorOrderedSameDataType(
3422 const size_t *count,
const GInt64 *arrayStep,
3428 bool ReadUsingContiguousIRead(
const GUInt64 *arrayStartIdx,
3429 const size_t *count,
const GInt64 *arrayStep,
3432 void *pDstBuffer)
const;
3434 static std::shared_ptr<GDALMDArray> CreateGLTOrthorectified(
3435 const std::shared_ptr<GDALMDArray> &poParent,
3436 const std::shared_ptr<GDALGroup> &poRootGroup,
3437 const std::shared_ptr<GDALMDArray> &poGLTX,
3438 const std::shared_ptr<GDALMDArray> &poGLTY,
int nGLTIndexOffset,
3439 const std::vector<double> &adfGeoTransform,
CSLConstList papszOptions);
3444 GUInt64 GetTotalCopyCost()
const;
3447 bool bStrict,
GUInt64 &nCurCost,
3449 GDALProgressFunc pfnProgress,
void *pProgressData);
3466 virtual const std::string &GetUnit()
const;
3468 virtual bool SetUnit(
const std::string &osUnit);
3472 virtual std::shared_ptr<OGRSpatialReference> GetSpatialRef()
const;
3474 virtual const void *GetRawNoDataValue()
const;
3476 double GetNoDataValueAsDouble(
bool *pbHasNoData =
nullptr)
const;
3478 int64_t GetNoDataValueAsInt64(
bool *pbHasNoData =
nullptr)
const;
3480 uint64_t GetNoDataValueAsUInt64(
bool *pbHasNoData =
nullptr)
const;
3482 virtual bool SetRawNoDataValue(
const void *pRawNoData);
3485 bool SetNoDataValue(
int nNoData)
3487 return SetNoDataValue(
static_cast<int64_t
>(nNoData));
3492 bool SetNoDataValue(
double dfNoData);
3494 bool SetNoDataValue(int64_t nNoData);
3496 bool SetNoDataValue(uint64_t nNoData);
3498 virtual bool Resize(
const std::vector<GUInt64> &anNewDimSizes,
3501 virtual double GetOffset(
bool *pbHasOffset =
nullptr,
3504 virtual double GetScale(
bool *pbHasScale =
nullptr,
3507 virtual bool SetOffset(
double dfOffset,
3510 virtual bool SetScale(
double dfScale,
3513 std::shared_ptr<GDALMDArray> GetView(
const std::string &viewExpr)
const;
3515 std::shared_ptr<GDALMDArray> operator[](
const std::string &fieldName)
const;
3528 template <
typename... GUInt64VarArg>
3531 std::shared_ptr<GDALMDArray>
at(
GUInt64 idx, GUInt64VarArg... tail)
const
3533 std::vector<GUInt64> indices;
3534 indices.push_back(idx);
3535 return atInternal(indices, tail...);
3538 virtual std::shared_ptr<GDALMDArray>
3539 Transpose(
const std::vector<int> &anMapNewAxisToOldAxis)
const;
3541 std::shared_ptr<GDALMDArray> GetUnscaled(
3542 double dfOverriddenScale = std::numeric_limits<double>::quiet_NaN(),
3543 double dfOverriddenOffset = std::numeric_limits<double>::quiet_NaN(),
3544 double dfOverriddenDstNodata =
3545 std::numeric_limits<double>::quiet_NaN())
const;
3547 virtual std::shared_ptr<GDALMDArray>
3550 virtual std::shared_ptr<GDALMDArray>
3551 GetResampled(
const std::vector<std::shared_ptr<GDALDimension>> &apoNewDims,
3556 std::shared_ptr<GDALMDArray>
3557 GetGridded(
const std::string &osGridOptions,
3558 const std::shared_ptr<GDALMDArray> &poXArray =
nullptr,
3559 const std::shared_ptr<GDALMDArray> &poYArray =
nullptr,
3563 AsClassicDataset(
size_t iXDim,
size_t iYDim,
3564 const std::shared_ptr<GDALGroup> &poRootGroup =
nullptr,
3567 virtual CPLErr GetStatistics(
bool bApproxOK,
bool bForce,
double *pdfMin,
3568 double *pdfMax,
double *pdfMean,
3569 double *padfStdDev,
GUInt64 *pnValidCount,
3570 GDALProgressFunc pfnProgress,
3571 void *pProgressData);
3573 virtual bool ComputeStatistics(
bool bApproxOK,
double *pdfMin,
3574 double *pdfMax,
double *pdfMean,
3575 double *pdfStdDev,
GUInt64 *pnValidCount,
3576 GDALProgressFunc,
void *pProgressData,
3579 virtual void ClearStatistics();
3581 virtual std::vector<std::shared_ptr<GDALMDArray>>
3582 GetCoordinateVariables()
const;
3584 bool AdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
3587 bool IsRegularlySpaced(
double &dfStart,
double &dfIncrement)
const;
3589 bool GuessGeoTransform(
size_t nDimX,
size_t nDimY,
bool bPixelIsPoint,
3590 double adfGeoTransform[6])
const;
3595 Read(
const GUInt64 *arrayStartIdx,
3596 const size_t *count,
3600 const void *pDstBufferAllocStart =
nullptr,
3601 size_t nDstBufferAllocSize = 0) const override final;
3603 virtual std::shared_ptr<
GDALGroup> GetRootGroup() const;
3606 static constexpr
GUInt64 COPY_COST = 1000;
3608 bool CopyFromAllExceptValues(const
GDALMDArray *poSrcArray,
bool bStrict,
3610 GDALProgressFunc pfnProgress,
3611 void *pProgressData);
3619 : m_nStartIdx(nStartIdx), m_nIncr(nIncr)
3626 std::string m_osFieldName{};
3631 m_mapDimIdxToParentDimIdx{};
3636 virtual std::shared_ptr<GDALMDArray>
3637 GetView(
const std::string &viewExpr,
bool bRenameDimensions,
3638 std::vector<ViewSpec> &viewSpecs)
const;
3640 const std::string &GetContext()
const
3650 size_t iDimX,
size_t iDimY,
3651 const GUInt64 *arrayStartIdx,
const size_t *count,
3664class CPL_DLL GDALMDArrayRegularlySpaced :
public GDALMDArray
3667 double m_dfIncrement;
3668 double m_dfOffsetInIncrement;
3670 std::vector<std::shared_ptr<GDALDimension>> m_dims;
3671 std::vector<std::shared_ptr<GDALAttribute>> m_attributes{};
3672 std::string m_osEmptyFilename{};
3677 void *pDstBuffer)
const override;
3680 GDALMDArrayRegularlySpaced(
const std::string &osParentName,
3681 const std::string &osName,
3682 const std::shared_ptr<GDALDimension> &poDim,
3683 double dfStart,
double dfIncrement,
3684 double dfOffsetInIncrement);
3686 static std::shared_ptr<GDALMDArrayRegularlySpaced>
3687 Create(
const std::string &osParentName,
const std::string &osName,
3688 const std::shared_ptr<GDALDimension> &poDim,
double dfStart,
3689 double dfIncrement,
double dfOffsetInIncrement);
3691 bool IsWritable()
const override
3696 const std::string &GetFilename()
const override
3698 return m_osEmptyFilename;
3701 const std::vector<std::shared_ptr<GDALDimension>> &
3702 GetDimensions()
const override;
3706 std::vector<std::shared_ptr<GDALAttribute>>
3709 void AddAttribute(
const std::shared_ptr<GDALAttribute> &poAttr);
3733 GDALDimension(
const std::string &osParentName,
const std::string &osName,
3734 const std::string &osType,
const std::string &osDirection,
3755 return m_osFullName;
3781 return m_osDirection;
3793 virtual std::shared_ptr<GDALMDArray> GetIndexingVariable()
const;
3796 SetIndexingVariable(std::shared_ptr<GDALMDArray> poIndexingVariable);
3798 virtual bool Rename(
const std::string &osNewName);
3801 virtual void ParentRenamed(
const std::string &osNewParentFullName);
3803 virtual void ParentDeleted();
3808 std::string m_osName;
3809 std::string m_osFullName;
3810 std::string m_osType;
3811 std::string m_osDirection;
3814 void BaseRename(
const std::string &osNewName);
3824class CPL_DLL GDALDimensionWeakIndexingVar :
public GDALDimension
3826 std::weak_ptr<GDALMDArray> m_poIndexingVariable{};
3829 GDALDimensionWeakIndexingVar(
const std::string &osParentName,
3830 const std::string &osName,
3831 const std::string &osType,
3832 const std::string &osDirection,
GUInt64 nSize);
3834 std::shared_ptr<GDALMDArray> GetIndexingVariable()
const override;
3836 bool SetIndexingVariable(
3837 std::shared_ptr<GDALMDArray> poIndexingVariable)
override;
3839 void SetSize(
GUInt64 nNewSize);
3848struct GDALAntiRecursionStruct;
3850class GDALAntiRecursionGuard
3852 GDALAntiRecursionStruct *m_psAntiRecursionStruct;
3853 std::string m_osIdentifier;
3856 GDALAntiRecursionGuard(
const GDALAntiRecursionGuard &) =
delete;
3857 GDALAntiRecursionGuard &operator=(
const GDALAntiRecursionGuard &) =
delete;
3860 explicit GDALAntiRecursionGuard(
const std::string &osIdentifier);
3861 GDALAntiRecursionGuard(
const GDALAntiRecursionGuard &other,
3862 const std::string &osIdentifier);
3863 ~GDALAntiRecursionGuard();
3865 int GetCallDepth()
const
3892 std::string m_osName{};
3893 std::string m_osLeftTableName{};
3894 std::string m_osRightTableName{};
3897 std::string m_osMappingTableName{};
3898 std::vector<std::string> m_osListLeftTableFields{};
3899 std::vector<std::string> m_osListRightTableFields{};
3900 std::vector<std::string> m_osListLeftMappingTableFields{};
3901 std::vector<std::string> m_osListRightMappingTableFields{};
3903 std::string m_osForwardPathLabel{};
3904 std::string m_osBackwardPathLabel{};
3905 std::string m_osRelatedTableType{};
3918 const std::string &osLeftTableName,
3919 const std::string &osRightTableName,
3922 : m_osName(osName), m_osLeftTableName(osLeftTableName),
3923 m_osRightTableName(osRightTableName), m_eCardinality(eCardinality)
3936 return m_eCardinality;
3945 return m_osLeftTableName;
3952 return m_osRightTableName;
3961 return m_osMappingTableName;
3970 m_osMappingTableName = osName;
3981 return m_osListLeftTableFields;
3992 return m_osListRightTableFields;
4003 m_osListLeftTableFields = osListFields;
4014 m_osListRightTableFields = osListFields;
4025 return m_osListLeftMappingTableFields;
4036 return m_osListRightMappingTableFields;
4047 m_osListLeftMappingTableFields = osListFields;
4059 m_osListRightMappingTableFields = osListFields;
4097 return m_osForwardPathLabel;
4117 m_osForwardPathLabel = osLabel;
4137 return m_osBackwardPathLabel;
4157 m_osBackwardPathLabel = osLabel;
4172 return m_osRelatedTableType;
4187 m_osRelatedTableType = osType;
4211CPLErr CPL_DLL GDALRegenerateOverviewsMultiBand(
4214 const char *pszResampling, GDALProgressFunc pfnProgress,
4217CPLErr CPL_DLL GDALRegenerateOverviewsMultiBand(
4218 const std::vector<GDALRasterBand *> &apoSrcBands,
4221 const std::vector<std::vector<GDALRasterBand *>> &aapoOverviewBands,
4222 const char *pszResampling, GDALProgressFunc pfnProgress,
4232struct GDALOverviewResampleArgs
4246 double dfXRatioDstToSrc = 0;
4249 double dfYRatioDstToSrc = 0;
4251 double dfSrcXDelta = 0;
4253 double dfSrcYDelta = 0;
4257 const GByte *pabyChunkNodataMask =
nullptr;
4261 int nChunkXSize = 0;
4265 int nChunkYSize = 0;
4275 const char *pszResampling =
nullptr;
4277 bool bHasNoData =
false;
4279 double dfNoDataValue = 0;
4285 bool bPropagateNoData =
false;
4288typedef CPLErr (*GDALResampleFunction)(
const GDALOverviewResampleArgs &args,
4289 const void *pChunk,
void **ppDstBuffer,
4292GDALResampleFunction GDALGetResampleFunction(
const char *pszResampling,
4295std::string CPL_DLL GDALGetNormalizedOvrResampling(
const char *pszResampling);
4297GDALDataType GDALGetOvrWorkDataType(
const char *pszResampling,
4303HFAAuxBuildOverviews(
const char *pszOvrFilename,
GDALDataset *poParentDS,
4304 GDALDataset **ppoDS,
int nBands,
const int *panBandList,
4305 int nNewOverviews,
const int *panNewOverviewList,
4306 const char *pszResampling, GDALProgressFunc pfnProgress,
4309CPLErr CPL_DLL GTIFFBuildOverviews(
const char *pszFilename,
int nBands,
4311 int nOverviews,
const int *panOverviewList,
4312 const char *pszResampling,
4313 GDALProgressFunc pfnProgress,
4314 void *pProgressData,
4317int CPL_DLL GDALBandGetBestOverviewLevel(
GDALRasterBand *poBand,
int &nXOff,
4318 int &nYOff,
int &nXSize,
int &nYSize,
4319 int nBufXSize,
int nBufYSize)
4320 CPL_WARN_DEPRECATED(
"Use GDALBandGetBestOverviewLevel2 instead");
4321int CPL_DLL GDALBandGetBestOverviewLevel2(
GDALRasterBand *poBand,
int &nXOff,
4322 int &nYOff,
int &nXSize,
int &nYSize,
4323 int nBufXSize,
int nBufYSize,
4326int CPL_DLL GDALOvLevelAdjust(
int nOvLevel,
int nXSize)
4327 CPL_WARN_DEPRECATED(
"Use GDALOvLevelAdjust2 instead");
4328int CPL_DLL GDALOvLevelAdjust2(
int nOvLevel,
int nXSize,
int nYSize);
4329int CPL_DLL GDALComputeOvFactor(
int nOvrXSize,
int nRasterXSize,
int nOvrYSize,
4332GDALDataset CPL_DLL *GDALFindAssociatedAuxFile(
const char *pszBasefile,
4340int CPL_DLL GDALCheckDatasetDimensions(
int nXSize,
int nYSize);
4341int CPL_DLL GDALCheckBandCount(
int nBands,
int bIsZeroAllowed);
4347int CPL_DLL GDALReadWorldFile2(
const char *pszBaseFilename,
4348 const char *pszExtension,
4349 double *padfGeoTransform,
4351 char **ppszWorldFileNameOut);
4352int CPL_DLL GDALReadTabFile2(
const char *pszBaseFilename,
4353 double *padfGeoTransform,
char **ppszWKT,
4354 int *pnGCPCount,
GDAL_GCP **ppasGCPs,
4356 char **ppszTabFileNameOut);
4363void GDALNullifyOpenDatasetsList();
4364CPLMutex **GDALGetphDMMutex();
4365CPLMutex **GDALGetphDLMutex();
4366void GDALNullifyProxyPoolSingleton();
4367void GDALSetResponsiblePIDForCurrentThread(
GIntBig responsiblePID);
4368GIntBig GDALGetResponsiblePIDForCurrentThread();
4370CPLString GDALFindAssociatedFile(
const char *pszBasename,
const char *pszExt,
4373CPLErr CPL_DLL EXIFExtractMetadata(
char **&papszMetadata,
void *fpL,
4374 int nOffset,
int bSwabflag,
int nTIFFHEADER,
4375 int &nExifOffset,
int &nInterOffset,
4379 const char *
const *papszOptionOptions);
4380int GDALValidateOptions(
const char *pszOptionList,
4381 const char *
const *papszOptionsToValidate,
4382 const char *pszErrorMessageOptionType,
4383 const char *pszErrorMessageContainerName);
4389 int nXSize,
int nYSize,
int nBufXSize,
4393 bool bThisLevelOnly);
4398template <
class T>
inline bool ARE_REAL_EQUAL(T fVal1, T fVal2,
int ulp = 2)
4400 return fVal1 == fVal2 ||
4401 std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() *
4402 std::abs(fVal1 + fVal2) * ulp;
4405double GDALAdjustNoDataCloseToFloatMax(
double dfVal);
4407#define DIV_ROUND_UP(a, b) (((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1))
4411#define GDALSTAT_APPROX_NUMSAMPLES 2500
4413void GDALSerializeGCPListToXML(
CPLXMLNode *psParentNode,
4414 const std::vector<gdal::GCP> &asGCPs,
4416void GDALDeserializeGCPListFromXML(
const CPLXMLNode *psGCPList,
4417 std::vector<gdal::GCP> &asGCPs,
4420void GDALSerializeOpenOptionsToXML(
CPLXMLNode *psParentNode,
4421 char **papszOpenOptions);
4422char **GDALDeserializeOpenOptionsFromXML(
const CPLXMLNode *psParentNode);
4424int GDALCanFileAcceptSidecarFile(
const char *pszFilename);
4426bool GDALCanReliablyUseSiblingFileList(
const char *pszFilename);
4433} GDALBufferSampleFormat;
4435bool CPL_DLL GDALBufferHasOnlyNoData(
const void *pBuffer,
double dfNoDataValue,
4436 size_t nWidth,
size_t nHeight,
4437 size_t nLineStride,
size_t nComponents,
4439 GDALBufferSampleFormat nSampleFormat);
4444double CPL_DLL GDALGetNoDataValueCastToDouble(int64_t nVal);
4445double CPL_DLL GDALGetNoDataValueCastToDouble(uint64_t nVal);
4450void CPL_DLL GDALEnablePixelTypeSignedByteWarning(
GDALRasterBandH hBand,
4453std::string CPL_DLL GDALGetCompressionFormatForJPEG(
VSILFILE *fp);
4454std::string CPL_DLL GDALGetCompressionFormatForJPEG(
const void *pBuffer,
4455 size_t nBufferSize);
4459 const std::vector<std::shared_ptr<GDALMDArray>> &apoArrays,
4460 const std::vector<GDALRATFieldUsage> &aeUsages);
4465#ifdef PLUGIN_FILENAME
4466#define PLUGIN_SYMBOL_NAME(x) GDAL_core_##x
4468#define PLUGIN_SYMBOL_NAME(x) GDAL_driver_##x
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:449
Convenient string class based on std::string.
Definition cpl_string.h:320
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition gdal_priv.h:3010
const std::string & GetFullName() const
Return the name of an array or attribute.
Definition gdal_priv.h:3087
virtual const std::vector< std::shared_ptr< GDALDimension > > & GetDimensions() const =0
Return the dimensions of an attribute/array.
virtual const GDALExtendedDataType & GetDataType() const =0
Return the data type of an attribute/array.
const std::string & GetName() const
Return the name of an array or attribute.
Definition gdal_priv.h:3077
bool Write(const GUInt64 *arrayStartIdx, const size_t *count, const GInt64 *arrayStep, const GPtrDiff_t *bufferStride, const GDALExtendedDataType &bufferDataType, const void *pSrcBuffer, const void *pSrcBufferAllocStart=nullptr, size_t nSrcBufferAllocSize=0)
Write part or totality of a multidimensional array or attribute.
Definition gdalmultidim.cpp:2242
Class used as a session object for asynchronous requests.
Definition gdal_priv.h:2446
int GetXOffset() const
Return x offset.
Definition gdal_priv.h:2483
int GetYOffset() const
Return y offset.
Definition gdal_priv.h:2491
int GetYSize() const
Return height.
Definition gdal_priv.h:2507
int GetBandCount() const
Return band count.
Definition gdal_priv.h:2547
GDALDataType GetBufferType() const
Return buffer data type.
Definition gdal_priv.h:2539
int GetBandSpace() const
Return band spacing.
Definition gdal_priv.h:2579
int GetBufferYSize() const
Return buffer height.
Definition gdal_priv.h:2531
int GetXSize() const
Return width.
Definition gdal_priv.h:2499
virtual GDALAsyncStatusType GetNextUpdatedRegion(double dfTimeout, int *pnBufXOff, int *pnBufYOff, int *pnBufXSize, int *pnBufYSize)=0
= 0;
void * GetBuffer()
Return buffer.
Definition gdal_priv.h:2515
int GetPixelSpace() const
Return pixel spacing.
Definition gdal_priv.h:2563
int * GetBandMap()
Return band map.
Definition gdal_priv.h:2555
GDALDataset * GetGDALDataset()
Return dataset.
Definition gdal_priv.h:2475
int GetLineSpace() const
Return line spacing.
Definition gdal_priv.h:2571
int GetBufferXSize() const
Return buffer width.
Definition gdal_priv.h:2523
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition gdal_priv.h:3241
A color table / palette.
Definition gdal_priv.h:1355
static GDALColorTableH ToHandle(GDALColorTable *poCT)
Convert a GDALColorTable* to a GDALRasterBandH.
Definition gdal_priv.h:1380
~GDALColorTable()
Destructor.
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition gdal_priv.h:1388
Class returned by GetBands() that act as a container for raster bands.
Definition gdal_priv.h:670
Class returned by GetFeatures() that act as a container for vector features.
Definition gdal_priv.h:1015
Layer iterator.
Definition gdal_priv.h:961
void pointer
pointer
Definition gdal_priv.h:969
void difference_type
difference_type
Definition gdal_priv.h:968
std::input_iterator_tag iterator_category
iterator_category
Definition gdal_priv.h:971
Class returned by GetLayers() that acts as a range of layers.
Definition gdal_priv.h:947
A set of associated raster bands, usually from one file.
Definition gdal_priv.h:510
virtual bool SetQueryLoggerFunc(GDALQueryLoggerFunc pfnQueryLoggerFuncIn, void *poQueryLoggerArgIn)
SetQueryLoggerFunc.
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:899
bool IsMarkedSuppressOnClose()
Return MarkSuppressOnClose flag.
Definition gdal_priv.h:829
OGRErr Release()
Drop a reference to this dataset, and if the reference count drops to one close (destroy) the dataset...
Definition gdaldataset.cpp:5514
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
char ** GetOpenOptions()
Return open options.
Definition gdal_priv.h:837
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition gdal_priv.h:891
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition gdal_priv.h:883
GDALAccess GetAccess() const
Return access mode.
Definition gdal_priv.h:815
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition gdal_priv.h:3730
const std::string & GetName() const
Return the name.
Definition gdal_priv.h:3744
const std::string & GetDirection() const
Return the axis direction.
Definition gdal_priv.h:3779
const std::string & GetFullName() const
Return the full name.
Definition gdal_priv.h:3753
GUInt64 GetSize() const
Return the size, that is the number of values along the dimension.
Definition gdal_priv.h:3788
const std::string & GetType() const
Return the axis type.
Definition gdal_priv.h:3766
Class for managing the registration of file format drivers.
Definition gdal_priv.h:2361
Format specific driver.
Definition gdal_priv.h:2016
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition gdal_priv.h:2240
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition gdal_priv.h:2232
Class for a component of a compound extended data type.
Definition gdal_priv.h:2748
const GDALExtendedDataType & GetType() const
Return the data type of the component.
Definition gdal_priv.h:2779
size_t GetOffset() const
Return the offset (in bytes) of the component in the compound data type.
Definition gdal_priv.h:2770
const std::string & GetName() const
Return the name.
Definition gdal_priv.h:2761
GDALEDTComponent(const GDALEDTComponent &)
Copy constructor.
Class used to represent potentially complex data types.
Definition gdal_priv.h:2612
bool operator!=(const GDALExtendedDataType &other) const
Non-equality operator.
Definition gdal_priv.h:2632
GDALExtendedDataTypeSubType GetSubType() const
Return subtype.
Definition gdal_priv.h:2671
size_t GetSize() const
Return data type size in bytes.
Definition gdal_priv.h:2692
size_t GetMaxStringLength() const
Return the maximum length of a string in bytes.
Definition gdal_priv.h:2701
static GDALExtendedDataType Create(GDALDataType eType)
Return a new GDALExtendedDataType of class GEDTC_NUMERIC.
Definition gdalmultidim.cpp:10044
static GDALExtendedDataType CreateString(size_t nMaxStringLength=0, GDALExtendedDataTypeSubType eSubType=GEDTST_NONE)
Return a new GDALExtendedDataType of class GEDTC_STRING.
Definition gdalmultidim.cpp:10109
GDALDataType GetNumericDataType() const
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC)
Definition gdal_priv.h:2660
GDALExtendedDataTypeClass GetClass() const
Return type class.
Definition gdal_priv.h:2650
const std::vector< std::unique_ptr< GDALEDTComponent > > & GetComponents() const
Return the components of the data type (only valid when GetClass() == GEDTC_COMPOUND)
Definition gdal_priv.h:2681
const std::string & GetName() const
Return type name.
Definition gdal_priv.h:2641
Class modeling a named container of GDALAttribute, GDALMDArray, OGRLayer or other GDALGroup.
Definition gdal_priv.h:2841
const std::string & GetName() const
Return the name of the group.
Definition gdal_priv.h:2892
const std::string & GetFullName() const
Return the full name of the group.
Definition gdal_priv.h:2901
Interface used to get a single GDALAttribute or a set of GDALAttribute.
Definition gdal_priv.h:2800
Class modeling a multi-dimensional array.
Definition gdal_priv.h:3360
virtual bool IsWritable() const =0
Return whether an array is writable.
virtual const std::string & GetFilename() const =0
Return the filename that contains that array.
std::shared_ptr< GDALMDArray > at(GUInt64 idx, GUInt64VarArg... tail) const
Return a view of the array using integer indexing.
Definition gdal_priv.h:3531
Object with metadata.
Definition gdal_priv.h:156
static GDALMajorObject * FromHandle(GDALMajorObjectH hMajorObject)
Convert a GDALMajorObjectH to a GDALMajorObject*.
Definition gdal_priv.h:199
static GDALMajorObjectH ToHandle(GDALMajorObject *poMajorObject)
Convert a GDALMajorObject* to a GDALMajorObjectH.
Definition gdal_priv.h:191
Class for dataset open functions.
Definition gdal_priv.h:308
int bStatOK
Whether stat()'ing the file was successful.
Definition gdal_priv.h:329
GByte * pabyHeader
Buffer with first bytes of the file.
Definition gdal_priv.h:339
int bIsDirectory
Whether the file is a directory.
Definition gdal_priv.h:331
char ** papszOpenOptions
Open options.
Definition gdal_priv.h:321
GDALAccess eAccess
Access flag.
Definition gdal_priv.h:324
int nOpenFlags
Open flags.
Definition gdal_priv.h:326
VSILFILE * fpL
Pointer to the file.
Definition gdal_priv.h:334
char * pszFilename
Filename.
Definition gdal_priv.h:319
int nHeaderBytes
Number of bytes in pabyHeader.
Definition gdal_priv.h:337
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition gdal_priv.h:342
Proxy for a plugin driver.
Definition gdal_priv.h:2294
const char * GetMetadataItem(const char *pszName, const char *pszDomain="") override
Fetch single metadata item.
Definition gdaldrivermanager.cpp:1298
char ** GetMetadata(const char *pszDomain) override
Fetch metadata.
Definition gdaldrivermanager.cpp:1255
const std::string & GetPluginFileName() const
Return the plugin file name (not a full path)
Definition gdal_priv.h:2319
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition gdaldrivermanager.cpp:1263
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition gdal_rat.h:48
A single raster band (or channel).
Definition gdal_priv.h:1512
void static GDALRasterBandH ToHandle(GDALRasterBand *poBand)
Convert a GDALRasterBand* to a GDALRasterBandH.
Definition gdal_priv.h:1823
virtual bool IsMaskBand() const
Returns whether a band is a mask band.
Definition gdalrasterband.cpp:7637
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Default internal implementation ... to be overridden by subclasses that support reading.
virtual CPLErr IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, GSpacing nPixelSpace, GSpacing nLineSpace, GDALRasterIOExtraArg *psExtraArg)
Read/write a region of image data for this band.
Definition rasterio.cpp:207
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition gdal_priv.h:1831
A single raster block in the block cache.
Definition gdal_priv.h:1197
int GetDirty() const
Return the dirty flag.
Definition gdal_priv.h:1294
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition gdal_priv.h:1321
int GetXSize() const
Return the width of the block.
Definition gdal_priv.h:1278
GPtrDiff_t GetBlockSize() const
Return the block size in bytes.
Definition gdal_priv.h:1310
int GetYSize() const
Return the height of the block.
Definition gdal_priv.h:1286
GDALDataType GetDataType() const
Return the data type.
Definition gdal_priv.h:1254
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition gdal_priv.h:1262
int AddLock(void)
Increment the lock count.
Definition gdal_priv.h:1236
void * GetDataRef(void)
Return the data buffer.
Definition gdal_priv.h:1302
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition gdal_priv.h:1270
int DropLock(void)
Decrement the lock count.
Definition gdal_priv.h:1242
Store the raw result of an attribute value, which might contain dynamically allocated structures (lik...
Definition gdal_priv.h:3176
size_t size() const
Return the size in bytes of the raw result.
Definition gdal_priv.h:3212
const GByte * data() const
Return pointer to the start of data.
Definition gdal_priv.h:3206
const GByte & operator[](size_t idx) const
Return byte at specified index.
Definition gdal_priv.h:3200
Definition of a table relationship.
Definition gdal_priv.h:3889
const std::string & GetName() const
Get the name of the relationship.
Definition gdal_priv.h:3928
const std::vector< std::string > & GetLeftMappingTableFields() const
Get the names of the mapping table fields which correspond to the participating fields from the left ...
Definition gdal_priv.h:4023
void SetType(GDALRelationshipType eType)
Sets the type of the relationship.
Definition gdal_priv.h:4075
void SetLeftMappingTableFields(const std::vector< std::string > &osListFields)
Sets the names of the mapping table fields which correspond to the participating fields from the left...
Definition gdal_priv.h:4045
void SetMappingTableName(const std::string &osName)
Sets the name of the mapping table for many-to-many relationships.
Definition gdal_priv.h:3968
static GDALRelationshipH ToHandle(GDALRelationship *poRelationship)
Convert a GDALRelationship* to a GDALRelationshipH.
Definition gdal_priv.h:4192
const std::string & GetForwardPathLabel() const
Get the label of the forward path for the relationship.
Definition gdal_priv.h:4095
const std::string & GetLeftTableName() const
Get the name of the left (or base/origin) table in the relationship.
Definition gdal_priv.h:3943
const std::string & GetBackwardPathLabel() const
Get the label of the backward path for the relationship.
Definition gdal_priv.h:4135
const std::string & GetRelatedTableType() const
Get the type string of the related table.
Definition gdal_priv.h:4170
const std::string & GetMappingTableName() const
Get the name of the mapping table for many-to-many relationships.
Definition gdal_priv.h:3959
void SetLeftTableFields(const std::vector< std::string > &osListFields)
Sets the names of the participating fields from the left table in the relationship.
Definition gdal_priv.h:4001
GDALRelationshipCardinality GetCardinality() const
Get the cardinality of the relationship.
Definition gdal_priv.h:3934
void SetRightTableFields(const std::vector< std::string > &osListFields)
Sets the names of the participating fields from the right table in the relationship.
Definition gdal_priv.h:4012
void SetForwardPathLabel(const std::string &osLabel)
Sets the label of the forward path for the relationship.
Definition gdal_priv.h:4115
void SetBackwardPathLabel(const std::string &osLabel)
Sets the label of the backward path for the relationship.
Definition gdal_priv.h:4155
const std::vector< std::string > & GetRightTableFields() const
Get the names of the participating fields from the right table in the relationship.
Definition gdal_priv.h:3990
void SetRightMappingTableFields(const std::vector< std::string > &osListFields)
Sets the names of the mapping table fields which correspond to the participating fields from the righ...
Definition gdal_priv.h:4057
static GDALRelationship * FromHandle(GDALRelationshipH hRelationship)
Convert a GDALRelationshipH to a GDALRelationship*.
Definition gdal_priv.h:4199
const std::vector< std::string > & GetRightMappingTableFields() const
Get the names of the mapping table fields which correspond to the participating fields from the right...
Definition gdal_priv.h:4034
GDALRelationship(const std::string &osName, const std::string &osLeftTableName, const std::string &osRightTableName, GDALRelationshipCardinality eCardinality=GDALRelationshipCardinality::GRC_ONE_TO_MANY)
Constructor for a relationship between two tables.
Definition gdal_priv.h:3917
GDALRelationshipType GetType() const
Get the type of the relationship.
Definition gdal_priv.h:4066
const std::vector< std::string > & GetLeftTableFields() const
Get the names of the participating fields from the left table in the relationship.
Definition gdal_priv.h:3979
const std::string & GetRightTableName() const
Get the name of the right (or related/destination) table in the relationship.
Definition gdal_priv.h:3950
void SetRelatedTableType(const std::string &osType)
Sets the type string of the related table.
Definition gdal_priv.h:4185
A simple feature, including geometry and attributes.
Definition ogr_feature.h:893
Definition of a field domain.
Definition ogr_feature.h:1627
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:346
Abstract base class for all geometry classes.
Definition ogr_geometry.h:377
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:74
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:169
This class represents a style table.
Definition ogr_featurestyle.h:86
Various convenience functions for CPL.
CPLErr
Error category.
Definition cpl_error.h:53
int CPLErrorNum
Error number.
Definition cpl_error.h:95
Definitions for CPL mini XML Parser/Serializer.
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition cpl_port.h:256
#define STRCASECMP(a, b)
Alias for strcasecmp()
Definition cpl_port.h:544
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition cpl_port.h:938
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition cpl_port.h:218
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:299
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:295
GIntBig GInt64
Signed 64 bit integer type.
Definition cpl_port.h:236
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition cpl_port.h:950
#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:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1191
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition cpl_port.h:238
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:976
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:185
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:215
Various convenience functions for working with strings and string lists.
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition cpl_virtualmem.h:62
GUIntBig vsi_l_offset
Type for a file offset.
Definition cpl_vsi.h:146
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:315
void(* GDALQueryLoggerFunc)(const char *pszSQL, const char *pszError, int64_t lNumRecords, int64_t lExecutionTimeMilliseconds, void *pQueryLoggerArg)
Type of functions to pass to GDALDatasetSetQueryLoggerFunc.
Definition gdal.h:1309
GDALRATTableType
RAT table type (thematic or athematic)
Definition gdal.h:2034
GDALAccess
Definition gdal.h:125
@ GA_ReadOnly
Definition gdal.h:126
GDALPaletteInterp
Definition gdal.h:253
@ GPI_RGB
Definition gdal.h:255
GDALDataType
Definition gdal.h:64
@ GDT_Byte
Definition gdal.h:66
@ GDT_Float64
Definition gdal.h:75
@ GDT_Unknown
Definition gdal.h:65
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal.h:291
GDALRasterAttributeTableH GDALCreateRasterAttributeTableFromMDArrays(GDALRATTableType eTableType, int nArrays, const GDALMDArrayH *ahArrays, const GDALRATFieldUsage *paeUsages)
Return a virtual Raster Attribute Table from several GDALMDArray's.
Definition gdalmultidim_rat.cpp:429
GDALExtendedDataTypeClass
Enumeration giving the class of a GDALExtendedDataType.
Definition gdal.h:321
@ GEDTC_NUMERIC
Numeric value.
Definition gdal.h:323
GDALRelationshipCardinality
Cardinality of relationship.
Definition gdal.h:2120
@ GRC_ONE_TO_MANY
One-to-many.
Definition gdal.h:2124
GDALRIOResampleAlg
RasterIO() resampling method.
Definition gdal.h:143
CPLErr GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition gdaldataset.cpp:4118
void * GDALRelationshipH
Opaque type used for the C bindings of the C++ GDALRelationship class.
Definition gdal.h:312
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition gdal_misc.cpp:337
GDALDatasetH GDALOpenEx(const char *pszFilename, unsigned int nOpenFlags, const char *const *papszAllowedDrivers, const char *const *papszOpenOptions, const char *const *papszSiblingFiles)
Open a raster or vector file as a GDALDataset.
Definition gdaldataset.cpp:3569
GDALExtendedDataTypeSubType
Enumeration giving the subtype of a GDALExtendedDataType.
Definition gdal.h:334
@ GEDTST_NONE
None.
Definition gdal.h:336
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition gdal.h:288
GDALColorInterp
Definition gdal.h:227
GDALRelationshipType
Type of relationship.
Definition gdal.h:2136
@ GRT_ASSOCIATION
Association relationship.
Definition gdal.h:2140
GDALAsyncStatusType
status of the asynchronous stream
Definition gdal.h:111
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition gdal.h:297
GDALRWFlag
Definition gdal.h:132
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal.h:294
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition gdal.h:300
std::unique_ptr< GDALDataset, GDALDatasetUniquePtrDeleter > GDALDatasetUniquePtr
Unique pointer type for GDALDataset.
Definition gdal_priv.h:1186
constexpr GDALSuggestedBlockAccessPattern GSBAP_UNKNOWN
Unknown, or no particular read order is suggested.
Definition gdal_priv.h:1494
int GDALSuggestedBlockAccessPattern
Suggested/most efficient access pattern to blocks.
Definition gdal_priv.h:1491
constexpr GDALSuggestedBlockAccessPattern GSBAP_RANDOM
Random access to blocks is efficient.
Definition gdal_priv.h:1497
GDALDriverManager * GetGDALDriverManager(void)
Fetch the global GDAL driver manager.
Definition gdaldrivermanager.cpp:102
GDALMaskValueRange
Range of values found in a mask band.
Definition gdal_priv.h:1483
@ GMVR_0_AND_1_ONLY
Definition gdal_priv.h:1486
@ GMVR_0_AND_255_ONLY
Definition gdal_priv.h:1487
constexpr GDALSuggestedBlockAccessPattern GSBAP_TOP_TO_BOTTOM
Reading by strips from top to bottom is the most efficient.
Definition gdal_priv.h:1500
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition gdal_priv.h:1990
@ GDAL_IDENTIFY_TRUE
Identify determined the file is recognized by the probed driver.
Definition gdal_priv.h:1997
@ GDAL_IDENTIFY_FALSE
Identify determined the file is not recognized by the probed driver.
Definition gdal_priv.h:1995
@ GDAL_IDENTIFY_UNKNOWN
Identify could not determine if the file is recognized or not by the probed driver.
Definition gdal_priv.h:1993
constexpr GDALSuggestedBlockAccessPattern GSBAP_LARGEST_CHUNK_POSSIBLE
Reading the largest chunk from the raster is the most efficient (can be combined with above values).
Definition gdal_priv.h:1507
constexpr GDALSuggestedBlockAccessPattern GSBAP_BOTTOM_TO_TOP
Reading by strips from bottom to top is the most efficient.
Definition gdal_priv.h:1503
Core portability services for cross-platform OGR code.
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:416
@ wkbUnknown
unknown type, non-standard
Definition ogr_core.h:417
int OGRErr
Type for a OGR error.
Definition ogr_core.h:387
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition ogr_feature.h:1570
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:434
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:442
Document node structure.
Definition cpl_minixml.h:71
Color tuple.
Definition gdal.h:1961
Object returned by GetFeatures() iterators.
Definition gdal_priv.h:912
The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset informati...
Definition gdalsubdatasetinfo.h:43
Ground Control Point.
Definition gdal.h:1075
Virtual file handle.
Definition cpl_vsi_virtual.h:63