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 =
"");
210class CPL_DLL GDALDefaultOverviews
221 bool bCheckedForMask;
230 bool bCheckedForOverviews;
234 char **papszInitSiblingFiles;
237 GDALDefaultOverviews();
238 ~GDALDefaultOverviews();
240 void Initialize(
GDALDataset *poDSIn,
const char *pszName =
nullptr,
241 char **papszSiblingFiles =
nullptr,
int bNameIsOVR = FALSE);
243 void TransferSiblingFiles(
char **papszSiblingFiles);
247 int CloseDependentDatasets();
251 int GetOverviewCount(
int nBand);
254 CPLErr BuildOverviews(
const char *pszBasename,
const char *pszResampling,
255 int nOverviews,
const int *panOverviewList,
256 int nBands,
const int *panBandList,
257 GDALProgressFunc pfnProgress,
void *pProgressData,
260 CPLErr BuildOverviewsSubDataset(
const char *pszPhysicalFile,
261 const char *pszResampling,
int nOverviews,
262 const int *panOverviewList,
int nBands,
263 const int *panBandList,
264 GDALProgressFunc pfnProgress,
272 CPLErr CreateMaskBand(
int nFlags,
int nBand = -1);
274 int GetMaskFlags(
int nBand);
276 int HaveMaskFile(
char **papszSiblings =
nullptr,
277 const char *pszBasename =
nullptr);
279 char **GetSiblingFiles()
281 return papszInitSiblingFiles;
297 bool bHasGotSiblingFiles;
298 char **papszSiblingFiles;
299 int nHeaderBytesTried;
303 const char *
const *papszSiblingFiles =
nullptr);
332 int TryToIngest(
int nBytes);
333 char **GetSiblingFiles();
334 char **StealSiblingFiles();
335 bool AreSiblingFilesLoaded()
const;
357 explicit GCP(
const char *pszId =
"",
const char *pszInfo =
"",
358 double dfPixel = 0,
double dfLine = 0,
double dfX = 0,
359 double dfY = 0,
double dfZ = 0);
363 GCP &operator=(
const GCP &);
368 inline const char *
Id()
const
373 void SetId(
const char *pszId);
376 inline const char *
Info()
const
381 void SetInfo(
const char *pszInfo);
386 return gcp.dfGCPPixel;
392 return gcp.dfGCPPixel;
398 return gcp.dfGCPLine;
404 return gcp.dfGCPLine;
408 inline double X()
const
420 inline double Y()
const
432 inline double Z()
const
449 static const GDAL_GCP *c_ptr(
const std::vector<GCP> &asGCPs);
451 static std::vector<GCP> fromC(
const GDAL_GCP *pasGCPList,
int nGCPCount);
468class swq_select_parse_options;
472typedef struct GDALSQLParseInfo GDALSQLParseInfo;
476#ifdef GDAL_COMPILATION
477#define OPTIONAL_OUTSIDE_GDAL(val)
479#define OPTIONAL_OUTSIDE_GDAL(val) = val
487 GDALOpenEx(
const char *pszFilename,
unsigned int nOpenFlags,
488 const char *
const *papszAllowedDrivers,
489 const char *
const *papszOpenOptions,
490 const char *
const *papszSiblingFiles);
494 friend class GDALDefaultOverviews;
495 friend class GDALProxyDataset;
498 CPL_INTERNAL
void AddToDatasetOpenList();
500 CPL_INTERNAL
void UnregisterFromSharedDataset();
502 CPL_INTERNAL
static void ReportErrorV(
const char *pszDSName,
504 const char *fmt, va_list args);
512 int nRasterXSize = 512;
513 int nRasterYSize = 512;
517 static constexpr int OPEN_FLAGS_CLOSED = -1;
522 bool bForceCachedIO =
false;
523 bool bShared =
false;
524 bool bIsInternal =
true;
525 bool bSuppressOnClose =
false;
527 mutable std::map<std::string, std::unique_ptr<OGRFieldDomain>>
528 m_oMapFieldDomains{};
533 void RasterInitialize(
int,
int);
535 void SetBand(
int nNewBand, std::unique_ptr<GDALRasterBand> poBand);
537 GDALDefaultOverviews oOvManager{};
539 virtual CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
540 const int *, GDALProgressFunc,
void *,
549 BlockBasedRasterIO(
GDALRWFlag,
int,
int,
int,
int,
void *,
int,
int,
552 CPLErr BlockBasedFlushCache(
bool bAtClosing);
555 BandBasedRasterIO(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
556 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
563 RasterIOResampled(
GDALRWFlag eRWFlag,
int nXOff,
int nYOff,
int nXSize,
564 int nYSize,
void *pData,
int nBufXSize,
int nBufYSize,
570 CPLErr ValidateRasterIOOrAdviseReadParameters(
571 const char *pszCallingFunc,
int *pbStopProcessingOnCENone,
int nXOff,
572 int nYOff,
int nXSize,
int nYSize,
int nBufXSize,
int nBufYSize,
573 int nBandCount,
int *panBandMap);
576 int nXSize,
int nYSize,
void *pData,
577 int nBufXSize,
int nBufYSize,
579 int *panBandMap,
GSpacing nPixelSpace,
583 void ShareLockWithParentDataset(
GDALDataset *poParentDataset);
587 void CleanupPostFileClosing();
589 virtual int CloseDependentDatasets();
591 int ValidateLayerCreationOptions(
const char *
const *papszLCO);
593 char **papszOpenOptions =
nullptr;
600 void LeaveReadWrite();
603 void TemporarilyDropReadWriteLock();
604 void ReacquireReadWriteLock();
606 void DisableReadWriteMutex();
611 bool IsAllBands(
int nBandCount,
const int *panBandList)
const;
619 int GetRasterXSize();
620 int GetRasterYSize();
621 int GetRasterCount();
631 void *poQueryLoggerArgIn);
645 class CPL_DLL Iterator
648 std::unique_ptr<Private> m_poPrivate;
652 Iterator(
const Iterator &oOther);
654 Iterator(Iterator &&oOther)
noexcept;
658 Iterator &operator++();
659 bool operator!=(
const Iterator &it)
const;
663 const Iterator
begin()
const;
665 const Iterator
end()
const;
675 virtual CPLErr FlushCache(
bool bAtClosing =
false);
676 virtual CPLErr DropCache();
678 virtual GIntBig GetEstimatedRAMUsage();
684 const char *GetProjectionRef(
void)
const;
685 CPLErr SetProjection(
const char *pszProjection);
687 virtual CPLErr GetGeoTransform(
double *padfTransform);
688 virtual CPLErr SetGeoTransform(
double *padfTransform);
692 virtual void *GetInternalHandle(
const char *pszHandleName);
694 virtual char **GetFileList(
void);
696 virtual const char *GetDriverName();
699 virtual int GetGCPCount();
705 const char *GetGCPProjection();
707 const char *pszGCPProjection);
709 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
711 int nBandCount,
int *panBandList,
712 char **papszOptions);
714 virtual CPLErr CreateMaskBand(
int nFlagsIn);
717 BeginAsyncReader(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
void *pBuf,
719 int nBandCount,
int *panBandMap,
int nPixelSpace,
720 int nLineSpace,
int nBandSpace,
char **papszOptions);
724 struct RawBinaryLayout
726 enum class Interleaving
733 std::string osRawFilename{};
734 Interleaving eInterleaving = Interleaving::UNKNOWN;
736 bool bLittleEndianOrder =
false;
744 virtual bool GetRawBinaryLayout(RawBinaryLayout &);
751 OPTIONAL_OUTSIDE_GDAL(
nullptr)
755 virtual CPLStringList GetCompressionFormats(
int nXOff,
int nYOff,
756 int nXSize,
int nYSize,
758 const int *panBandList);
759 virtual CPLErr ReadCompressedData(
const char *pszFormat,
int nXOff,
760 int nYOff,
int nXSize,
int nYSize,
761 int nBands,
const int *panBandList,
762 void **ppBuffer,
size_t *pnBufferSize,
763 char **ppszDetailedFormat);
777 int GetShared()
const;
780 void MarkSuppressOnClose();
781 void UnMarkSuppressOnClose();
788 return bSuppressOnClose;
796 return papszOpenOptions;
799 static GDALDataset **GetOpenDatasets(
int *pnDatasetCount);
801 CPLErr BuildOverviews(
const char *,
int,
const int *,
int,
const int *,
802 GDALProgressFunc,
void *,
805 OPTIONAL_OUTSIDE_GDAL(
nullptr)
813 static
void ReportError(const
char *pszDSName,
CPLErr eErrClass,
818 char **GetMetadata(
const char *pszDomain =
"")
override;
824 const char *pszDomain)
override;
827 char **GetMetadataDomainList()
override;
829 virtual void ClearStatistics();
851 unsigned int nOpenFlags = 0,
852 const char *
const *papszAllowedDrivers =
nullptr,
853 const char *
const *papszOpenOptions =
nullptr,
854 const char *
const *papszSiblingFiles =
nullptr)
856 return FromHandle(
GDALOpenEx(pszFilename, nOpenFlags,
857 papszAllowedDrivers, papszOpenOptions,
873 void SetEnableOverviews(
bool bEnable);
876 bool AreOverviewsEnabled()
const;
881 Private *m_poPrivate;
883 CPL_INTERNAL
OGRLayer *BuildLayerFromSelectInfo(
884 swq_select *psSelectInfo,
OGRGeometry *poSpatialFilter,
885 const char *pszDialect, swq_select_parse_options *poSelectParseOptions);
889 virtual int GetLayerCount();
890 virtual OGRLayer *GetLayer(
int iLayer);
892 virtual bool IsLayerPrivate(
int iLayer)
const;
914 std::unique_ptr<Private> m_poPrivate;
922 std::input_iterator_tag;
948 OGRLayer *operator[](
size_t iLayer);
949 OGRLayer *operator[](
const char *pszLayername);
954 virtual OGRLayer *GetLayerByName(
const char *);
955 virtual OGRErr DeleteLayer(
int iLayer);
957 virtual void ResetReading();
959 double *pdfProgressPct,
960 GDALProgressFunc pfnProgress,
961 void *pProgressData);
975 class CPL_DLL Iterator
978 std::unique_ptr<Private> m_poPrivate;
982 Iterator(
const Iterator &oOther);
984 Iterator(Iterator &&oOther)
noexcept;
988 Iterator &operator++();
989 bool operator!=(
const Iterator &it)
const;
993 const Iterator
begin()
const;
995 const Iterator
end()
const;
1000 virtual int TestCapability(
const char *);
1002 virtual std::vector<std::string>
1003 GetFieldDomainNames(
CSLConstList papszOptions =
nullptr)
const;
1005 virtual const OGRFieldDomain *GetFieldDomain(
const std::string &name)
const;
1007 virtual bool AddFieldDomain(std::unique_ptr<OGRFieldDomain> &&domain,
1008 std::string &failureReason);
1010 virtual bool DeleteFieldDomain(
const std::string &name,
1011 std::string &failureReason);
1013 virtual bool UpdateFieldDomain(std::unique_ptr<OGRFieldDomain> &&domain,
1014 std::string &failureReason);
1016 virtual std::vector<std::string>
1017 GetRelationshipNames(
CSLConstList papszOptions =
nullptr)
const;
1020 GetRelationship(
const std::string &name)
const;
1023 AddRelationship(std::unique_ptr<GDALRelationship> &&relationship,
1024 std::string &failureReason);
1026 virtual bool DeleteRelationship(
const std::string &name,
1027 std::string &failureReason);
1030 UpdateRelationship(std::unique_ptr<GDALRelationship> &&relationship,
1031 std::string &failureReason);
1034 OGRLayer *CreateLayer(
const char *pszName);
1036 OGRLayer *CreateLayer(
const char *pszName, std::nullptr_t);
1039 OGRLayer *CreateLayer(
const char *pszName,
1044 OGRLayer *CreateLayer(
const char *pszName,
1049 char **papszOptions =
nullptr);
1052 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1056 virtual OGRLayer *ExecuteSQL(
const char *pszStatement,
1058 const char *pszDialect);
1059 virtual void ReleaseResultSet(
OGRLayer *poResultsSet);
1060 virtual OGRErr AbortSQL();
1062 int GetRefCount()
const;
1063 int GetSummaryRefCount()
const;
1066 virtual OGRErr StartTransaction(
int bForce = FALSE);
1067 virtual OGRErr CommitTransaction();
1068 virtual OGRErr RollbackTransaction();
1070 virtual std::shared_ptr<GDALGroup> GetRootGroup()
const;
1073 static int IsGenericSQLDialect(
const char *pszDialect);
1077 BuildParseInfo(swq_select *psSelectInfo,
1078 swq_select_parse_options *poSelectParseOptions);
1079 static void DestroyParseInfo(GDALSQLParseInfo *psParseInfo);
1081 const char *pszDialect,
1082 swq_select_parse_options *poSelectParseOptions);
1086 virtual OGRLayer *ICreateLayer(
const char *pszName,
1091 OGRErr ProcessSQLCreateIndex(
const char *);
1092 OGRErr ProcessSQLDropIndex(
const char *);
1093 OGRErr ProcessSQLDropTable(
const char *);
1094 OGRErr ProcessSQLAlterTableAddColumn(
const char *);
1095 OGRErr ProcessSQLAlterTableDropColumn(
const char *);
1096 OGRErr ProcessSQLAlterTableAlterColumn(
const char *);
1097 OGRErr ProcessSQLAlterTableRenameColumn(
const char *);
1101 friend class GDALProxyPoolDataset;
1109struct CPL_DLL GDALDatasetUniquePtrDeleter
1120struct CPL_DLL GDALDatasetUniquePtrReleaser
1137 std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter>;
1149 friend class GDALAbstractBandBlockCache;
1154 volatile int nLockCount;
1171 CPL_INTERNAL
void Detach_unlocked(
void);
1172 CPL_INTERNAL
void Touch_unlocked(
void);
1174 CPL_INTERNAL
void RecycleFor(
int nXOffIn,
int nYOffIn);
1181 CPLErr Internalize(
void);
1183 void MarkDirty(
void);
1184 void MarkClean(
void);
1189 return CPLAtomicInc(&nLockCount);
1195 return CPLAtomicDec(&nLockCount);
1263 return static_cast<GPtrDiff_t>(nXSize) * nYSize *
1268 int DropLockForRemovalFromStorage();
1277 static void FlushDirtyBlocks();
1278 static int FlushCacheBlock(
int bDirtyBlocksOnly = FALSE);
1279 static void Verify();
1281 static void EnterDisableDirtyBlockFlush();
1282 static void LeaveDisableDirtyBlockFlush();
1287 static void DumpAll();
1292 CPL_INTERNAL
static void DestroyRBMutex();
1309 std::vector<GDALColorEntry> aoEntries{};
1320 int GetColorEntryCount()
const;
1326 bool IsIdentity()
const;
1354class GDALAbstractBandBlockCache
1357 CPLLock *hSpinLock =
nullptr;
1361 CPLCond *hCond =
nullptr;
1362 CPLMutex *hCondMutex =
nullptr;
1363 volatile int nKeepAliveCounter = 0;
1365 volatile int m_nDirtyBlocks = 0;
1372 int m_nInitialDirtyBlocksInFlushCache = 0;
1373 int m_nLastTick = -1;
1374 size_t m_nWriteDirtyBlocksDisabled = 0;
1376 void FreeDanglingBlocks();
1377 void UnreferenceBlockBase();
1379 void StartDirtyBlockFlushingLog();
1380 void UpdateDirtyBlockFlushingLog();
1381 void EndDirtyBlockFlushingLog();
1385 virtual ~GDALAbstractBandBlockCache();
1389 void IncDirtyBlocks(
int nInc);
1390 void WaitCompletionPendingTasks();
1392 void EnableDirtyBlockWriting()
1394 --m_nWriteDirtyBlocksDisabled;
1397 void DisableDirtyBlockWriting()
1399 ++m_nWriteDirtyBlocksDisabled;
1402 bool HasDirtyBlocks()
const
1404 return m_nDirtyBlocks > 0;
1407 virtual bool Init() = 0;
1408 virtual bool IsInitOK() = 0;
1409 virtual CPLErr FlushCache() = 0;
1412 int nYBlockYOff) = 0;
1414 virtual CPLErr FlushBlock(
int nXBlockOff,
int nYBlockOff,
1415 int bWriteDirtyBlock) = 0;
1418GDALAbstractBandBlockCache *
1420GDALAbstractBandBlockCache *
1464 friend class GDALArrayBandBlockCache;
1465 friend class GDALHashSetBandBlockCache;
1469 CPLErr eFlushBlockErr = CE_None;
1470 GDALAbstractBandBlockCache *poBandBlockCache =
nullptr;
1472 CPL_INTERNAL
void SetFlushBlockErr(
CPLErr eErr);
1474 CPL_INTERNAL
void IncDirtyBlocks(
int nInc);
1481 int nRasterXSize = 0;
1482 int nRasterYSize = 0;
1488 int nBlockXSize = -1;
1489 int nBlockYSize = -1;
1490 int nBlocksPerRow = 0;
1491 int nBlocksPerColumn = 0;
1493 int nBlockReads = 0;
1494 int bForceCachedIO = 0;
1496 class GDALRasterBandOwnedOrNot
1499 GDALRasterBandOwnedOrNot()
1504 : m_poBandOwned(bOwned ? poBand :
nullptr),
1505 m_poBandRef(bOwned ?
nullptr : poBand)
1511 m_poBandOwned.reset();
1512 m_poBandRef =
nullptr;
1517 m_poBandOwned.reset(bOwned ? poBand :
nullptr);
1518 m_poBandRef = bOwned ? nullptr : poBand;
1526 bool IsOwned()
const
1528 return m_poBandOwned !=
nullptr;
1533 return m_poBandOwned ? m_poBandOwned.get() : m_poBandRef;
1538 std::unique_ptr<GDALRasterBand> m_poBandOwned{};
1542 GDALRasterBandOwnedOrNot poMask{};
1543 bool m_bEnablePixelTypeSignedByteWarning =
1547 void InvalidateMaskBand();
1549 friend class GDALProxyRasterBand;
1550 friend class GDALDefaultOverviews;
1553 RasterIOResampled(
GDALRWFlag,
int,
int,
int,
int,
void *,
int,
int,
1558 void LeaveReadWrite();
1566 virtual CPLErr IWriteBlock(
int nBlockXOff,
int nBlockYOff,
void *pData);
1573 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
1574 int nYSize,
int nMaskFlagStop,
1575 double *pdfDataPct);
1578 OverviewRasterIO(
GDALRWFlag,
int,
int,
int,
int,
void *,
int,
int,
1583 int nXSize,
int nYSize,
void *pData,
1584 int nBufXSize,
int nBufYSize,
1589 int InitBlockInfo();
1593 bool HasBlockCache()
const
1595 return poBandBlockCache !=
nullptr;
1598 bool HasDirtyBlocks()
const
1600 return poBandBlockCache && poBandBlockCache->HasDirtyBlocks();
1617 void GetBlockSize(
int *,
int *);
1618 CPLErr GetActualBlockSize(
int,
int,
int *,
int *);
1621 GetSuggestedBlockAccessPattern()
const;
1629 OPTIONAL_OUTSIDE_GDAL(
nullptr)
1637 GetLockedBlockRef(
int nXBlockOff,
int nYBlockOff,
1639 GDALRasterBlock *TryGetLockedBlockRef(
int nXBlockOff,
int nYBlockYOff)
1641 CPLErr FlushBlock(
int,
int,
int bWriteDirtyBlock = TRUE);
1645 unsigned char *pTranslationTable =
nullptr,
1646 int *pApproximateMatching =
nullptr);
1650 virtual CPLErr FlushCache(
bool bAtClosing =
false);
1651 virtual CPLErr DropCache();
1652 virtual char **GetCategoryNames();
1653 virtual double GetNoDataValue(
int *pbSuccess =
nullptr);
1654 virtual int64_t GetNoDataValueAsInt64(
int *pbSuccess =
nullptr);
1655 virtual uint64_t GetNoDataValueAsUInt64(
int *pbSuccess =
nullptr);
1656 virtual double GetMinimum(
int *pbSuccess =
nullptr);
1657 virtual double GetMaximum(
int *pbSuccess =
nullptr);
1658 virtual double GetOffset(
int *pbSuccess =
nullptr);
1659 virtual double GetScale(
int *pbSuccess =
nullptr);
1660 virtual const char *GetUnitType();
1663 virtual CPLErr Fill(
double dfRealValue,
double dfImaginaryValue = 0);
1665 virtual CPLErr SetCategoryNames(
char **papszNames);
1666 virtual CPLErr SetNoDataValue(
double dfNoData);
1667 virtual CPLErr SetNoDataValueAsInt64(int64_t nNoData);
1668 virtual CPLErr SetNoDataValueAsUInt64(uint64_t nNoData);
1669 virtual CPLErr DeleteNoDataValue();
1672 virtual CPLErr SetOffset(
double dfNewOffset);
1673 virtual CPLErr SetScale(
double dfNewScale);
1674 virtual CPLErr SetUnitType(
const char *pszNewValue);
1676 virtual CPLErr GetStatistics(
int bApproxOK,
int bForce,
double *pdfMin,
1677 double *pdfMax,
double *pdfMean,
1678 double *padfStdDev);
1679 virtual CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
1680 double *pdfMax,
double *pdfMean,
1681 double *pdfStdDev, GDALProgressFunc,
1682 void *pProgressData);
1683 virtual CPLErr SetStatistics(
double dfMin,
double dfMax,
double dfMean,
1685 virtual CPLErr ComputeRasterMinMax(
int,
double *);
1691 const char *pszDomain)
override;
1693 virtual const char *GetMetadataItem(
const char *pszName,
1694 const char *pszDomain =
"")
override;
1696 virtual int HasArbitraryOverviews();
1697 virtual int GetOverviewCount();
1700 virtual CPLErr BuildOverviews(
const char *pszResampling,
int nOverviews,
1701 const int *panOverviewList,
1702 GDALProgressFunc pfnProgress,
1703 void *pProgressData,
1706 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1707 int nBufXSize,
int nBufYSize,
1710 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
1711 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1712 int bApproxOK, GDALProgressFunc,
1713 void *pProgressData);
1715 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
1716 int *pnBuckets,
GUIntBig **ppanHistogram,
1717 int bForce, GDALProgressFunc,
1718 void *pProgressData);
1719 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
1726 virtual int GetMaskFlags();
1727 virtual CPLErr CreateMaskBand(
int nFlagsIn);
1728 virtual bool IsMaskBand()
const;
1732 GetVirtualMemAuto(
GDALRWFlag eRWFlag,
int *pnPixelSpace,
1736 int GetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
1737 int nMaskFlagStop = 0,
1738 double *pdfDataPct =
nullptr);
1740 std::shared_ptr<GDALMDArray> AsMDArray()
const;
1766 void EnablePixelTypeSignedByteWarning(
bool b)
1767#ifndef GDAL_COMPILATION
1768 CPL_WARN_DEPRECATED(
"Do not use that method outside of GDAL!")
1786 CPLErr IReadBlock(
int,
int,
void *)
override;
1792 ~GDALAllValidMaskBand()
override;
1795 int GetMaskFlags()
override;
1797 bool IsMaskBand()
const override
1807 CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
double *pdfMax,
1808 double *pdfMean,
double *pdfStdDev,
1809 GDALProgressFunc,
void *pProgressData)
override;
1819 double m_dfNoDataValue = 0;
1820 int64_t m_nNoDataValueInt64 = 0;
1821 uint64_t m_nNoDataValueUInt64 = 0;
1827 CPLErr IReadBlock(
int,
int,
void *)
override;
1834 explicit GDALNoDataMaskBand(
GDALRasterBand *,
double dfNoDataValue);
1835 ~GDALNoDataMaskBand()
override;
1837 bool IsMaskBand()
const override
1847 static bool IsNoDataInRange(
double dfNoDataValue,
GDALDataType eDataType);
1856 double *padfNodataValues;
1861 CPLErr IReadBlock(
int,
int,
void *)
override;
1865 ~GDALNoDataValuesMaskBand()
override;
1867 bool IsMaskBand()
const override
1897 ~GDALRescaledAlphaBand()
override;
1948 CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
1949 const char *pszDomain =
"")
override;
1954 GDALDataset *Create(
const char *pszName,
int nXSize,
int nYSize,
int nBands,
1959 CreateMultiDimensional(
const char *pszName,
1963 CPLErr Delete(
const char *pszName);
1964 CPLErr Rename(
const char *pszNewName,
const char *pszOldName);
1965 CPLErr CopyFiles(
const char *pszNewName,
const char *pszOldName);
1969 GDALProgressFunc pfnProgress,
1972 bool CanVectorTranslateFrom(
const char *pszDestName,
1975 char ***ppapszFailureReasons);
1978 VectorTranslateFrom(
const char *pszDestName,
GDALDataset *poSourceDS,
1980 GDALProgressFunc pfnProgress,
1995 OpenCallback pfnOpen =
nullptr;
1997 virtual OpenCallback GetOpenCallback()
2002 typedef GDALDataset *(*CreateCallback)(
const char *pszName,
int nXSize,
2003 int nYSize,
int nBands,
2005 char **papszOptions);
2007 CreateCallback pfnCreate =
nullptr;
2009 virtual CreateCallback GetCreateCallback()
2016 char **papszOptions) =
nullptr;
2018 typedef GDALDataset *(*CreateMultiDimensionalCallback)(
2019 const char *pszName,
CSLConstList papszRootGroupOptions,
2022 CreateMultiDimensionalCallback pfnCreateMultiDimensional =
nullptr;
2024 virtual CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
2026 return pfnCreateMultiDimensional;
2029 typedef CPLErr (*DeleteCallback)(
const char *pszName);
2030 DeleteCallback pfnDelete =
nullptr;
2032 virtual DeleteCallback GetDeleteCallback()
2039 GDALProgressFunc pfnProgress,
2040 void *pProgressData);
2042 CreateCopyCallback pfnCreateCopy =
nullptr;
2044 virtual CreateCopyCallback GetCreateCopyCallback()
2046 return pfnCreateCopy;
2049 void *pDriverData =
nullptr;
2051 void (*pfnUnloadDriver)(
GDALDriver *) =
nullptr;
2064 typedef CPLErr (*RenameCallback)(
const char *pszNewName,
2065 const char *pszOldName);
2066 RenameCallback pfnRename =
nullptr;
2068 virtual RenameCallback GetRenameCallback()
2073 typedef CPLErr (*CopyFilesCallback)(
const char *pszNewName,
2074 const char *pszOldName);
2075 CopyFilesCallback pfnCopyFiles =
nullptr;
2077 virtual CopyFilesCallback GetCopyFilesCallback()
2079 return pfnCopyFiles;
2088 char **papszOptions) =
nullptr;
2089 CPLErr (*pfnDeleteDataSource)(
GDALDriver *,
const char *pszName) =
nullptr;
2095 bool (*pfnCanVectorTranslateFrom)(
2098 char ***ppapszFailureReasons) =
nullptr;
2107 GDALProgressFunc pfnProgress,
void *pProgressData) =
nullptr;
2124 GDALProgressFunc pfnProgress,
2127 static CPLErr DefaultCreateCopyMultiDimensional(
2130 void *pProgressData);
2136 GDALProgressFunc pfnProgress,
2137 void *pProgressData);
2139 CPLErr QuietDeleteForCreateCopy(
const char *pszFilename,
2143 static CPLErr QuietDelete(
const char *pszName,
2147 static CPLErr DefaultRename(
const char *pszNewName,
const char *pszOldName);
2148 static CPLErr DefaultCopyFiles(
const char *pszNewName,
2149 const char *pszOldName);
2221 const std::string m_osPluginFileName;
2222 std::string m_osPluginFullPath{};
2223 std::unique_ptr<GDALDriver> m_poRealDriver{};
2224 std::set<std::string> m_oSetMetadataItems{};
2234 void SetPluginFullPath(
const std::string &osFullPath)
2236 m_osPluginFullPath = osFullPath;
2247 return m_osPluginFileName;
2251 OpenCallback GetOpenCallback()
override;
2253 CreateCallback GetCreateCallback()
override;
2255 CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback()
override;
2257 CreateCopyCallback GetCreateCopyCallback()
override;
2259 DeleteCallback GetDeleteCallback()
override;
2261 RenameCallback GetRenameCallback()
override;
2263 CopyFilesCallback GetCopyFilesCallback()
override;
2267 const char *pszDomain =
"")
override;
2269 char **
GetMetadata(
const char *pszDomain)
override;
2272 const char *pszDomain =
"")
override;
2290 std::map<CPLString, GDALDriver *> oMapNameToDrivers{};
2291 std::string m_osPluginPath{};
2292 std::string m_osDriversIniPath{};
2293 mutable std::string m_osLastTriedDirectory{};
2294 std::set<std::string> m_oSetPluginFileNames{};
2295 bool m_bInDeferredDriverLoading =
false;
2296 std::map<std::string, std::unique_ptr<GDALDriver>> m_oMapRealDrivers{};
2297 std::vector<std::unique_ptr<GDALDriver>> m_aoHiddenDrivers{};
2301 return (iDriver >= 0 && iDriver < nDrivers) ? papoDrivers[iDriver]
2305 GDALDriver *GetDriverByName_unlocked(
const char *pszName)
const
2307 auto oIter = oMapNameToDrivers.find(
CPLString(pszName).toupper());
2308 return oIter == oMapNameToDrivers.end() ? nullptr : oIter->second;
2311 static void CleanupPythonDrivers();
2313 std::string GetPluginFullPath(
const char *pszFilename)
const;
2315 int RegisterDriver(
GDALDriver *,
bool bHidden);
2322 GDALOpenEx(
const char *pszFilename,
unsigned int nOpenFlags,
2323 const char *
const *papszAllowedDrivers,
2324 const char *
const *papszOpenOptions,
2325 const char *
const *papszSiblingFiles);
2328 static char **GetSearchPaths(
const char *pszGDAL_DRIVER_PATH);
2329 int GetDriverCount(
bool bIncludeHidden)
const;
2330 GDALDriver *GetDriver(
int iDriver,
bool bIncludeHidden);
2337 int GetDriverCount(
void)
const;
2345 void AutoLoadDrivers();
2346 void AutoSkipDrivers();
2347 void ReorderDrivers();
2348 static CPLErr LoadPlugin(
const char *name);
2350 static void AutoLoadPythonDrivers();
2509 int *pnBufXSize,
int *pnBufYSize) = 0;
2510 virtual int LockBuffer(
double dfTimeout = -1.0);
2511 virtual void UnlockBuffer();
2546 Create(
const std::string &osName,
size_t nTotalSize,
2547 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
2549 CreateString(
size_t nMaxStringLength = 0,
2557 return !(operator==(other));
2585 return m_eNumericDT;
2606 return m_aoComponents;
2626 return m_nMaxStringLength;
2631 bool NeedsFreeDynamicMemory()
const;
2633 void FreeDynamicMemory(
void *pBuffer)
const;
2638 static bool CopyValues(
const void *pSrc,
2642 GPtrDiff_t nDstStrideInElts,
size_t nValues);
2649 const std::string &osName,
size_t nTotalSize,
2650 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
2652 std::string m_osName{};
2656 std::vector<std::unique_ptr<GDALEDTComponent>> m_aoComponents{};
2658 size_t m_nMaxStringLength = 0;
2708 std::string m_osName;
2725 std::shared_ptr<GDALAttribute>
2726 GetAttributeFromAttributes(
const std::string &osName)
const;
2731 virtual std::shared_ptr<GDALAttribute>
2732 GetAttribute(
const std::string &osName)
const;
2734 virtual std::vector<std::shared_ptr<GDALAttribute>>
2735 GetAttributes(
CSLConstList papszOptions =
nullptr)
const;
2737 virtual std::shared_ptr<GDALAttribute>
2738 CreateAttribute(
const std::string &osName,
2739 const std::vector<GUInt64> &anDimensions,
2743 virtual bool DeleteAttribute(
const std::string &osName,
2767 std::string m_osName{};
2770 std::string m_osFullName{};
2774 const std::string m_osContext{};
2776 std::weak_ptr<GDALGroup> m_pSelf{};
2779 bool m_bValid =
true;
2781 GDALGroup(
const std::string &osParentName,
const std::string &osName,
2782 const std::string &osContext = std::string());
2785 GetInnerMostGroup(
const std::string &osPathOrArrayOrDim,
2786 std::shared_ptr<GDALGroup> &curGroupHolder,
2787 std::string &osLastPart)
const;
2789 void BaseRename(
const std::string &osNewName);
2791 bool CheckValidAndErrorOutIfNot()
const;
2793 void SetSelf(
const std::shared_ptr<GDALGroup> &self)
2798 virtual void NotifyChildrenOfRenaming()
2802 virtual void NotifyChildrenOfDeletion()
2826 return m_osFullName;
2829 virtual std::vector<std::string>
2830 GetMDArrayNames(
CSLConstList papszOptions =
nullptr)
const;
2831 virtual std::shared_ptr<GDALMDArray>
2832 OpenMDArray(
const std::string &osName,
2835 virtual std::vector<std::string>
2836 GetGroupNames(
CSLConstList papszOptions =
nullptr)
const;
2837 virtual std::shared_ptr<GDALGroup>
2838 OpenGroup(
const std::string &osName,
2841 virtual std::vector<std::string>
2842 GetVectorLayerNames(
CSLConstList papszOptions =
nullptr)
const;
2844 OpenVectorLayer(
const std::string &osName,
2847 virtual std::vector<std::shared_ptr<GDALDimension>>
2848 GetDimensions(
CSLConstList papszOptions =
nullptr)
const;
2850 virtual std::shared_ptr<GDALGroup>
2851 CreateGroup(
const std::string &osName,
CSLConstList papszOptions =
nullptr);
2853 virtual bool DeleteGroup(
const std::string &osName,
2856 virtual std::shared_ptr<GDALDimension>
2857 CreateDimension(
const std::string &osName,
const std::string &osType,
2858 const std::string &osDirection,
GUInt64 nSize,
2861 virtual std::shared_ptr<GDALMDArray> CreateMDArray(
2862 const std::string &osName,
2863 const std::vector<std::shared_ptr<GDALDimension>> &aoDimensions,
2867 virtual bool DeleteMDArray(
const std::string &osName,
2870 GUInt64 GetTotalCopyCost()
const;
2872 virtual bool CopyFrom(
const std::shared_ptr<GDALGroup> &poDstRootGroup,
2874 const std::shared_ptr<GDALGroup> &poSrcGroup,
2875 bool bStrict,
GUInt64 &nCurCost,
2877 GDALProgressFunc pfnProgress,
void *pProgressData,
2882 std::shared_ptr<GDALMDArray>
2883 OpenMDArrayFromFullname(
const std::string &osFullName,
2886 std::shared_ptr<GDALMDArray>
2887 ResolveMDArray(
const std::string &osName,
const std::string &osStartingPath,
2890 std::shared_ptr<GDALGroup>
2891 OpenGroupFromFullname(
const std::string &osFullName,
2894 std::shared_ptr<GDALDimension>
2895 OpenDimensionFromFullname(
const std::string &osFullName)
const;
2897 virtual void ClearStatistics();
2899 virtual bool Rename(
const std::string &osNewName);
2901 std::shared_ptr<GDALGroup>
2902 SubsetDimensionFromSelection(
const std::string &osSelection)
const;
2905 virtual void ParentRenamed(
const std::string &osNewParentFullName);
2907 virtual void Deleted();
2909 virtual void ParentDeleted();
2911 const std::string &GetContext()
const
2919 static constexpr GUInt64 COPY_COST = 1000;
2936 std::string m_osName{};
2939 std::string m_osFullName{};
2940 std::weak_ptr<GDALAbstractMDArray> m_pSelf{};
2943 bool m_bValid =
true;
2946 const std::string &osName);
2948 void SetSelf(
const std::shared_ptr<GDALAbstractMDArray> &self)
2953 bool CheckValidAndErrorOutIfNot()
const;
2955 bool CheckReadWriteParams(
const GUInt64 *arrayStartIdx,
const size_t *count,
2956 const GInt64 *&arrayStep,
2960 const void *buffer_alloc_start,
2961 size_t buffer_alloc_size,
2962 std::vector<GInt64> &tmp_arrayStep,
2963 std::vector<GPtrDiff_t> &tmp_bufferStride)
const;
2966 IRead(
const GUInt64 *arrayStartIdx,
2967 const size_t *count,
2971 void *pDstBuffer)
const = 0;
2974 IWrite(
const GUInt64 *arrayStartIdx,
2975 const size_t *count,
2980 void BaseRename(
const std::string &osNewName);
2982 virtual void NotifyChildrenOfRenaming()
2986 virtual void NotifyChildrenOfDeletion()
3012 return m_osFullName;
3015 GUInt64 GetTotalElementsCount()
const;
3017 virtual size_t GetDimensionCount()
const;
3019 virtual const std::vector<std::shared_ptr<GDALDimension>> &
3024 virtual std::vector<GUInt64> GetBlockSize()
const;
3026 virtual std::vector<size_t>
3027 GetProcessingChunkSize(
size_t nMaxChunkMemory)
const;
3045 typedef bool (*FuncProcessPerChunkType)(
3047 const GUInt64 *chunkArrayStartIdx,
3048 const size_t *chunkCount,
3054 virtual bool ProcessPerChunk(
const GUInt64 *arrayStartIdx,
3055 const GUInt64 *count,
const size_t *chunkSize,
3056 FuncProcessPerChunkType pfnFunc,
3060 Read(
const GUInt64 *arrayStartIdx,
3061 const size_t *count,
3065 const void *pDstBufferAllocStart =
nullptr,
3066 size_t nDstBufferAllocSize = 0)
const;
3069 Write(
const GUInt64 *arrayStartIdx,
3070 const size_t *count,
3074 const void *pSrcBufferAllocStart =
nullptr,
3075 size_t nSrcBufferAllocSize = 0);
3077 virtual bool Rename(
const std::string &osNewName);
3080 virtual void Deleted();
3082 virtual void ParentDeleted();
3084 virtual void ParentRenamed(
const std::string &osNewParentFullName);
3165 mutable std::string m_osCachedVal{};
3169 GDALAttribute(
const std::string &osParentName,
const std::string &osName);
3173 std::vector<GUInt64> GetDimensionsSize()
const;
3176 const char *ReadAsString()
const;
3177 int ReadAsInt()
const;
3178 double ReadAsDouble()
const;
3180 std::vector<int> ReadAsIntArray()
const;
3181 std::vector<double> ReadAsDoubleArray()
const;
3184 bool Write(
const void *pabyValue,
size_t nLen);
3185 bool Write(
const char *);
3189 bool Write(
const double *,
size_t);
3192 static constexpr GUInt64 COPY_COST = 100;
3201class CPL_DLL GDALAttributeString final :
public GDALAttribute
3203 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
3205 std::string m_osValue;
3210 void *pDstBuffer)
const override;
3213 GDALAttributeString(
const std::string &osParentName,
3214 const std::string &osName,
const std::string &osValue,
3217 const std::vector<std::shared_ptr<GDALDimension>> &
3218 GetDimensions()
const override;
3230class CPL_DLL GDALAttributeNumeric final :
public GDALAttribute
3232 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
3235 double m_dfValue = 0;
3236 std::vector<GUInt32> m_anValuesUInt32{};
3241 void *pDstBuffer)
const override;
3244 GDALAttributeNumeric(
const std::string &osParentName,
3245 const std::string &osName,
double dfValue);
3246 GDALAttributeNumeric(
const std::string &osParentName,
3247 const std::string &osName,
int nValue);
3248 GDALAttributeNumeric(
const std::string &osParentName,
3249 const std::string &osName,
3250 const std::vector<GUInt32> &anValues);
3252 const std::vector<std::shared_ptr<GDALDimension>> &
3253 GetDimensions()
const override;
3279 friend class GDALMDArrayResampled;
3280 std::shared_ptr<GDALMDArray>
3281 GetView(
const std::vector<GUInt64> &indices)
const;
3283 inline std::shared_ptr<GDALMDArray>
3284 atInternal(
const std::vector<GUInt64> &indices)
const
3286 return GetView(indices);
3289 template <
typename... GUInt64VarArg>
3291 inline std::shared_ptr<GDALMDArray>
3292 atInternal(std::vector<GUInt64> &indices,
GUInt64 idx,
3293 GUInt64VarArg... tail)
const
3295 indices.push_back(idx);
3296 return atInternal(indices, tail...);
3301 const std::string m_osContext{};
3303 mutable bool m_bHasTriedCachedArray =
false;
3304 mutable std::shared_ptr<GDALMDArray> m_poCachedArray{};
3308 GDALMDArray(
const std::string &osParentName,
const std::string &osName,
3309 const std::string &osContext = std::string());
3311 virtual bool IAdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
3314 virtual bool IsCacheable()
const
3319 virtual bool SetStatistics(
bool bApproxStats,
double dfMin,
double dfMax,
3320 double dfMean,
double dfStdDev,
3323 static std::string MassageName(
const std::string &inputName);
3325 std::shared_ptr<GDALGroup>
3326 GetCacheRootGroup(
bool bCanCreate, std::string &osCacheFilenameOut)
const;
3329 bool IsTransposedRequest(
const size_t *count,
3333 bool ReadForTransposedRequest(
const GUInt64 *arrayStartIdx,
3334 const size_t *count,
const GInt64 *arrayStep,
3337 void *pDstBuffer)
const;
3339 bool IsStepOneContiguousRowMajorOrderedSameDataType(
3340 const size_t *count,
const GInt64 *arrayStep,
3346 bool ReadUsingContiguousIRead(
const GUInt64 *arrayStartIdx,
3347 const size_t *count,
const GInt64 *arrayStep,
3350 void *pDstBuffer)
const;
3352 static std::shared_ptr<GDALMDArray>
3353 CreateGLTOrthorectified(
const std::shared_ptr<GDALMDArray> &poParent,
3354 const std::shared_ptr<GDALMDArray> &poGLTX,
3355 const std::shared_ptr<GDALMDArray> &poGLTY,
3356 int nGLTIndexOffset,
3357 const std::vector<double> &adfGeoTransform);
3362 GUInt64 GetTotalCopyCost()
const;
3365 bool bStrict,
GUInt64 &nCurCost,
3367 GDALProgressFunc pfnProgress,
void *pProgressData);
3384 virtual const std::string &GetUnit()
const;
3386 virtual bool SetUnit(
const std::string &osUnit);
3390 virtual std::shared_ptr<OGRSpatialReference> GetSpatialRef()
const;
3392 virtual const void *GetRawNoDataValue()
const;
3394 double GetNoDataValueAsDouble(
bool *pbHasNoData =
nullptr)
const;
3396 int64_t GetNoDataValueAsInt64(
bool *pbHasNoData =
nullptr)
const;
3398 uint64_t GetNoDataValueAsUInt64(
bool *pbHasNoData =
nullptr)
const;
3400 virtual bool SetRawNoDataValue(
const void *pRawNoData);
3403 bool SetNoDataValue(
int nNoData)
3405 return SetNoDataValue(
static_cast<int64_t
>(nNoData));
3410 bool SetNoDataValue(
double dfNoData);
3412 bool SetNoDataValue(int64_t nNoData);
3414 bool SetNoDataValue(uint64_t nNoData);
3416 virtual bool Resize(
const std::vector<GUInt64> &anNewDimSizes,
3419 virtual double GetOffset(
bool *pbHasOffset =
nullptr,
3422 virtual double GetScale(
bool *pbHasScale =
nullptr,
3425 virtual bool SetOffset(
double dfOffset,
3428 virtual bool SetScale(
double dfScale,
3431 std::shared_ptr<GDALMDArray> GetView(
const std::string &viewExpr)
const;
3433 std::shared_ptr<GDALMDArray> operator[](
const std::string &fieldName)
const;
3446 template <
typename... GUInt64VarArg>
3449 std::shared_ptr<GDALMDArray>
at(
GUInt64 idx, GUInt64VarArg... tail)
const
3451 std::vector<GUInt64> indices;
3452 indices.push_back(idx);
3453 return atInternal(indices, tail...);
3456 virtual std::shared_ptr<GDALMDArray>
3457 Transpose(
const std::vector<int> &anMapNewAxisToOldAxis)
const;
3459 std::shared_ptr<GDALMDArray> GetUnscaled(
3460 double dfOverriddenScale = std::numeric_limits<double>::quiet_NaN(),
3461 double dfOverriddenOffset = std::numeric_limits<double>::quiet_NaN(),
3462 double dfOverriddenDstNodata =
3463 std::numeric_limits<double>::quiet_NaN())
const;
3465 virtual std::shared_ptr<GDALMDArray>
3468 virtual std::shared_ptr<GDALMDArray>
3469 GetResampled(
const std::vector<std::shared_ptr<GDALDimension>> &apoNewDims,
3474 std::shared_ptr<GDALMDArray>
3475 GetGridded(
const std::string &osGridOptions,
3476 const std::shared_ptr<GDALMDArray> &poXArray =
nullptr,
3477 const std::shared_ptr<GDALMDArray> &poYArray =
nullptr,
3481 AsClassicDataset(
size_t iXDim,
size_t iYDim,
3482 const std::shared_ptr<GDALGroup> &poRootGroup =
nullptr,
3485 virtual CPLErr GetStatistics(
bool bApproxOK,
bool bForce,
double *pdfMin,
3486 double *pdfMax,
double *pdfMean,
3487 double *padfStdDev,
GUInt64 *pnValidCount,
3488 GDALProgressFunc pfnProgress,
3489 void *pProgressData);
3491 virtual bool ComputeStatistics(
bool bApproxOK,
double *pdfMin,
3492 double *pdfMax,
double *pdfMean,
3493 double *pdfStdDev,
GUInt64 *pnValidCount,
3494 GDALProgressFunc,
void *pProgressData,
3497 virtual void ClearStatistics();
3499 virtual std::vector<std::shared_ptr<GDALMDArray>>
3500 GetCoordinateVariables()
const;
3502 bool AdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
3505 bool IsRegularlySpaced(
double &dfStart,
double &dfIncrement)
const;
3507 bool GuessGeoTransform(
size_t nDimX,
size_t nDimY,
bool bPixelIsPoint,
3508 double adfGeoTransform[6])
const;
3513 Read(
const GUInt64 *arrayStartIdx,
3514 const size_t *count,
3518 const void *pDstBufferAllocStart =
nullptr,
3519 size_t nDstBufferAllocSize = 0) const override final;
3521 virtual std::shared_ptr<
GDALGroup> GetRootGroup() const;
3524 static constexpr
GUInt64 COPY_COST = 1000;
3526 bool CopyFromAllExceptValues(const
GDALMDArray *poSrcArray,
bool bStrict,
3528 GDALProgressFunc pfnProgress,
3529 void *pProgressData);
3537 : m_nStartIdx(nStartIdx), m_nIncr(nIncr)
3544 std::string m_osFieldName{};
3549 m_mapDimIdxToParentDimIdx{};
3554 virtual std::shared_ptr<GDALMDArray>
3555 GetView(
const std::string &viewExpr,
bool bRenameDimensions,
3556 std::vector<ViewSpec> &viewSpecs)
const;
3558 const std::string &GetContext()
const
3568 size_t iDimX,
size_t iDimY,
3569 const GUInt64 *arrayStartIdx,
const size_t *count,
3582class CPL_DLL GDALMDArrayRegularlySpaced :
public GDALMDArray
3585 double m_dfIncrement;
3586 double m_dfOffsetInIncrement;
3588 std::vector<std::shared_ptr<GDALDimension>> m_dims;
3589 std::vector<std::shared_ptr<GDALAttribute>> m_attributes{};
3590 std::string m_osEmptyFilename{};
3595 void *pDstBuffer)
const override;
3598 GDALMDArrayRegularlySpaced(
const std::string &osParentName,
3599 const std::string &osName,
3600 const std::shared_ptr<GDALDimension> &poDim,
3601 double dfStart,
double dfIncrement,
3602 double dfOffsetInIncrement);
3604 static std::shared_ptr<GDALMDArrayRegularlySpaced>
3605 Create(
const std::string &osParentName,
const std::string &osName,
3606 const std::shared_ptr<GDALDimension> &poDim,
double dfStart,
3607 double dfIncrement,
double dfOffsetInIncrement);
3609 bool IsWritable()
const override
3614 const std::string &GetFilename()
const override
3616 return m_osEmptyFilename;
3619 const std::vector<std::shared_ptr<GDALDimension>> &
3620 GetDimensions()
const override;
3624 std::vector<std::shared_ptr<GDALAttribute>>
3627 void AddAttribute(
const std::shared_ptr<GDALAttribute> &poAttr);
3651 GDALDimension(
const std::string &osParentName,
const std::string &osName,
3652 const std::string &osType,
const std::string &osDirection,
3673 return m_osFullName;
3699 return m_osDirection;
3711 virtual std::shared_ptr<GDALMDArray> GetIndexingVariable()
const;
3714 SetIndexingVariable(std::shared_ptr<GDALMDArray> poIndexingVariable);
3716 virtual bool Rename(
const std::string &osNewName);
3719 virtual void ParentRenamed(
const std::string &osNewParentFullName);
3721 virtual void ParentDeleted();
3726 std::string m_osName;
3727 std::string m_osFullName;
3728 std::string m_osType;
3729 std::string m_osDirection;
3732 void BaseRename(
const std::string &osNewName);
3742class CPL_DLL GDALDimensionWeakIndexingVar :
public GDALDimension
3744 std::weak_ptr<GDALMDArray> m_poIndexingVariable{};
3747 GDALDimensionWeakIndexingVar(
const std::string &osParentName,
3748 const std::string &osName,
3749 const std::string &osType,
3750 const std::string &osDirection,
GUInt64 nSize);
3752 std::shared_ptr<GDALMDArray> GetIndexingVariable()
const override;
3754 bool SetIndexingVariable(
3755 std::shared_ptr<GDALMDArray> poIndexingVariable)
override;
3757 void SetSize(
GUInt64 nNewSize);
3766struct GDALAntiRecursionStruct;
3768class GDALAntiRecursionGuard
3770 GDALAntiRecursionStruct *m_psAntiRecursionStruct;
3771 std::string m_osIdentifier;
3774 GDALAntiRecursionGuard(
const GDALAntiRecursionGuard &) =
delete;
3775 GDALAntiRecursionGuard &operator=(
const GDALAntiRecursionGuard &) =
delete;
3778 explicit GDALAntiRecursionGuard(
const std::string &osIdentifier);
3779 GDALAntiRecursionGuard(
const GDALAntiRecursionGuard &other,
3780 const std::string &osIdentifier);
3781 ~GDALAntiRecursionGuard();
3783 int GetCallDepth()
const
3810 std::string m_osName{};
3811 std::string m_osLeftTableName{};
3812 std::string m_osRightTableName{};
3814 GDALRelationshipCardinality::GRC_ONE_TO_MANY;
3815 std::string m_osMappingTableName{};
3816 std::vector<std::string> m_osListLeftTableFields{};
3817 std::vector<std::string> m_osListRightTableFields{};
3818 std::vector<std::string> m_osListLeftMappingTableFields{};
3819 std::vector<std::string> m_osListRightMappingTableFields{};
3821 std::string m_osForwardPathLabel{};
3822 std::string m_osBackwardPathLabel{};
3823 std::string m_osRelatedTableType{};
3836 const std::string &osLeftTableName,
3837 const std::string &osRightTableName,
3839 GDALRelationshipCardinality::GRC_ONE_TO_MANY)
3840 : m_osName(osName), m_osLeftTableName(osLeftTableName),
3841 m_osRightTableName(osRightTableName), m_eCardinality(eCardinality)
3854 return m_eCardinality;
3863 return m_osLeftTableName;
3870 return m_osRightTableName;
3879 return m_osMappingTableName;
3888 m_osMappingTableName = osName;
3899 return m_osListLeftTableFields;
3910 return m_osListRightTableFields;
3921 m_osListLeftTableFields = osListFields;
3932 m_osListRightTableFields = osListFields;
3943 return m_osListLeftMappingTableFields;
3954 return m_osListRightMappingTableFields;
3965 m_osListLeftMappingTableFields = osListFields;
3977 m_osListRightMappingTableFields = osListFields;
4015 return m_osForwardPathLabel;
4035 m_osForwardPathLabel = osLabel;
4055 return m_osBackwardPathLabel;
4075 m_osBackwardPathLabel = osLabel;
4090 return m_osRelatedTableType;
4105 m_osRelatedTableType = osType;
4129CPLErr CPL_DLL GDALRegenerateOverviewsMultiBand(
4132 const char *pszResampling, GDALProgressFunc pfnProgress,
4135typedef CPLErr (*GDALResampleFunction)(
4136 double dfXRatioDstToSrc,
double dfYRatioDstToSrc,
double dfSrcXDelta,
4137 double dfSrcYDelta,
GDALDataType eWrkDataType,
const void *pChunk,
4138 const GByte *pabyChunkNodataMask,
int nChunkXOff,
int nChunkXSize,
4139 int nChunkYOff,
int nChunkYSize,
int nDstXOff,
int nDstXOff2,
int nDstYOff,
4141 GDALDataType *peDstBufferDataType,
const char *pszResampling,
4142 bool bHasNoData,
double dfNoDataValue,
GDALColorTable *poColorTable,
4145GDALResampleFunction GDALGetResampleFunction(
const char *pszResampling,
4148std::string GDALGetNormalizedOvrResampling(
const char *pszResampling);
4150GDALDataType GDALGetOvrWorkDataType(
const char *pszResampling,
4156HFAAuxBuildOverviews(
const char *pszOvrFilename,
GDALDataset *poParentDS,
4157 GDALDataset **ppoDS,
int nBands,
const int *panBandList,
4158 int nNewOverviews,
const int *panNewOverviewList,
4159 const char *pszResampling, GDALProgressFunc pfnProgress,
4162CPLErr CPL_DLL GTIFFBuildOverviews(
const char *pszFilename,
int nBands,
4164 int nOverviews,
const int *panOverviewList,
4165 const char *pszResampling,
4166 GDALProgressFunc pfnProgress,
4167 void *pProgressData,
4170int CPL_DLL GDALBandGetBestOverviewLevel(
GDALRasterBand *poBand,
int &nXOff,
4171 int &nYOff,
int &nXSize,
int &nYSize,
4172 int nBufXSize,
int nBufYSize)
4173 CPL_WARN_DEPRECATED(
"Use GDALBandGetBestOverviewLevel2 instead");
4174int CPL_DLL GDALBandGetBestOverviewLevel2(
GDALRasterBand *poBand,
int &nXOff,
4175 int &nYOff,
int &nXSize,
int &nYSize,
4176 int nBufXSize,
int nBufYSize,
4179int CPL_DLL GDALOvLevelAdjust(
int nOvLevel,
int nXSize)
4180 CPL_WARN_DEPRECATED(
"Use GDALOvLevelAdjust2 instead");
4181int CPL_DLL GDALOvLevelAdjust2(
int nOvLevel,
int nXSize,
int nYSize);
4182int CPL_DLL GDALComputeOvFactor(
int nOvrXSize,
int nRasterXSize,
int nOvrYSize,
4185GDALDataset CPL_DLL *GDALFindAssociatedAuxFile(
const char *pszBasefile,
4193int CPL_DLL GDALCheckDatasetDimensions(
int nXSize,
int nYSize);
4194int CPL_DLL GDALCheckBandCount(
int nBands,
int bIsZeroAllowed);
4200int CPL_DLL GDALReadWorldFile2(
const char *pszBaseFilename,
4201 const char *pszExtension,
4202 double *padfGeoTransform,
4203 char **papszSiblingFiles,
4204 char **ppszWorldFileNameOut);
4205int CPL_DLL GDALReadTabFile2(
const char *pszBaseFilename,
4206 double *padfGeoTransform,
char **ppszWKT,
4207 int *pnGCPCount,
GDAL_GCP **ppasGCPs,
4208 char **papszSiblingFiles,
4209 char **ppszTabFileNameOut);
4216void GDALNullifyOpenDatasetsList();
4217CPLMutex **GDALGetphDMMutex();
4218CPLMutex **GDALGetphDLMutex();
4219void GDALNullifyProxyPoolSingleton();
4220void GDALSetResponsiblePIDForCurrentThread(
GIntBig responsiblePID);
4221GIntBig GDALGetResponsiblePIDForCurrentThread();
4223CPLString GDALFindAssociatedFile(
const char *pszBasename,
const char *pszExt,
4226CPLErr CPL_DLL EXIFExtractMetadata(
char **&papszMetadata,
void *fpL,
4227 int nOffset,
int bSwabflag,
int nTIFFHEADER,
4228 int &nExifOffset,
int &nInterOffset,
4232 const char *
const *papszOptionOptions);
4233int GDALValidateOptions(
const char *pszOptionList,
4234 const char *
const *papszOptionsToValidate,
4235 const char *pszErrorMessageOptionType,
4236 const char *pszErrorMessageContainerName);
4242 int nXSize,
int nYSize,
int nBufXSize,
4246 bool bThisLevelOnly);
4251template <
class T>
inline bool ARE_REAL_EQUAL(T fVal1, T fVal2,
int ulp = 2)
4253 return fVal1 == fVal2 ||
4254 std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() *
4255 std::abs(fVal1 + fVal2) * ulp;
4258double GDALAdjustNoDataCloseToFloatMax(
double dfVal);
4260#define DIV_ROUND_UP(a, b) (((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1))
4264#define GDALSTAT_APPROX_NUMSAMPLES 2500
4266void GDALSerializeGCPListToXML(
CPLXMLNode *psParentNode,
4267 const std::vector<gdal::GCP> &asGCPs,
4269void GDALDeserializeGCPListFromXML(
const CPLXMLNode *psGCPList,
4270 std::vector<gdal::GCP> &asGCPs,
4273void GDALSerializeOpenOptionsToXML(
CPLXMLNode *psParentNode,
4274 char **papszOpenOptions);
4275char **GDALDeserializeOpenOptionsFromXML(
const CPLXMLNode *psParentNode);
4277int GDALCanFileAcceptSidecarFile(
const char *pszFilename);
4279bool GDALCanReliablyUseSiblingFileList(
const char *pszFilename);
4286} GDALBufferSampleFormat;
4288bool CPL_DLL GDALBufferHasOnlyNoData(
const void *pBuffer,
double dfNoDataValue,
4289 size_t nWidth,
size_t nHeight,
4290 size_t nLineStride,
size_t nComponents,
4292 GDALBufferSampleFormat nSampleFormat);
4297double CPL_DLL GDALGetNoDataValueCastToDouble(int64_t nVal);
4298double CPL_DLL GDALGetNoDataValueCastToDouble(uint64_t nVal);
4303void CPL_DLL GDALEnablePixelTypeSignedByteWarning(
GDALRasterBandH hBand,
4306std::string CPL_DLL GDALGetCompressionFormatForJPEG(
VSILFILE *fp);
4307std::string CPL_DLL GDALGetCompressionFormatForJPEG(
const void *pBuffer,
4308 size_t nBufferSize);
4312 const std::vector<std::shared_ptr<GDALMDArray>> &apoArrays,
4313 const std::vector<GDALRATFieldUsage> &aeUsages);
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:444
Convenient string class based on std::string.
Definition: cpl_string.h:315
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition: gdal_priv.h:2933
const std::string & GetFullName() const
Return the name of an array or attribute.
Definition: gdal_priv.h:3010
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:3000
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:2245
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:2369
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:2406
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:2414
int GetYSize() const
Return height.
Definition: gdal_priv.h:2430
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:2470
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:2462
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:2502
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:2454
int GetXSize() const
Return width.
Definition: gdal_priv.h:2422
virtual GDALAsyncStatusType GetNextUpdatedRegion(double dfTimeout, int *pnBufXOff, int *pnBufYOff, int *pnBufXSize, int *pnBufYSize)=0
= 0;
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:2438
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:2486
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:2478
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:2398
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:2494
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:2446
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition: gdal_priv.h:3164
A color table / palette.
Definition: gdal_priv.h:1306
static GDALColorTableH ToHandle(GDALColorTable *poCT)
Convert a GDALColorTable* to a GDALRasterBandH.
Definition: gdal_priv.h:1331
~GDALColorTable()
Destructor.
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition: gdal_priv.h:1339
Class returned by GetBands() that act as a container for raster bands.
Definition: gdal_priv.h:636
Class returned by GetFeatures() that act as a container for vector features.
Definition: gdal_priv.h:966
Layer iterator.
Definition: gdal_priv.h:912
void pointer
pointer
Definition: gdal_priv.h:920
void difference_type
difference_type
Definition: gdal_priv.h:919
std::input_iterator_tag iterator_category
iterator_category
Definition: gdal_priv.h:922
Class returned by GetLayers() that acts as a range of layers.
Definition: gdal_priv.h:898
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:485
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:850
bool IsMarkedSuppressOnClose()
Return MarkSuppressOnClose flag.
Definition: gdal_priv.h:786
OGRErr Release()
Drop a reference to this dataset, and if the reference count drops to one close (destroy) the dataset...
Definition: gdaldataset.cpp:5474
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:794
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition: gdal_priv.h:842
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition: gdal_priv.h:834
GDALAccess GetAccess() const
Return access mode.
Definition: gdal_priv.h:772
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition: gdal_priv.h:3648
const std::string & GetName() const
Return the name.
Definition: gdal_priv.h:3662
const std::string & GetDirection() const
Return the axis direction.
Definition: gdal_priv.h:3697
const std::string & GetFullName() const
Return the full name.
Definition: gdal_priv.h:3671
GUInt64 GetSize() const
Return the size, that is the number of values along the dimension.
Definition: gdal_priv.h:3706
const std::string & GetType() const
Return the axis type.
Definition: gdal_priv.h:3684
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:2287
Format specific driver.
Definition: gdal_priv.h:1943
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition: gdal_priv.h:2167
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition: gdal_priv.h:2159
Class for a component of a compound extended data type.
Definition: gdal_priv.h:2671
const GDALExtendedDataType & GetType() const
Return the data type of the component.
Definition: gdal_priv.h:2702
size_t GetOffset() const
Return the offset (in bytes) of the component in the compound data type.
Definition: gdal_priv.h:2693
const std::string & GetName() const
Return the name.
Definition: gdal_priv.h:2684
GDALEDTComponent(const GDALEDTComponent &)
Copy constructor.
Class used to represent potentially complex data types.
Definition: gdal_priv.h:2535
bool operator!=(const GDALExtendedDataType &other) const
Non-equality operator.
Definition: gdal_priv.h:2555
GDALExtendedDataTypeSubType GetSubType() const
Return subtype.
Definition: gdal_priv.h:2594
size_t GetSize() const
Return data type size in bytes.
Definition: gdal_priv.h:2615
size_t GetMaxStringLength() const
Return the maximum length of a string in bytes.
Definition: gdal_priv.h:2624
static GDALExtendedDataType Create(GDALDataType eType)
Return a new GDALExtendedDataType of class GEDTC_NUMERIC.
Definition: gdalmultidim.cpp:9886
static GDALExtendedDataType CreateString(size_t nMaxStringLength=0, GDALExtendedDataTypeSubType eSubType=GEDTST_NONE)
Return a new GDALExtendedDataType of class GEDTC_STRING.
Definition: gdalmultidim.cpp:9951
GDALDataType GetNumericDataType() const
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC)
Definition: gdal_priv.h:2583
GDALExtendedDataTypeClass GetClass() const
Return type class.
Definition: gdal_priv.h:2573
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:2604
const std::string & GetName() const
Return type name.
Definition: gdal_priv.h:2564
Class modeling a named container of GDALAttribute, GDALMDArray, OGRLayer or other GDALGroup.
Definition: gdal_priv.h:2764
const std::string & GetName() const
Return the name of the group.
Definition: gdal_priv.h:2815
const std::string & GetFullName() const
Return the full name of the group.
Definition: gdal_priv.h:2824
Interface used to get a single GDALAttribute or a set of GDALAttribute.
Definition: gdal_priv.h:2723
Class modeling a multi-dimensional array.
Definition: gdal_priv.h:3278
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:3449
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:296
int bStatOK
Whether stat()'ing the file was successful.
Definition: gdal_priv.h:317
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:327
int bIsDirectory
Whether the file is a directory.
Definition: gdal_priv.h:319
char ** papszOpenOptions
Open options.
Definition: gdal_priv.h:309
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:312
int nOpenFlags
Open flags.
Definition: gdal_priv.h:314
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:322
char * pszFilename
Filename.
Definition: gdal_priv.h:307
int nHeaderBytes
Number of bytes in pabyHeader.
Definition: gdal_priv.h:325
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:330
Proxy for a plugin driver.
Definition: gdal_priv.h:2220
const char * GetMetadataItem(const char *pszName, const char *pszDomain="") override
Fetch single metadata item.
Definition: gdaldrivermanager.cpp:1303
char ** GetMetadata(const char *pszDomain) override
Fetch metadata.
Definition: gdaldrivermanager.cpp:1260
const std::string & GetPluginFileName() const
Return the plugin file name (not a full path)
Definition: gdal_priv.h:2245
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition: gdaldrivermanager.cpp:1268
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:1462
void static GDALRasterBandH ToHandle(GDALRasterBand *poBand)
Convert a GDALRasterBand* to a GDALRasterBandH.
Definition: gdal_priv.h:1750
virtual bool IsMaskBand() const
Returns whether a band is a mask band.
Definition: gdalrasterband.cpp:7603
virtual CPLErr IRasterIO(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg *psExtraArg)
Read/write a region of image data for this band.
Definition: rasterio.cpp:207
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
CAUTION: depending on the format, older values of the updated information might still be found in the...
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Default internal implementation ... to be overridden by subclasses that support reading.
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
CAUTION: depending on the format, older values of the updated information might still be found in the...
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition: gdal_priv.h:1758
A single raster block in the block cache.
Definition: gdal_priv.h:1148
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:1245
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:1272
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:1229
GPtrDiff_t GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:1261
int GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:1237
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:1205
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:1213
int AddLock(void)
Increment the lock count.
Definition: gdal_priv.h:1187
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:1253
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:1221
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:1193
Store the raw result of an attribute value, which might contain dynamically allocated structures (lik...
Definition: gdal_priv.h:3099
size_t size() const
Return the size in bytes of the raw result.
Definition: gdal_priv.h:3135
const GByte * data() const
Return pointer to the start of data.
Definition: gdal_priv.h:3129
const GByte & operator[](size_t idx) const
Return byte at specified index.
Definition: gdal_priv.h:3123
Definition of a table relationship.
Definition: gdal_priv.h:3807
const std::string & GetName() const
Get the name of the relationship.
Definition: gdal_priv.h:3846
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:3941
void SetType(GDALRelationshipType eType)
Sets the type of the relationship.
Definition: gdal_priv.h:3993
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:3963
void SetMappingTableName(const std::string &osName)
Sets the name of the mapping table for many-to-many relationships.
Definition: gdal_priv.h:3886
static GDALRelationshipH ToHandle(GDALRelationship *poRelationship)
Convert a GDALRelationship* to a GDALRelationshipH.
Definition: gdal_priv.h:4110
const std::string & GetForwardPathLabel() const
Get the label of the forward path for the relationship.
Definition: gdal_priv.h:4013
const std::string & GetLeftTableName() const
Get the name of the left (or base/origin) table in the relationship.
Definition: gdal_priv.h:3861
const std::string & GetBackwardPathLabel() const
Get the label of the backward path for the relationship.
Definition: gdal_priv.h:4053
const std::string & GetRelatedTableType() const
Get the type string of the related table.
Definition: gdal_priv.h:4088
const std::string & GetMappingTableName() const
Get the name of the mapping table for many-to-many relationships.
Definition: gdal_priv.h:3877
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:3919
GDALRelationshipCardinality GetCardinality() const
Get the cardinality of the relationship.
Definition: gdal_priv.h:3852
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:3930
void SetForwardPathLabel(const std::string &osLabel)
Sets the label of the forward path for the relationship.
Definition: gdal_priv.h:4033
void SetBackwardPathLabel(const std::string &osLabel)
Sets the label of the backward path for the relationship.
Definition: gdal_priv.h:4073
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:3908
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:3975
static GDALRelationship * FromHandle(GDALRelationshipH hRelationship)
Convert a GDALRelationshipH to a GDALRelationship*.
Definition: gdal_priv.h:4117
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:3952
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:3835
GDALRelationshipType GetType() const
Get the type of the relationship.
Definition: gdal_priv.h:3984
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:3897
const std::string & GetRightTableName() const
Get the name of the right (or related/destination) table in the relationship.
Definition: gdal_priv.h:3868
void SetRelatedTableType(const std::string &osType)
Sets the type string of the related table.
Definition: gdal_priv.h:4103
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
C++ wrapper over the C GDAL_GCP structure.
Definition: gdal_priv.h:355
double Line() const
Returns the "line" member.
Definition: gdal_priv.h:396
double & Pixel()
Returns a reference to the "pixel" member.
Definition: gdal_priv.h:390
double X() const
Returns the "X" member.
Definition: gdal_priv.h:408
double & X()
Returns a reference to the "X" member.
Definition: gdal_priv.h:414
double Pixel() const
Returns the "pixel" member.
Definition: gdal_priv.h:384
double & Z()
Returns a reference to the "Z" member.
Definition: gdal_priv.h:438
double Y() const
Returns the "Y" member.
Definition: gdal_priv.h:420
const GDAL_GCP * c_ptr() const
Casts as a C GDAL_GCP pointer.
Definition: gdal_priv.h:444
double & Y()
Returns a reference to the "Y" member.
Definition: gdal_priv.h:426
const char * Id() const
Returns the "id" member.
Definition: gdal_priv.h:368
const char * Info() const
Returns the "info" member.
Definition: gdal_priv.h:376
double Z() const
Returns the "Z" member.
Definition: gdal_priv.h:432
double & Line()
Returns a reference to the "line" member.
Definition: gdal_priv.h:402
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:1183
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:1307
GDALRATTableType
RAT table type (thematic or athematic)
Definition: gdal.h:1917
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:2003
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:143
CPLErr GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:4086
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:3540
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:2019
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:1137
constexpr GDALSuggestedBlockAccessPattern GSBAP_UNKNOWN
Unknown, or no particular read order is suggested.
Definition: gdal_priv.h:1444
int GDALSuggestedBlockAccessPattern
Suggested/most efficient access pattern to blocks.
Definition: gdal_priv.h:1441
constexpr GDALSuggestedBlockAccessPattern GSBAP_RANDOM
Random access to blocks is efficient.
Definition: gdal_priv.h:1447
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:1433
@ GMVR_0_AND_1_ONLY
Definition: gdal_priv.h:1436
@ GMVR_0_AND_255_ONLY
Definition: gdal_priv.h:1437
constexpr GDALSuggestedBlockAccessPattern GSBAP_TOP_TO_BOTTOM
Reading by strips from top to bottom is the most efficient.
Definition: gdal_priv.h:1450
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1917
@ GDAL_IDENTIFY_TRUE
Identify determined the file is recognized by the probed driver.
Definition: gdal_priv.h:1924
@ GDAL_IDENTIFY_FALSE
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1922
@ GDAL_IDENTIFY_UNKNOWN
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1920
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:1457
constexpr GDALSuggestedBlockAccessPattern GSBAP_BOTTOM_TO_TOP
Reading by strips from bottom to top is the most efficient.
Definition: gdal_priv.h:1453
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:422
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:430
Document node structure.
Definition: cpl_minixml.h:71
Color tuple.
Definition: gdal.h:1844
Object returned by GetFeatures() iterators.
Definition: gdal_priv.h:863
The GDALSubdatasetInfo abstract class provides methods to extract and manipulate subdataset informati...
Definition: gdalsubdatasetinfo.h:43
Ground Control Point.
Definition: gdal.h:1077
Virtual file handle.
Definition: cpl_vsi_virtual.h:63