14#ifndef GDALMULTIDIM_H_INCLUDED
15#define GDALMULTIDIM_H_INCLUDED
20#include "gdal_geotransform.h"
67 std::unique_ptr<GDALRasterAttributeTable>);
69 Create(
const std::string &osName,
size_t nTotalSize,
70 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
129 return m_aoComponents;
149 return m_nMaxStringLength;
164 return m_poRAT.get();
169 bool NeedsFreeDynamicMemory()
const;
171 void FreeDynamicMemory(
void *pBuffer)
const;
176 static bool CopyValues(
const void *pSrc,
187 std::unique_ptr<GDALRasterAttributeTable>);
189 const std::string &osName,
size_t nTotalSize,
190 std::vector<std::unique_ptr<GDALEDTComponent>> &&components);
192 std::string m_osName{};
196 std::vector<std::unique_ptr<GDALEDTComponent>> m_aoComponents{};
198 size_t m_nMaxStringLength = 0;
199 std::unique_ptr<GDALRasterAttributeTable> m_poRAT{};
249 std::string m_osName;
266 std::shared_ptr<GDALAttribute>
272 virtual std::shared_ptr<GDALAttribute>
275 virtual std::vector<std::shared_ptr<GDALAttribute>>
278 virtual std::shared_ptr<GDALAttribute>
280 const std::vector<GUInt64> &anDimensions,
308 std::string m_osName{};
311 std::string m_osFullName{};
315 const std::string m_osContext{};
318 std::vector<std::shared_ptr<GDALExtendedDataType>> m_apoTypes{};
321 std::weak_ptr<GDALGroup> m_pSelf{};
324 bool m_bValid =
true;
326 GDALGroup(
const std::string &osParentName,
const std::string &osName,
327 const std::string &osContext = std::string());
330 GetInnerMostGroup(
const std::string &osPathOrArrayOrDim,
331 std::shared_ptr<GDALGroup> &curGroupHolder,
332 std::string &osLastPart)
const;
334 void BaseRename(
const std::string &osNewName);
336 bool CheckValidAndErrorOutIfNot()
const;
338 void SetSelf(
const std::shared_ptr<GDALGroup> &self)
343 virtual void NotifyChildrenOfRenaming()
347 virtual void NotifyChildrenOfDeletion()
380 const std::vector<std::shared_ptr<GDALExtendedDataType>> &
386 virtual std::vector<std::string>
387 GetMDArrayNames(
CSLConstList papszOptions =
nullptr)
const;
388 virtual std::shared_ptr<GDALMDArray>
389 OpenMDArray(
const std::string &osName,
392 std::vector<std::string> GetMDArrayFullNamesRecursive(
396 virtual std::vector<std::string>
397 GetGroupNames(
CSLConstList papszOptions =
nullptr)
const;
398 virtual std::shared_ptr<GDALGroup>
399 OpenGroup(
const std::string &osName,
402 virtual std::vector<std::string>
403 GetVectorLayerNames(
CSLConstList papszOptions =
nullptr)
const;
405 OpenVectorLayer(
const std::string &osName,
408 virtual std::vector<std::shared_ptr<GDALDimension>>
409 GetDimensions(
CSLConstList papszOptions =
nullptr)
const;
411 virtual std::shared_ptr<GDALGroup>
412 CreateGroup(
const std::string &osName,
CSLConstList papszOptions =
nullptr);
414 virtual bool DeleteGroup(
const std::string &osName,
417 virtual std::shared_ptr<GDALDimension>
418 CreateDimension(
const std::string &osName,
const std::string &osType,
419 const std::string &osDirection,
GUInt64 nSize,
422 virtual std::shared_ptr<GDALMDArray> CreateMDArray(
423 const std::string &osName,
424 const std::vector<std::shared_ptr<GDALDimension>> &aoDimensions,
428 virtual bool DeleteMDArray(
const std::string &osName,
431 GUInt64 GetTotalCopyCost()
const;
433 virtual bool CopyFrom(
const std::shared_ptr<GDALGroup> &poDstRootGroup,
435 const std::shared_ptr<GDALGroup> &poSrcGroup,
436 bool bStrict,
GUInt64 &nCurCost,
438 GDALProgressFunc pfnProgress,
void *pProgressData,
443 std::shared_ptr<GDALMDArray>
444 OpenMDArrayFromFullname(
const std::string &osFullName,
447 std::shared_ptr<GDALAttribute>
448 OpenAttributeFromFullname(
const std::string &osFullName,
451 std::shared_ptr<GDALMDArray>
452 ResolveMDArray(
const std::string &osName,
const std::string &osStartingPath,
455 std::shared_ptr<GDALGroup>
456 OpenGroupFromFullname(
const std::string &osFullName,
459 std::shared_ptr<GDALDimension>
460 OpenDimensionFromFullname(
const std::string &osFullName)
const;
462 virtual void ClearStatistics();
464 virtual bool Rename(
const std::string &osNewName);
466 std::shared_ptr<GDALGroup>
467 SubsetDimensionFromSelection(
const std::string &osSelection)
const;
470 virtual void ParentRenamed(
const std::string &osNewParentFullName);
472 virtual void Deleted();
474 virtual void ParentDeleted();
476 const std::string &GetContext()
const
484 static constexpr GUInt64 COPY_COST = 1000;
501 std::string m_osName{};
504 std::string m_osFullName{};
505 std::weak_ptr<GDALAbstractMDArray> m_pSelf{};
508 bool m_bValid =
true;
511 const std::string &osName);
513 void SetSelf(
const std::shared_ptr<GDALAbstractMDArray> &self)
518 bool CheckValidAndErrorOutIfNot()
const;
520 bool CheckReadWriteParams(
const GUInt64 *arrayStartIdx,
const size_t *count,
525 const void *buffer_alloc_start,
526 size_t buffer_alloc_size,
527 std::vector<GInt64> &tmp_arrayStep,
528 std::vector<GPtrDiff_t> &tmp_bufferStride)
const;
531 IRead(
const GUInt64 *arrayStartIdx,
536 void *pDstBuffer)
const = 0;
539 IWrite(
const GUInt64 *arrayStartIdx,
545 void BaseRename(
const std::string &osNewName);
547 virtual void NotifyChildrenOfRenaming()
551 virtual void NotifyChildrenOfDeletion()
580 GUInt64 GetTotalElementsCount()
const;
582 virtual size_t GetDimensionCount()
const;
584 virtual const std::vector<std::shared_ptr<GDALDimension>> &
591 virtual std::vector<size_t>
612 const GUInt64 *chunkArrayStartIdx,
613 const size_t *chunkCount,
620 const GUInt64 *count,
const size_t *chunkSize,
630 const void *pDstBufferAllocStart =
nullptr,
631 size_t nDstBufferAllocSize = 0)
const;
639 const void *pSrcBufferAllocStart =
nullptr,
640 size_t nSrcBufferAllocSize = 0);
642 virtual bool Rename(
const std::string &osNewName);
645 virtual void Deleted();
647 virtual void ParentDeleted();
649 virtual void ParentRenamed(
const std::string &osNewParentFullName);
663class CPL_DLL GDALRawResult
673 GDALRawResult(
const GDALRawResult &) =
delete;
674 GDALRawResult &operator=(
const GDALRawResult &) =
delete;
677 friend class GDALAttribute;
684 GDALRawResult(GDALRawResult &&);
685 GDALRawResult &operator=(GDALRawResult &&);
730 mutable std::string m_osCachedVal{};
734 GDALAttribute(
const std::string &osParentName,
const std::string &osName);
755 bool Write(
const void *pabyValue,
size_t nLen);
756 bool Write(
const char *);
761 bool Write(
const int *,
size_t);
762 bool Write(
const int64_t *,
size_t);
763 bool Write(
const double *,
size_t);
766 static constexpr GUInt64 COPY_COST = 100;
775class CPL_DLL GDALAttributeString final :
public GDALAttribute
777 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
779 std::string m_osValue;
783 const GPtrDiff_t *,
const GDALExtendedDataType &bufferDataType,
784 void *pDstBuffer)
const override;
787 GDALAttributeString(
const std::string &osParentName,
788 const std::string &osName,
const std::string &osValue,
791 const std::vector<std::shared_ptr<GDALDimension>> &
792 GetDimensions()
const override;
794 const GDALExtendedDataType &GetDataType()
const override;
804class CPL_DLL GDALAttributeNumeric final :
public GDALAttribute
806 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
807 GDALExtendedDataType m_dt;
809 double m_dfValue = 0;
810 std::vector<GUInt32> m_anValuesUInt32{};
814 const GPtrDiff_t *,
const GDALExtendedDataType &bufferDataType,
815 void *pDstBuffer)
const override;
818 GDALAttributeNumeric(
const std::string &osParentName,
819 const std::string &osName,
double dfValue);
820 GDALAttributeNumeric(
const std::string &osParentName,
821 const std::string &osName,
int nValue);
822 GDALAttributeNumeric(
const std::string &osParentName,
823 const std::string &osName,
824 const std::vector<GUInt32> &anValues);
826 const std::vector<std::shared_ptr<GDALDimension>> &
827 GetDimensions()
const override;
829 const GDALExtendedDataType &GetDataType()
const override;
853 friend class GDALMDArrayResampled;
854 std::shared_ptr<GDALMDArray>
855 GetView(
const std::vector<GUInt64> &indices)
const;
857 inline std::shared_ptr<GDALMDArray>
858 atInternal(
const std::vector<GUInt64> &indices)
const
860 return GetView(indices);
863 template <
typename... GUInt64VarArg>
865 inline std::shared_ptr<GDALMDArray>
866 atInternal(std::vector<GUInt64> &indices,
GUInt64 idx,
867 GUInt64VarArg... tail)
const
869 indices.push_back(idx);
870 return atInternal(indices, tail...);
875 const std::string m_osContext{};
877 mutable bool m_bHasTriedCachedArray =
false;
878 mutable std::shared_ptr<GDALMDArray> m_poCachedArray{};
882 GDALMDArray(
const std::string &osParentName,
const std::string &osName,
883 const std::string &osContext = std::string());
885 virtual bool IAdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
888 virtual bool IsCacheable()
const
893 virtual bool SetStatistics(
bool bApproxStats,
double dfMin,
double dfMax,
894 double dfMean,
double dfStdDev,
897 static std::string MassageName(
const std::string &inputName);
899 std::shared_ptr<GDALGroup>
900 GetCacheRootGroup(
bool bCanCreate, std::string &osCacheFilenameOut)
const;
903 bool IsTransposedRequest(
const size_t *count,
907 bool ReadForTransposedRequest(
const GUInt64 *arrayStartIdx,
908 const size_t *count,
const GInt64 *arrayStep,
911 void *pDstBuffer)
const;
913 bool IsStepOneContiguousRowMajorOrderedSameDataType(
914 const size_t *count,
const GInt64 *arrayStep,
920 bool ReadUsingContiguousIRead(
const GUInt64 *arrayStartIdx,
921 const size_t *count,
const GInt64 *arrayStep,
924 void *pDstBuffer)
const;
926 static std::shared_ptr<GDALMDArray> CreateGLTOrthorectified(
927 const std::shared_ptr<GDALMDArray> &poParent,
928 const std::shared_ptr<GDALGroup> &poRootGroup,
929 const std::shared_ptr<GDALMDArray> &poGLTX,
930 const std::shared_ptr<GDALMDArray> &poGLTY,
int nGLTIndexOffset,
931 const std::vector<double> &adfGeoTransform,
CSLConstList papszOptions);
939 bool bStrict,
GUInt64 &nCurCost,
941 GDALProgressFunc pfnProgress,
void *pProgressData);
958 virtual const std::string &
GetUnit()
const;
960 virtual bool SetUnit(
const std::string &osUnit);
964 virtual std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const;
984 bool SetNoDataValue(
double dfNoData);
986 bool SetNoDataValue(int64_t nNoData);
988 bool SetNoDataValue(uint64_t nNoData);
990 virtual bool Resize(
const std::vector<GUInt64> &anNewDimSizes,
993 virtual double GetOffset(
bool *pbHasOffset =
nullptr,
996 virtual double GetScale(
bool *pbHasScale =
nullptr,
999 virtual bool SetOffset(
double dfOffset,
1002 virtual bool SetScale(
double dfScale,
1005 std::shared_ptr<GDALMDArray> GetView(
const std::string &viewExpr)
const;
1007 std::shared_ptr<GDALMDArray> operator[](
const std::string &fieldName)
const;
1020 template <
typename... GUInt64VarArg>
1023 std::shared_ptr<GDALMDArray>
at(
GUInt64 idx, GUInt64VarArg... tail)
const
1025 std::vector<GUInt64> indices;
1026 indices.push_back(idx);
1027 return atInternal(indices, tail...);
1030 virtual std::shared_ptr<GDALMDArray>
1031 Transpose(
const std::vector<int> &anMapNewAxisToOldAxis)
const;
1033 std::shared_ptr<GDALMDArray> GetUnscaled(
1034 double dfOverriddenScale = std::numeric_limits<double>::quiet_NaN(),
1035 double dfOverriddenOffset = std::numeric_limits<double>::quiet_NaN(),
1036 double dfOverriddenDstNodata =
1037 std::numeric_limits<double>::quiet_NaN())
const;
1039 virtual std::shared_ptr<GDALMDArray>
1042 virtual std::shared_ptr<GDALMDArray>
1043 GetResampled(
const std::vector<std::shared_ptr<GDALDimension>> &apoNewDims,
1048 std::shared_ptr<GDALMDArray>
1049 GetGridded(
const std::string &osGridOptions,
1050 const std::shared_ptr<GDALMDArray> &poXArray =
nullptr,
1051 const std::shared_ptr<GDALMDArray> &poYArray =
nullptr,
1054 static std::vector<std::shared_ptr<GDALMDArray>>
1055 GetMeshGrid(
const std::vector<std::shared_ptr<GDALMDArray>> &apoArrays,
1059 AsClassicDataset(
size_t iXDim,
size_t iYDim,
1060 const std::shared_ptr<GDALGroup> &poRootGroup =
nullptr,
1063 virtual CPLErr GetStatistics(
bool bApproxOK,
bool bForce,
double *pdfMin,
1064 double *pdfMax,
double *pdfMean,
1065 double *padfStdDev,
GUInt64 *pnValidCount,
1066 GDALProgressFunc pfnProgress,
1067 void *pProgressData);
1069 virtual bool ComputeStatistics(
bool bApproxOK,
double *pdfMin,
1070 double *pdfMax,
double *pdfMean,
1071 double *pdfStdDev,
GUInt64 *pnValidCount,
1072 GDALProgressFunc,
void *pProgressData,
1075 virtual void ClearStatistics();
1077 virtual std::vector<std::shared_ptr<GDALMDArray>>
1078 GetCoordinateVariables()
const;
1080 bool AdviseRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
1083 bool IsRegularlySpaced(
double &dfStart,
double &dfIncrement)
const;
1085 bool GuessGeoTransform(
size_t nDimX,
size_t nDimY,
bool bPixelIsPoint,
1088 bool GuessGeoTransform(
size_t nDimX,
size_t nDimY,
bool bPixelIsPoint,
1089 double adfGeoTransform[6])
const;
1094 Read(
const GUInt64 *arrayStartIdx,
1095 const size_t *count,
1099 const void *pDstBufferAllocStart =
nullptr,
1100 size_t nDstBufferAllocSize = 0) const override final;
1102 virtual std::shared_ptr<
GDALGroup> GetRootGroup() const;
1104 virtual
bool GetRawBlockInfo(const uint64_t *panBlockCoordinates,
1108 static constexpr
GUInt64 COPY_COST = 1000;
1110 bool CopyFromAllExceptValues(const
GDALMDArray *poSrcArray,
bool bStrict,
1112 GDALProgressFunc pfnProgress,
1113 void *pProgressData);
1121 : m_nStartIdx(nStartIdx), m_nIncr(nIncr)
1128 std::string m_osFieldName{};
1133 m_mapDimIdxToParentDimIdx{};
1138 virtual std::shared_ptr<GDALMDArray>
1139 GetView(
const std::string &viewExpr,
bool bRenameDimensions,
1140 std::vector<ViewSpec> &viewSpecs)
const;
1142 const std::string &GetContext()
const
1152 size_t iDimX,
size_t iDimY,
1153 const GUInt64 *arrayStartIdx,
const size_t *count,
1166class CPL_DLL GDALMDArrayRegularlySpaced final :
public GDALMDArray
1168 double m_dfStart = 0;
1169 double m_dfIncrement = 0;
1170 double m_dfOffsetInIncrement = 0;
1172 const std::vector<std::shared_ptr<GDALDimension>> m_dims;
1173 std::vector<std::shared_ptr<GDALAttribute>> m_attributes{};
1174 const std::string m_osEmptyFilename{};
1178 const GPtrDiff_t *,
const GDALExtendedDataType &bufferDataType,
1179 void *pDstBuffer)
const override;
1182 GDALMDArrayRegularlySpaced(
const std::string &osParentName,
1183 const std::string &osName,
1184 const std::shared_ptr<GDALDimension> &poDim,
1185 double dfStart,
double dfIncrement,
1186 double dfOffsetInIncrement);
1188 static std::shared_ptr<GDALMDArrayRegularlySpaced>
1189 Create(
const std::string &osParentName,
const std::string &osName,
1190 const std::shared_ptr<GDALDimension> &poDim,
double dfStart,
1191 double dfIncrement,
double dfOffsetInIncrement);
1193 bool IsWritable()
const override
1198 const std::string &GetFilename()
const override
1200 return m_osEmptyFilename;
1203 const std::vector<std::shared_ptr<GDALDimension>> &
1204 GetDimensions()
const override;
1206 const GDALExtendedDataType &GetDataType()
const override;
1208 std::vector<std::shared_ptr<GDALAttribute>>
1211 void AddAttribute(
const std::shared_ptr<GDALAttribute> &poAttr);
1235 GDALDimension(
const std::string &osParentName,
const std::string &osName,
1236 const std::string &osType,
const std::string &osDirection,
1257 return m_osFullName;
1283 return m_osDirection;
1295 virtual std::shared_ptr<GDALMDArray> GetIndexingVariable()
const;
1298 SetIndexingVariable(std::shared_ptr<GDALMDArray> poIndexingVariable);
1300 virtual bool Rename(
const std::string &osNewName);
1303 virtual void ParentRenamed(
const std::string &osNewParentFullName);
1305 virtual void ParentDeleted();
1310 std::string m_osName;
1311 std::string m_osFullName;
1312 std::string m_osType;
1313 std::string m_osDirection;
1316 void BaseRename(
const std::string &osNewName);
1326class CPL_DLL GDALDimensionWeakIndexingVar :
public GDALDimension
1328 std::weak_ptr<GDALMDArray> m_poIndexingVariable{};
1331 GDALDimensionWeakIndexingVar(
const std::string &osParentName,
1332 const std::string &osName,
1333 const std::string &osType,
1334 const std::string &osDirection,
GUInt64 nSize);
1336 std::shared_ptr<GDALMDArray> GetIndexingVariable()
const override;
1338 bool SetIndexingVariable(
1339 std::shared_ptr<GDALMDArray> poIndexingVariable)
override;
1341 void SetSize(
GUInt64 nNewSize);
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:454
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition gdal_multidim.h:498
const std::string & GetFullName() const
Return the name of an array or attribute.
Definition gdal_multidim.h:575
virtual const std::vector< std::shared_ptr< GDALDimension > > & GetDimensions() const =0
Return the dimensions of an attribute/array.
virtual bool Rename(const std::string &osNewName)
Rename the attribute/array.
Definition gdalmultidim.cpp:1706
virtual std::vector< GUInt64 > GetBlockSize() const
Return the "natural" block size of the array along all dimensions.
Definition gdalmultidim.cpp:2431
virtual std::vector< size_t > GetProcessingChunkSize(size_t nMaxChunkMemory) const
Return an optimal chunk size for read/write operations, given the natural block size and memory const...
Definition gdalmultidim.cpp:2456
virtual bool ProcessPerChunk(const GUInt64 *arrayStartIdx, const GUInt64 *count, const size_t *chunkSize, FuncProcessPerChunkType pfnFunc, void *pUserData)
Call a user-provided function to operate on an array chunk by chunk.
Definition gdalmultidim.cpp:3107
bool(* FuncProcessPerChunkType)(GDALAbstractMDArray *array, const GUInt64 *chunkArrayStartIdx, const size_t *chunkCount, GUInt64 iCurChunk, GUInt64 nChunkCount, void *pUserData)
Type of pfnFunc argument of ProcessPerChunk().
Definition gdal_multidim.h:610
virtual bool Read(const GUInt64 *arrayStartIdx, const size_t *count, const GInt64 *arrayStep, const GPtrDiff_t *bufferStride, const GDALExtendedDataType &bufferDataType, void *pDstBuffer, const void *pDstBufferAllocStart=nullptr, size_t nDstBufferAllocSize=0) const
Read part or totality of a multidimensional array or attribute.
Definition gdalmultidim.cpp:2240
const std::string & GetName() const
Return the name of an array or attribute.
Definition gdal_multidim.h:565
virtual const GDALExtendedDataType & GetDataType() const =0
Return the data type of an attribute/array.
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:2344
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition gdal_multidim.h:729
CPLStringList ReadAsStringArray() const
Return the value of an attribute as an array of strings.
Definition gdalmultidim.cpp:3516
bool WriteInt64(int64_t)
Write an attribute from an int64_t value.
Definition gdalmultidim.cpp:3731
int ReadAsInt() const
Return the value of an attribute as a integer.
Definition gdalmultidim.cpp:3446
std::vector< int64_t > ReadAsInt64Array() const
Return the value of an attribute as an array of int64_t.
Definition gdalmultidim.cpp:3580
double ReadAsDouble() const
Return the value of an attribute as a double.
Definition gdalmultidim.cpp:3496
std::vector< int > ReadAsIntArray() const
Return the value of an attribute as an array of integers.
Definition gdalmultidim.cpp:3550
int64_t ReadAsInt64() const
Return the value of an attribute as an int64_t.
Definition gdalmultidim.cpp:3471
std::vector< GUInt64 > GetDimensionsSize() const
Return the size of the dimensions of the attribute.
Definition gdalmultidim.cpp:3259
std::vector< double > ReadAsDoubleArray() const
Return the value of an attribute as an array of double.
Definition gdalmultidim.cpp:3610
bool Write(const void *pabyValue, size_t nLen)
Write an attribute from raw values expressed in GetDataType().
Definition gdalmultidim.cpp:3649
GDALRawResult ReadAsRaw() const
Return the raw value of an attribute.
Definition gdalmultidim.cpp:3372
const char * ReadAsString() const
Return the value of an attribute as a string.
Definition gdalmultidim.cpp:3414
bool WriteInt(int)
Write an attribute from a integer value.
Definition gdalmultidim.cpp:3707
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:76
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition gdal_multidim.h:1232
const std::string & GetName() const
Return the name.
Definition gdal_multidim.h:1246
const std::string & GetDirection() const
Return the axis direction.
Definition gdal_multidim.h:1281
const std::string & GetFullName() const
Return the full name.
Definition gdal_multidim.h:1255
GUInt64 GetSize() const
Return the size, that is the number of values along the dimension.
Definition gdal_multidim.h:1290
const std::string & GetType() const
Return the axis type.
Definition gdal_multidim.h:1268
Class for a component of a compound extended data type.
Definition gdal_multidim.h:212
const GDALExtendedDataType & GetType() const
Return the data type of the component.
Definition gdal_multidim.h:243
size_t GetOffset() const
Return the offset (in bytes) of the component in the compound data type.
Definition gdal_multidim.h:234
bool operator==(const GDALEDTComponent &) const
Equality operator.
Definition gdalmultidim.cpp:10971
GDALEDTComponent(const std::string &name, size_t offset, const GDALExtendedDataType &type)
constructor of a GDALEDTComponent
Definition gdalmultidim.cpp:10952
const std::string & GetName() const
Return the name.
Definition gdal_multidim.h:225
GDALEDTComponent(const GDALEDTComponent &)
Copy constructor.
Class used to represent potentially complex data types.
Definition gdal_multidim.h:54
bool operator!=(const GDALExtendedDataType &other) const
Non-equality operator.
Definition gdal_multidim.h:78
GDALExtendedDataTypeSubType GetSubType() const
Return subtype.
Definition gdal_multidim.h:117
size_t GetSize() const
Return data type size in bytes.
Definition gdal_multidim.h:138
GDALExtendedDataType & operator=(GDALExtendedDataType &&)
Move assignment.
size_t GetMaxStringLength() const
Return the maximum length of a string in bytes.
Definition gdal_multidim.h:147
GDALExtendedDataType & operator=(const GDALExtendedDataType &)
Copy assignment.
Definition gdalmultidim.cpp:10643
const GDALRasterAttributeTable * GetRAT() const
Return associated raster attribute table, when there is one.
Definition gdal_multidim.h:162
static GDALExtendedDataType Create(GDALDataType eType)
Return a new GDALExtendedDataType of class GEDTC_NUMERIC.
Definition gdalmultidim.cpp:10685
static GDALExtendedDataType CreateString(size_t nMaxStringLength=0, GDALExtendedDataTypeSubType eSubType=GEDTST_NONE)
Return a new GDALExtendedDataType of class GEDTC_STRING.
Definition gdalmultidim.cpp:10768
GDALDataType GetNumericDataType() const
Return numeric data type (only valid when GetClass() == GEDTC_NUMERIC).
Definition gdal_multidim.h:106
GDALExtendedDataType(GDALExtendedDataType &&)
Move constructor.
GDALExtendedDataTypeClass GetClass() const
Return type class.
Definition gdal_multidim.h:96
const std::vector< std::unique_ptr< GDALEDTComponent > > & GetComponents() const
Return the components of the data type (only valid when GetClass() == GEDTC_COMPOUND).
Definition gdal_multidim.h:127
bool operator==(const GDALExtendedDataType &) const
Equality operator.
Definition gdalmultidim.cpp:10782
const std::string & GetName() const
Return type name.
Definition gdal_multidim.h:87
Class modeling a named container of GDALAttribute, GDALMDArray, OGRLayer or other GDALGroup.
Definition gdal_multidim.h:305
const std::string & GetName() const
Return the name of the group.
Definition gdal_multidim.h:360
const std::vector< std::shared_ptr< GDALExtendedDataType > > & GetDataTypes() const
Return data types associated with the group (typically enumerations).
Definition gdal_multidim.h:381
const std::string & GetFullName() const
Return the full name of the group.
Definition gdal_multidim.h:369
Interface used to get a single GDALAttribute or a set of GDALAttribute.
Definition gdal_multidim.h:264
virtual std::shared_ptr< GDALAttribute > CreateAttribute(const std::string &osName, const std::vector< GUInt64 > &anDimensions, const GDALExtendedDataType &oDataType, CSLConstList papszOptions=nullptr)
Create an attribute within a GDALMDArray or GDALGroup.
Definition gdalmultidim.cpp:289
virtual std::shared_ptr< GDALAttribute > GetAttribute(const std::string &osName) const
Return an attribute by its name.
Definition gdalmultidim.cpp:213
virtual std::vector< std::shared_ptr< GDALAttribute > > GetAttributes(CSLConstList papszOptions=nullptr) const
Return the list of attributes contained in a GDALMDArray or GDALGroup.
Definition gdalmultidim.cpp:258
virtual bool DeleteAttribute(const std::string &osName, CSLConstList papszOptions=nullptr)
Delete an attribute from a GDALMDArray or GDALGroup.
Definition gdalmultidim.cpp:323
std::shared_ptr< GDALAttribute > GetAttributeFromAttributes(const std::string &osName) const
Possible fallback implementation for GetAttribute() using GetAttributes().
Definition gdalmultidim.cpp:225
Class modeling a multi-dimensional array.
Definition gdal_multidim.h:852
virtual bool SetUnit(const std::string &osUnit)
Set the variable unit.
Definition gdalmultidim.cpp:2638
bool SetNoDataValue(double dfNoData)
Set the nodata value as a double.
Definition gdalmultidim.cpp:2850
virtual bool CopyFrom(GDALDataset *poSrcDS, const GDALMDArray *poSrcArray, bool bStrict, GUInt64 &nCurCost, const GUInt64 nTotalCost, GDALProgressFunc pfnProgress, void *pProgressData)
Copy the content of an array into a new (generally empty) array.
Definition gdalmultidim.cpp:4041
GUInt64 GetTotalCopyCost() const
Return a total "cost" to copy the array.
Definition gdalmultidim.cpp:3927
virtual bool IsWritable() const =0
Return whether an array is writable.
virtual bool SetRawNoDataValue(const void *pRawNoData)
Set the nodata value as a "raw" value.
Definition gdalmultidim.cpp:2830
virtual const void * GetRawNoDataValue() const
Return the nodata value as a "raw" value.
Definition gdalmultidim.cpp:2714
virtual std::shared_ptr< OGRSpatialReference > GetSpatialRef() const
Return the spatial reference system object associated with the array.
Definition gdalmultidim.cpp:2688
virtual const std::string & GetFilename() const =0
Return the filename that contains that array.
int64_t GetNoDataValueAsInt64(bool *pbHasNoData=nullptr) const
Return the nodata value as a Int64.
Definition gdalmultidim.cpp:2765
virtual bool SetSpatialRef(const OGRSpatialReference *poSRS)
Assign a spatial reference system object to the array.
Definition gdalmultidim.cpp:2674
virtual CSLConstList GetStructuralInfo() const
Return structural information on the array.
Definition gdalmultidim.cpp:4208
double GetNoDataValueAsDouble(bool *pbHasNoData=nullptr) const
Return the nodata value as a double.
Definition gdalmultidim.cpp:2734
std::shared_ptr< GDALMDArray > at(GUInt64 idx, GUInt64VarArg... tail) const
Return a view of the array using integer indexing.
Definition gdal_multidim.h:1023
uint64_t GetNoDataValueAsUInt64(bool *pbHasNoData=nullptr) const
Return the nodata value as a UInt64.
Definition gdalmultidim.cpp:2796
virtual const std::string & GetUnit() const
Return the array unit.
Definition gdalmultidim.cpp:2660
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_rasterband.h:105
Store the raw result of an attribute value, which might contain dynamically allocated structures (lik...
Definition gdal_multidim.h:664
size_t size() const
Return the size in bytes of the raw result.
Definition gdal_multidim.h:700
const GByte * data() const
Return pointer to the start of data.
Definition gdal_multidim.h:694
const GByte & operator[](size_t idx) const
Return byte at specified index.
Definition gdal_multidim.h:688
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:61
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
Various convenience functions for CPL.
CPLErr
Error category.
Definition cpl_error.h:37
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition cpl_port.h:246
GIntBig GInt64
Signed 64 bit integer type.
Definition cpl_port.h:226
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition cpl_port.h:228
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Various convenience functions for working with strings and string lists.
Public (C callable) GDAL entry points.
GDALDataType
Definition gdal.h:48
@ GDT_Float64
Definition gdal.h:60
@ GDT_Unknown
Definition gdal.h:49
GDALExtendedDataTypeClass
Enumeration giving the class of a GDALExtendedDataType.
Definition gdal.h:392
@ GEDTC_NUMERIC
Numeric value.
Definition gdal.h:394
GDALRIOResampleAlg
RasterIO() resampling method.
Definition gdal.h:135
GDALExtendedDataTypeSubType
Enumeration giving the subtype of a GDALExtendedDataType.
Definition gdal.h:405
@ GEDTST_NONE
None.
Definition gdal.h:407
GDALRWFlag
Definition gdal.h:125
Information on a raw block of a GDALMDArray.
Definition gdal.h:2828