31#ifndef VIRTUALDATASET_H_INCLUDED
32#define VIRTUALDATASET_H_INCLUDED
51CPLErr GDALRegisterDefaultPixelFunc();
55int VRTWarpedOverviewTransform(
void *pTransformArg,
int bDstToSrc,
57 double *padfX,
double *padfY,
double *padfZ,
59void* VRTDeserializeWarpedOverviewTransformer(
CPLXMLNode *psTree );
73 int bTriedToOpen = FALSE;
75 VRTOverviewInfo() =
default;
76 VRTOverviewInfo(VRTOverviewInfo &&oOther) noexcept
77 : osFilename(std::move(oOther.osFilename)), nBand(oOther.nBand),
78 poBand(oOther.poBand), bTriedToOpen(oOther.bTriedToOpen)
80 oOther.poBand =
nullptr;
90 if (poBand ==
nullptr)
109class CPL_DLL VRTSource
112 virtual ~VRTSource();
115 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
120 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess) = 0;
121 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess) = 0;
122 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
double dfMin,
123 double dfMax,
int nBuckets,
124 GUIntBig *panHistogram,
int bIncludeOutOfRange,
125 int bApproxOK, GDALProgressFunc pfnProgress,
126 void *pProgressData) = 0;
129 std::map<CPLString, GDALDataset *> &) = 0;
130 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath) = 0;
132 virtual void GetFileList(
char ***ppapszFileList,
int *pnSize,
135 virtual int IsSimpleSource()
139 virtual CPLErr FlushCache(
bool )
145typedef VRTSource *(*VRTSourceParser)(
147 std::map<CPLString, GDALDataset *> &oMapSharedSources);
150VRTParseCoreSources(
CPLXMLNode *psTree,
const char *,
151 std::map<CPLString, GDALDataset *> &oMapSharedSources);
153VRTParseFilterSources(
CPLXMLNode *psTree,
const char *,
154 std::map<CPLString, GDALDataset *> &oMapSharedSources);
162template <
class T>
struct VRTFlushCacheStruct
164 static void FlushCache(T &obj,
bool bAtClosing);
167class VRTWarpedDataset;
168class VRTPansharpenedDataset;
173 friend class VRTRasterBand;
174 friend struct VRTFlushCacheStruct<VRTDataset>;
175 friend struct VRTFlushCacheStruct<VRTWarpedDataset>;
176 friend struct VRTFlushCacheStruct<VRTPansharpenedDataset>;
177 friend class VRTSourcedRasterBand;
182 int m_bGeoTransformSet =
false;
183 double m_adfGeoTransform[6];
189 bool m_bNeedsFlush =
false;
190 bool m_bWritable =
true;
191 bool m_bCanTakeRef =
true;
193 char *m_pszVRTPath =
nullptr;
195 VRTRasterBand *m_poMaskBand =
nullptr;
197 int m_bCompatibleForDatasetIO = -1;
198 int CheckCompatibleForDatasetIO();
202 std::vector<GDALDataset *> m_apoOverviews{};
203 std::vector<GDALDataset *> m_apoOverviewsBak{};
205 std::vector<int> m_anOverviewFactors{};
207 char **m_papszXMLVRTMetadata =
nullptr;
209 std::map<CPLString, GDALDataset *> m_oMapSharedSources{};
210 std::shared_ptr<VRTGroup> m_poRootGroup{};
212 VRTRasterBand *InitBand(
const char *pszSubclass,
int nBand,
213 bool bAllowPansharpened);
214 static GDALDataset *OpenVRTProtocol(
const char *pszSpec);
215 bool AddVirtualOverview(
int nOvFactor,
const char *pszResampling);
220 virtual int CloseDependentDatasets()
override;
223 VRTDataset(
int nXSize,
int nYSize);
224 virtual ~VRTDataset();
228 m_bNeedsFlush =
true;
230 virtual void FlushCache(
bool bAtClosing)
override;
232 void SetWritable(
int bWritableIn)
234 m_bWritable = CPL_TO_BOOL(bWritableIn);
237 virtual CPLErr CreateMaskBand(
int nFlags)
override;
238 void SetMaskBand(VRTRasterBand *poMaskBand);
246 virtual CPLErr GetGeoTransform(
double *)
override;
247 virtual CPLErr SetGeoTransform(
double *)
override;
249 virtual CPLErr SetMetadata(
char **papszMetadata,
250 const char *pszDomain =
"")
override;
251 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
252 const char *pszDomain =
"")
override;
254 virtual char **GetMetadata(
const char *pszDomain =
"")
override;
256 virtual int GetGCPCount()
override;
261 virtual const GDAL_GCP *GetGCPs()
override;
267 char **papszOptions =
nullptr)
override;
269 virtual char **GetFileList()
override;
272 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
274 int nBandCount,
int *panBandMap,
279 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
281 int nBandCount,
int *panBandList,
282 char **papszOptions)
override;
284 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath);
287 virtual CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
288 const int *, GDALProgressFunc,
void *,
291 std::shared_ptr<GDALGroup> GetRootGroup()
const override;
295 void BuildVirtualOverviews();
297 void UnsetPreservedRelativeFilenames();
301 static GDALDataset *OpenXML(
const char *,
const char * =
nullptr,
303 static GDALDataset *Create(
const char *pszName,
int nXSize,
int nYSize,
305 char **papszOptions);
307 CreateMultiDimensional(
const char *pszFilename,
310 static CPLErr Delete(
const char *pszFilename);
318class VRTWarpedRasterBand;
320class CPL_DLL VRTWarpedDataset final :
public VRTDataset
326 int m_nOverviewCount;
327 VRTWarpedDataset **m_papoOverviews;
330 void CreateImplicitOverviews();
332 friend class VRTWarpedRasterBand;
337 virtual int CloseDependentDatasets()
override;
340 VRTWarpedDataset(
int nXSize,
int nYSize);
341 virtual ~VRTWarpedDataset();
343 virtual void FlushCache(
bool bAtClosing)
override;
345 CPLErr Initialize(
void *);
347 virtual CPLErr IBuildOverviews(
const char *,
int,
const int *,
int,
348 const int *, GDALProgressFunc,
void *,
351 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
352 const char *pszDomain =
"")
override;
354 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
358 char **papszOptions =
nullptr)
override;
360 virtual char **GetFileList()
override;
362 CPLErr ProcessBlock(
int iBlockX,
int iBlockY);
364 void GetBlockSize(
int *,
int *)
const;
376 GTAdjust_Intersection,
378 GTAdjust_NoneWithoutWarning
381class VRTPansharpenedDataset final :
public VRTDataset
383 friend class VRTPansharpenedRasterBand;
388 VRTPansharpenedDataset *m_poMainDataset;
389 std::vector<VRTPansharpenedDataset *> m_apoOverviewDatasets{};
391 std::map<CPLString, CPLString> m_oMapToRelativeFilenames{};
393 int m_bLoadingOtherBands;
395 GByte *m_pabyLastBufferBandRasterIO;
396 int m_nLastBandRasterIOXOff;
397 int m_nLastBandRasterIOYOff;
398 int m_nLastBandRasterIOXSize;
399 int m_nLastBandRasterIOYSize;
402 GTAdjustment m_eGTAdjustment;
403 int m_bNoDataDisabled;
405 std::vector<GDALDataset *> m_apoDatasetsToClose{};
410 virtual int CloseDependentDatasets()
override;
413 VRTPansharpenedDataset(
int nXSize,
int nYSize);
414 virtual ~VRTPansharpenedDataset();
416 virtual void FlushCache(
bool bAtClosing)
override;
419 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
426 char **papszOptions =
nullptr)
override;
428 virtual char **GetFileList()
override;
431 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
433 int nBandCount,
int *panBandMap,
438 void GetBlockSize(
int *,
int *)
const;
442 return m_poPansharpener;
453constexpr double VRT_DEFAULT_NODATA_VALUE = -10000.0;
458 void ResetNoDataValues();
461 friend class VRTDataset;
463 int m_bIsMaskBand = FALSE;
465 int m_bNoDataValueSet = FALSE;
467 int m_bHideNoDataValue = FALSE;
468 double m_dfNoDataValue = VRT_DEFAULT_NODATA_VALUE;
470 bool m_bNoDataSetAsInt64 =
false;
471 int64_t m_nNoDataValueInt64 = GDAL_PAM_DEFAULT_NODATA_VALUE_INT64;
473 bool m_bNoDataSetAsUInt64 =
false;
474 uint64_t m_nNoDataValueUInt64 = GDAL_PAM_DEFAULT_NODATA_VALUE_UINT64;
476 std::unique_ptr<GDALColorTable> m_poColorTable{};
480 char *m_pszUnitType =
nullptr;
481 char **m_papszCategoryNames =
nullptr;
483 double m_dfOffset = 0.0;
484 double m_dfScale = 1.0;
488 void Initialize(
int nXSize,
int nYSize);
490 std::vector<VRTOverviewInfo> m_aoOverviewInfos{};
492 VRTRasterBand *m_poMaskBand =
nullptr;
494 std::unique_ptr<GDALRasterAttributeTable> m_poRAT{};
498 bool IsNoDataValueInDataTypeRange()
const;
502 virtual ~VRTRasterBand();
505 std::map<CPLString, GDALDataset *> &);
506 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath);
508 CPLErr SetNoDataValue(
double)
override;
509 CPLErr SetNoDataValueAsInt64(int64_t nNoData)
override;
510 CPLErr SetNoDataValueAsUInt64(uint64_t nNoData)
override;
511 double GetNoDataValue(
int *pbSuccess =
nullptr)
override;
512 int64_t GetNoDataValueAsInt64(
int *pbSuccess =
nullptr)
override;
513 uint64_t GetNoDataValueAsUInt64(
int *pbSuccess =
nullptr)
override;
514 CPLErr DeleteNoDataValue()
override;
526 virtual const char *GetUnitType()
override;
527 CPLErr SetUnitType(
const char *)
override;
529 virtual char **GetCategoryNames()
override;
530 virtual CPLErr SetCategoryNames(
char **)
override;
532 virtual CPLErr SetMetadata(
char **papszMD,
533 const char *pszDomain =
"")
override;
534 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
535 const char *pszDomain =
"")
override;
537 virtual double GetOffset(
int *pbSuccess =
nullptr)
override;
538 CPLErr SetOffset(
double)
override;
539 virtual double GetScale(
int *pbSuccess =
nullptr)
override;
540 CPLErr SetScale(
double)
override;
542 virtual int GetOverviewCount()
override;
545 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
546 GUIntBig *panHistogram,
int bIncludeOutOfRange,
547 int bApproxOK, GDALProgressFunc,
548 void *pProgressData)
override;
550 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
551 int *pnBuckets,
GUIntBig **ppanHistogram,
552 int bForce, GDALProgressFunc,
553 void *pProgressData)
override;
555 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
int nBuckets,
560 virtual void GetFileList(
char ***ppapszFileList,
int *pnSize,
563 virtual void SetDescription(
const char *)
override;
566 virtual int GetMaskFlags()
override;
568 virtual CPLErr CreateMaskBand(
int nFlagsIn)
override;
570 void SetMaskBand(VRTRasterBand *poMaskBand);
572 void SetIsMaskBand();
574 virtual bool IsMaskBand()
const override;
576 CPLErr UnsetNoDataValue();
578 virtual int CloseDependentDatasets();
580 virtual int IsSourcedRasterBand()
584 virtual int IsPansharpenRasterBand()
594class VRTSimpleSource;
596class CPL_DLL VRTSourcedRasterBand
CPL_NON_FINAL :
public VRTRasterBand
600 char **m_papszSourceList =
nullptr;
601 int m_nSkipBufferInitialization = -1;
603 bool CanUseSourcesMinMaxImplementations();
605 bool IsMosaicOfNonOverlappingSimpleSourcesOfFullRasterNoResAndTypeChange(
606 bool bAllowMaxValAdjustment)
const;
611 bool SkipBufferInitialization();
615 VRTSource **papoSources =
nullptr;
617 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand);
618 VRTSourcedRasterBand(
GDALDataType eType,
int nXSize,
int nYSize);
620 int nXSize,
int nYSize);
622 int nXSize,
int nYSize,
int nBlockXSizeIn,
624 virtual ~VRTSourcedRasterBand();
631 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
632 int nYSize,
int nMaskFlagStop,
633 double *pdfDataPct)
override;
635 virtual char **GetMetadataDomainList()
override;
636 virtual const char *GetMetadataItem(
const char *pszName,
637 const char *pszDomain =
"")
override;
638 virtual char **GetMetadata(
const char *pszDomain =
"")
override;
639 virtual CPLErr SetMetadata(
char **papszMetadata,
640 const char *pszDomain =
"")
override;
641 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
642 const char *pszDomain =
"")
override;
645 std::map<CPLString, GDALDataset *> &)
override;
646 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
648 virtual double GetMinimum(
int *pbSuccess =
nullptr)
override;
649 virtual double GetMaximum(
int *pbSuccess =
nullptr)
override;
650 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
651 double *adfMinMax)
override;
652 virtual CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
653 double *pdfMax,
double *pdfMean,
655 GDALProgressFunc pfnProgress,
656 void *pProgressData)
override;
657 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
658 GUIntBig *panHistogram,
int bIncludeOutOfRange,
659 int bApproxOK, GDALProgressFunc pfnProgress,
660 void *pProgressData)
override;
662 CPLErr AddSource(VRTSource *);
664 CPLErr AddSimpleSource(
const char *pszFilename,
int nBand,
665 double dfSrcXOff = -1,
double dfSrcYOff = -1,
666 double dfSrcXSize = -1,
double dfSrcYSize = -1,
667 double dfDstXOff = -1,
double dfDstYOff = -1,
668 double dfDstXSize = -1,
double dfDstYSize = -1,
669 const char *pszResampling =
"near",
673 double dfSrcYOff = -1,
double dfSrcXSize = -1,
674 double dfSrcYSize = -1,
double dfDstXOff = -1,
675 double dfDstYOff = -1,
double dfDstXSize = -1,
676 double dfDstYSize = -1,
677 const char *pszResampling =
"near",
680 CPLErr AddComplexSource(
const char *pszFilename,
int nBand,
681 double dfSrcXOff = -1,
double dfSrcYOff = -1,
682 double dfSrcXSize = -1,
double dfSrcYSize = -1,
683 double dfDstXOff = -1,
double dfDstYOff = -1,
684 double dfDstXSize = -1,
double dfDstYSize = -1,
685 double dfScaleOff = 0.0,
double dfScaleRatio = 1.0,
687 int nColorTableComponent = 0);
690 double dfSrcYOff = -1,
double dfSrcXSize = -1,
691 double dfSrcYSize = -1,
double dfDstXOff = -1,
692 double dfDstYOff = -1,
double dfDstXSize = -1,
693 double dfDstYSize = -1,
double dfScaleOff = 0.0,
694 double dfScaleRatio = 1.0,
696 int nColorTableComponent = 0);
699 double dfSrcYOff = -1,
double dfSrcXSize = -1,
700 double dfSrcYSize = -1,
double dfDstXOff = -1,
701 double dfDstYOff = -1,
double dfDstXSize = -1,
702 double dfDstYSize = -1);
707 void ConfigureSource(VRTSimpleSource *poSimpleSource,
709 double dfSrcXOff,
double dfSrcYOff,
double dfSrcXSize,
710 double dfSrcYSize,
double dfDstXOff,
double dfDstYOff,
711 double dfDstXSize,
double dfDstYSize);
713 void RemoveCoveredSources(
CSLConstList papszOptions =
nullptr);
715 virtual CPLErr IReadBlock(
int,
int,
void *)
override;
717 virtual void GetFileList(
char ***ppapszFileList,
int *pnSize,
718 int *pnMaxSize,
CPLHashSet *hSetFiles)
override;
720 virtual int CloseDependentDatasets()
override;
722 virtual int IsSourcedRasterBand()
override
727 virtual CPLErr FlushCache(
bool bAtClosing)
override;
734class CPL_DLL VRTWarpedRasterBand final :
public VRTRasterBand
739 virtual ~VRTWarpedRasterBand();
741 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
743 virtual CPLErr IReadBlock(
int,
int,
void *)
override;
744 virtual CPLErr IWriteBlock(
int,
int,
void *)
override;
746 virtual int GetOverviewCount()
override;
753class VRTPansharpenedRasterBand final :
public VRTRasterBand
755 int m_nIndexAsPansharpenedBand;
758 VRTPansharpenedRasterBand(
GDALDataset *poDS,
int nBand,
760 virtual ~VRTPansharpenedRasterBand();
762 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
764 virtual CPLErr IReadBlock(
int,
int,
void *)
override;
767 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
772 virtual int GetOverviewCount()
override;
775 virtual int IsPansharpenRasterBand()
override
780 void SetIndexAsPansharpenedBand(
int nIdx)
782 m_nIndexAsPansharpenedBand = nIdx;
784 int GetIndexAsPansharpenedBand()
const
786 return m_nIndexAsPansharpenedBand;
794class VRTDerivedRasterBandPrivateData;
796class CPL_DLL VRTDerivedRasterBand
CPL_NON_FINAL :
public VRTSourcedRasterBand
798 VRTDerivedRasterBandPrivateData *m_poPrivate;
799 bool InitializePython();
801 GetPixelFunctionArguments(
const CPLString &,
802 std::vector<std::pair<CPLString, CPLString>> &);
814 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand);
816 int nXSize,
int nYSize);
817 virtual ~VRTDerivedRasterBand();
824 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
int nXSize,
825 int nYSize,
int nMaskFlagStop,
826 double *pdfDataPct)
override;
828 static CPLErr AddPixelFunction(
const char *pszFuncNameIn,
830 static CPLErr AddPixelFunction(
const char *pszFuncNameIn,
832 const char *pszMetadata);
834 static std::pair<PixelFunc, CPLString> *
835 GetPixelFunction(
const char *pszFuncNameIn);
837 void SetPixelFunctionName(
const char *pszFuncNameIn);
839 void SetPixelFunctionLanguage(
const char *pszLanguage);
842 std::map<CPLString, GDALDataset *> &)
override;
843 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
845 virtual double GetMinimum(
int *pbSuccess =
nullptr)
override;
846 virtual double GetMaximum(
int *pbSuccess =
nullptr)
override;
847 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
848 double *adfMinMax)
override;
849 virtual CPLErr ComputeStatistics(
int bApproxOK,
double *pdfMin,
850 double *pdfMax,
double *pdfMean,
852 GDALProgressFunc pfnProgress,
853 void *pProgressData)
override;
854 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
int nBuckets,
855 GUIntBig *panHistogram,
int bIncludeOutOfRange,
856 int bApproxOK, GDALProgressFunc pfnProgress,
857 void *pProgressData)
override;
859 static void Cleanup();
868class CPL_DLL VRTRawRasterBand
CPL_NON_FINAL :
public VRTRasterBand
870 RawRasterBand *m_poRawRaster;
872 char *m_pszSourceFilename;
873 int m_bRelativeToVRT;
880 virtual ~VRTRawRasterBand();
883 std::map<CPLString, GDALDataset *> &)
override;
884 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
891 virtual CPLErr IReadBlock(
int,
int,
void *)
override;
892 virtual CPLErr IWriteBlock(
int,
int,
void *)
override;
894 CPLErr SetRawLink(
const char *pszFilename,
const char *pszVRTPath,
896 int nPixelOffset,
int nLineOffset,
897 const char *pszByteOrder);
903 char **papszOptions)
override;
905 virtual void GetFileList(
char ***ppapszFileList,
int *pnSize,
906 int *pnMaxSize,
CPLHashSet *hSetFiles)
override;
917 std::map<std::string, VRTSourceParser> m_oMapSourceParser{};
921 virtual ~VRTDriver();
923 char **papszSourceParsers;
926 virtual char **
GetMetadata(
const char *pszDomain =
"")
override;
928 const char *pszDomain =
"")
override;
931 ParseSource(
CPLXMLNode *psSrc,
const char *pszVRTPath,
932 std::map<CPLString, GDALDataset *> &oMapSharedSources);
933 void AddSourceParser(
const char *pszElementName, VRTSourceParser pfnParser);
940class CPL_DLL VRTSimpleSource
CPL_NON_FINAL :
public VRTSource
946 std::map<CPLString, GDALDataset *> *m_poMapSharedSources =
nullptr;
956 void OpenSource()
const;
959 friend class VRTSourcedRasterBand;
960 friend class VRTDataset;
963 bool m_bGetMaskBand =
false;
965 double m_dfSrcXOff = 0;
966 double m_dfSrcYOff = 0;
967 double m_dfSrcXSize = 0;
968 double m_dfSrcYSize = 0;
970 double m_dfDstXOff = 0;
971 double m_dfDstYOff = 0;
972 double m_dfDstXSize = 0;
973 double m_dfDstYSize = 0;
979 int m_bRelativeToVRTOri = -1;
981 int m_nExplicitSharedStatus = -1;
984 bool m_bDropRefOnSrcBand =
true;
986 int NeedMaxValAdjustment()
const;
990 return m_poRasterBand;
1000 VRTSimpleSource(
const VRTSimpleSource *poSrcSource,
double dfXDstRatio,
1001 double dfYDstRatio);
1002 virtual ~VRTSimpleSource();
1005 std::map<CPLString, GDALDataset *> &)
override;
1006 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1008 void SetSrcBand(
const char *pszFilename,
int nBand);
1011 void SetSrcWindow(
double,
double,
double,
double);
1012 void SetDstWindow(
double,
double,
double,
double);
1015 return m_osResampling;
1017 void SetResampling(
const char *pszResampling);
1019 int GetSrcDstWindow(
double,
double,
double,
double,
int,
int,
1020 double *pdfReqXOff,
double *pdfReqYOff,
1021 double *pdfReqXSize,
double *pdfReqYSize,
int *,
int *,
1022 int *,
int *,
int *,
int *,
int *,
int *,
1026 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1031 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1032 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1033 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
double dfMin,
1034 double dfMax,
int nBuckets,
1035 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1036 int bApproxOK, GDALProgressFunc pfnProgress,
1037 void *pProgressData)
override;
1039 void DstToSrc(
double dfX,
double dfY,
double &dfXOut,
double &dfYOut)
const;
1040 void SrcToDst(
double dfX,
double dfY,
double &dfXOut,
double &dfYOut)
const;
1042 virtual void GetFileList(
char ***ppapszFileList,
int *pnSize,
1043 int *pnMaxSize,
CPLHashSet *hSetFiles)
override;
1045 virtual int IsSimpleSource()
override
1049 virtual const char *GetType()
1051 return "SimpleSource";
1053 virtual CPLErr FlushCache(
bool bAtClosing)
override;
1057 int IsSameExceptBandNumber(VRTSimpleSource *poOtherSource);
1059 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1061 int *panBandMap,
GSpacing nPixelSpace,
1065 void UnsetPreservedRelativeFilenames();
1067 void SetMaxValue(
int nVal)
1077class VRTAveragedSource final :
public VRTSimpleSource
1081 int m_bNoDataSet =
false;
1085 VRTAveragedSource();
1087 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1092 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1093 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1094 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
double dfMin,
1095 double dfMax,
int nBuckets,
1096 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1097 int bApproxOK, GDALProgressFunc pfnProgress,
1098 void *pProgressData)
override;
1100 void SetNoDataValue(
double dfNoDataValue);
1102 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1103 virtual const char *GetType()
override
1105 return "AveragedSource";
1117 VRT_SCALING_EXPONENTIAL,
1118} VRTComplexSourceScaling;
1120class CPL_DLL VRTComplexSource
CPL_NON_FINAL :
public VRTSimpleSource
1125 int m_bNoDataSet =
false;
1129 m_osNoDataValueOri{};
1131 VRTComplexSourceScaling m_eScalingType = VRT_SCALING_NONE;
1132 double m_dfScaleOff = 0;
1133 double m_dfScaleRatio = 1;
1136 int m_bSrcMinMaxDefined = FALSE;
1137 double m_dfSrcMin = 0;
1138 double m_dfSrcMax = 0;
1139 double m_dfDstMin = 0;
1140 double m_dfDstMax = 0;
1141 double m_dfExponent = 1;
1143 int m_nColorTableComponent = 0;
1145 bool m_bUseMaskBand =
false;
1147 double *m_padfLUTInputs =
nullptr;
1148 double *m_padfLUTOutputs =
nullptr;
1149 int m_nLUTItemCount = 0;
1151 double GetAdjustedNoDataValue()
const;
1153 template <
class WorkingDT>
1154 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
int nReqXSize,
1155 int nReqYSize,
void *pData,
int nOutXSize,
1163 VRTComplexSource(
const VRTComplexSource *poSrcSource,
double dfXDstRatio,
1164 double dfYDstRatio);
1165 virtual ~VRTComplexSource();
1168 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1173 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1174 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1175 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
double dfMin,
1176 double dfMax,
int nBuckets,
1177 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1178 int bApproxOK, GDALProgressFunc pfnProgress,
1179 void *pProgressData)
override;
1181 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1183 std::map<CPLString, GDALDataset *> &)
override;
1184 virtual const char *GetType()
override
1186 return "ComplexSource";
1189 bool AreValuesUnchanged()
const;
1191 double LookupValue(
double dfInput);
1193 void SetNoDataValue(
double dfNoDataValue);
1195 void SetUseMaskBand(
bool bUseMaskBand)
1197 m_bUseMaskBand = bUseMaskBand;
1200 void SetLinearScaling(
double dfOffset,
double dfScale);
1201 void SetPowerScaling(
double dfExponent,
double dfSrcMin,
double dfSrcMax,
1202 double dfDstMin,
double dfDstMax);
1203 void SetColorTableComponent(
int nComponent);
1210class VRTFilteredSource
CPL_NON_FINAL :
public VRTComplexSource
1218 int m_nSupportedTypesCount;
1221 int m_nExtraEdgePixels;
1224 VRTFilteredSource();
1225 virtual ~VRTFilteredSource();
1227 void SetExtraEdgePixels(
int);
1228 void SetFilteringDataTypesSupported(
int,
GDALDataType *);
1234 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1244class VRTKernelFilteredSource
CPL_NON_FINAL :
public VRTFilteredSource
1253 double *m_padfKernelCoefs;
1258 VRTKernelFilteredSource();
1259 virtual ~VRTKernelFilteredSource();
1262 std::map<CPLString, GDALDataset *> &)
override;
1263 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1266 GByte *pabySrcData,
GByte *pabyDstData)
override;
1268 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs);
1269 void SetNormalized(
int);
1276class VRTAverageFilteredSource final :
public VRTKernelFilteredSource
1281 explicit VRTAverageFilteredSource(
int nKernelSize);
1282 virtual ~VRTAverageFilteredSource();
1285 std::map<CPLString, GDALDataset *> &)
override;
1286 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1292class VRTFuncSource final :
public VRTSource
1298 virtual ~VRTFuncSource();
1301 std::map<CPLString, GDALDataset *> &)
override
1305 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath)
override;
1308 int nXSize,
int nYSize,
void *pData,
int nBufXSize,
1313 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1314 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess)
override;
1315 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
double dfMin,
1316 double dfMax,
int nBuckets,
1317 GUIntBig *panHistogram,
int bIncludeOutOfRange,
1318 int bApproxOK, GDALProgressFunc pfnProgress,
1319 void *pProgressData)
override;
1333#define TMP_CPL_DLL CPL_DLL
1348 explicit Ref(VRTGroup *ptr) : m_ptr(ptr)
1351 Ref(
const Ref &) =
delete;
1352 Ref &operator=(
const Ref &) =
delete;
1356 std::shared_ptr<Ref> m_poSharedRefRootGroup{};
1357 std::weak_ptr<Ref> m_poWeakRefRootGroup{};
1358 std::shared_ptr<Ref> m_poRefSelf{};
1360 std::string m_osFilename{};
1361 mutable bool m_bDirty =
false;
1362 std::string m_osVRTPath{};
1363 std::map<std::string, std::shared_ptr<VRTGroup>> m_oMapGroups{};
1364 std::map<std::string, std::shared_ptr<VRTMDArray>> m_oMapMDArrays{};
1365 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1366 std::map<std::string, std::shared_ptr<VRTDimension>> m_oMapDimensions{};
1368 std::shared_ptr<VRTGroup>
1369 OpenGroupInternal(
const std::string &osName)
const;
1370 void SetRootGroupRef(
const std::weak_ptr<Ref> &rgRef);
1371 std::weak_ptr<Ref> GetRootGroupRef()
const;
1374 VRTGroup(
const std::string &osParentName,
const std::string &osName);
1377 bool XMLInit(
const std::shared_ptr<VRTGroup> &poRoot,
1378 const std::shared_ptr<VRTGroup> &poThisGroup,
1379 const CPLXMLNode *psNode,
const char *pszVRTPath);
1381 std::vector<std::string>
1382 GetMDArrayNames(
CSLConstList papszOptions)
const override;
1383 std::shared_ptr<GDALMDArray>
1384 OpenMDArray(
const std::string &osName,
1387 std::vector<std::string>
1388 GetGroupNames(
CSLConstList papszOptions)
const override;
1389 std::shared_ptr<GDALGroup> OpenGroup(
const std::string &osName,
1392 return OpenGroupInternal(osName);
1395 std::vector<std::shared_ptr<GDALDimension>>
1398 std::vector<std::shared_ptr<GDALAttribute>>
1401 std::shared_ptr<VRTDimension> GetDimension(
const std::string &name)
const
1403 auto oIter = m_oMapDimensions.find(name);
1404 return oIter == m_oMapDimensions.end() ? nullptr : oIter->second;
1406 std::shared_ptr<VRTDimension>
1407 GetDimensionFromFullName(
const std::string &name,
bool bEmitError)
const;
1409 std::shared_ptr<GDALGroup>
1410 CreateGroup(
const std::string &osName,
1413 std::shared_ptr<GDALDimension>
1414 CreateDimension(
const std::string &osName,
const std::string &osType,
1415 const std::string &osDirection,
GUInt64 nSize,
1418 std::shared_ptr<GDALAttribute>
1419 CreateAttribute(
const std::string &osName,
1420 const std::vector<GUInt64> &anDimensions,
1424 std::shared_ptr<GDALMDArray> CreateMDArray(
1425 const std::string &osName,
1426 const std::vector<std::shared_ptr<GDALDimension>> &aoDimensions,
1430 void SetIsRootGroup();
1432 const std::shared_ptr<Ref> &GetRef()
const
1436 VRTGroup *GetRootGroup()
const;
1438 const std::string &GetVRTPath()
const
1443 void SetFilename(
const std::string &osFilename)
1445 m_osFilename = osFilename;
1447 const std::string &GetFilename()
const
1449 return m_osFilename;
1451 void Serialize()
const;
1452 CPLXMLNode *SerializeToXML(
const char *pszVRTPathIn)
const;
1453 void Serialize(
CPLXMLNode *psParent,
const char *pszVRTPathIn)
const;
1462 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1463 std::string m_osIndexingVariableName;
1466 VRTDimension(
const std::shared_ptr<VRTGroup::Ref> &poGroupRef,
1467 const std::string &osParentName,
const std::string &osName,
1468 const std::string &osType,
const std::string &osDirection,
1469 GUInt64 nSize,
const std::string &osIndexingVariableName)
1470 :
GDALDimension(osParentName, osName, osType, osDirection, nSize),
1471 m_poGroupRef(poGroupRef),
1472 m_osIndexingVariableName(osIndexingVariableName)
1476 VRTGroup *GetGroup()
const;
1478 static std::shared_ptr<VRTDimension>
1479 Create(
const std::shared_ptr<VRTGroup> &poThisGroup,
1480 const std::string &osParentName,
const CPLXMLNode *psNode);
1485 std::shared_ptr<GDALMDArray> poIndexingVariable)
override;
1497 std::vector<std::string> m_aosList{};
1498 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
1501 bool IRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
1504 void *pDstBuffer)
const override;
1506 bool IWrite(
const GUInt64 *arrayStartIdx,
const size_t *count,
1509 const void *pSrcBuffer)
override;
1512 VRTAttribute(
const std::string &osParentName,
const std::string &osName,
1514 std::vector<std::string> &&aosList)
1517 m_aosList(std::move(aosList))
1519 if (m_aosList.size() > 1)
1521 m_dims.emplace_back(std::make_shared<GDALDimension>(
1522 std::string(),
"dim", std::string(), std::string(),
1527 VRTAttribute(
const std::string &osParentName,
const std::string &osName,
1534 m_dims.emplace_back(std::make_shared<GDALDimension>(
1535 std::string(),
"dim", std::string(), std::string(), nDim));
1539 static bool CreationCommonChecks(
1540 const std::string &osName,
const std::vector<GUInt64> &anDimensions,
1541 const std::map<std::string, std::shared_ptr<VRTAttribute>>
1544 static std::shared_ptr<VRTAttribute> Create(
const std::string &osParentName,
1547 const std::vector<std::shared_ptr<GDALDimension>> &
1565class VRTMDArraySource
1568 virtual ~VRTMDArraySource() =
default;
1570 virtual bool Read(
const GUInt64 *arrayStartIdx,
const size_t *count,
1573 void *pDstBuffer)
const = 0;
1576 const char *pszVRTPath)
const = 0;
1586 friend class VRTGroup;
1588 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1589 std::string m_osVRTPath{};
1592 std::vector<std::shared_ptr<GDALDimension>> m_dims;
1593 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1594 std::vector<std::unique_ptr<VRTMDArraySource>> m_sources{};
1595 std::shared_ptr<OGRSpatialReference> m_poSRS{};
1596 std::vector<GByte> m_abyNoData{};
1597 std::string m_osUnit{};
1598 double m_dfScale = 1.0;
1599 double m_dfOffset = 0.0;
1600 bool m_bHasScale =
false;
1601 bool m_bHasOffset =
false;
1602 std::string m_osFilename{};
1604 bool IRead(
const GUInt64 *arrayStartIdx,
const size_t *count,
1607 void *pDstBuffer)
const override;
1613 const std::shared_ptr<VRTGroup::Ref> &poGroupRef,
1614 const std::string &osParentName,
const std::string &osName,
1616 std::vector<std::shared_ptr<GDALDimension>> &&dims,
1617 std::map<std::string, std::shared_ptr<VRTAttribute>> &&oMapAttributes)
1619 GDALMDArray(osParentName, osName), m_poGroupRef(poGroupRef),
1620 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()), m_dt(dt),
1621 m_dims(std::move(dims)), m_oMapAttributes(std::move(oMapAttributes)),
1622 m_osFilename(poGroupRef->m_ptr->GetFilename())
1626 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref> &poGroupRef,
1627 const std::string &osParentName,
const std::string &osName,
1628 const std::vector<std::shared_ptr<GDALDimension>> &dims,
1631 GDALMDArray(osParentName, osName), m_poGroupRef(poGroupRef),
1632 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()), m_dt(dt), m_dims(dims),
1633 m_osFilename(poGroupRef->m_ptr->GetFilename())
1644 return m_osFilename;
1647 static std::shared_ptr<VRTMDArray>
1648 Create(
const std::shared_ptr<VRTGroup> &poThisGroup,
1649 const std::string &osParentName,
const CPLXMLNode *psNode);
1651 const std::vector<std::shared_ptr<GDALDimension>> &
1657 std::vector<std::shared_ptr<GDALAttribute>>
1667 std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const override
1676 const std::string &
GetUnit()
const override
1681 bool SetUnit(
const std::string &osUnit)
override
1691 *pbHasOffset = m_bHasOffset;
1701 *pbHasScale = m_bHasScale;
1711 m_bHasOffset =
true;
1712 m_dfOffset = dfOffset;
1721 m_dfScale = dfScale;
1725 void AddSource(std::unique_ptr<VRTMDArraySource> &&poSource);
1727 std::shared_ptr<GDALAttribute>
1729 const std::vector<GUInt64> &anDimensions,
1735 GDALProgressFunc pfnProgress,
void *pProgressData)
override;
1737 void Serialize(
CPLXMLNode *psParent,
const char *pszVRTPathIn)
const;
1739 VRTGroup *GetGroup()
const;
1741 const std::string &GetVRTPath()
const
1751class VRTMDArraySourceInlinedValues final :
public VRTMDArraySource
1753 const VRTMDArray *m_poDstArray =
nullptr;
1754 bool m_bIsConstantValue;
1755 std::vector<GUInt64> m_anOffset{};
1756 std::vector<size_t> m_anCount{};
1757 std::vector<GByte> m_abyValues{};
1758 std::vector<size_t> m_anInlinedArrayStrideInBytes{};
1761 VRTMDArraySourceInlinedValues(
const VRTMDArraySourceInlinedValues &) =
1763 VRTMDArraySourceInlinedValues &
1764 operator=(
const VRTMDArraySourceInlinedValues &) =
delete;
1767 VRTMDArraySourceInlinedValues(
const VRTMDArray *poDstArray,
1768 bool bIsConstantValue,
1769 std::vector<GUInt64> &&anOffset,
1770 std::vector<size_t> &&anCount,
1771 std::vector<GByte> &&abyValues)
1772 : m_poDstArray(poDstArray), m_bIsConstantValue(bIsConstantValue),
1773 m_anOffset(std::move(anOffset)), m_anCount(std::move(anCount)),
1774 m_abyValues(std::move(abyValues)), m_dt(poDstArray->GetDataType())
1776 const auto nDims(poDstArray->GetDimensionCount());
1777 m_anInlinedArrayStrideInBytes.resize(nDims);
1778 if (!bIsConstantValue && nDims > 0)
1780 m_anInlinedArrayStrideInBytes.back() =
1781 poDstArray->GetDataType().GetSize();
1782 for (
size_t i = nDims - 1; i > 0;)
1785 m_anInlinedArrayStrideInBytes[i] =
1786 m_anInlinedArrayStrideInBytes[i + 1] * m_anCount[i + 1];
1791 ~VRTMDArraySourceInlinedValues();
1793 static std::unique_ptr<VRTMDArraySourceInlinedValues>
1794 Create(
const VRTMDArray *poDstArray,
const CPLXMLNode *psNode);
1796 bool Read(
const GUInt64 *arrayStartIdx,
const size_t *count,
1799 void *pDstBuffer)
const override;
1801 void Serialize(
CPLXMLNode *psParent,
const char *pszVRTPath)
const override;
1808class VRTMDArraySourceRegularlySpaced final :
public VRTMDArraySource
1811 double m_dfIncrement;
1814 VRTMDArraySourceRegularlySpaced(
double dfStart,
double dfIncrement)
1815 : m_dfStart(dfStart), m_dfIncrement(dfIncrement)
1819 bool Read(
const GUInt64 *arrayStartIdx,
const size_t *count,
1822 void *pDstBuffer)
const override;
1824 void Serialize(
CPLXMLNode *psParent,
const char *pszVRTPath)
const override;
1831class VRTMDArraySourceFromArray final :
public VRTMDArraySource
1833 const VRTMDArray *m_poDstArray =
nullptr;
1834 bool m_bRelativeToVRTSet =
false;
1835 bool m_bRelativeToVRT =
false;
1836 std::string m_osFilename{};
1837 std::string m_osArray{};
1838 std::string m_osBand{};
1839 std::vector<int> m_anTransposedAxis{};
1840 std::string m_osViewExpr{};
1841 std::vector<GUInt64> m_anSrcOffset{};
1842 mutable std::vector<GUInt64> m_anCount{};
1843 std::vector<GUInt64> m_anStep{};
1844 std::vector<GUInt64> m_anDstOffset{};
1846 VRTMDArraySourceFromArray(
const VRTMDArraySourceFromArray &) =
delete;
1847 VRTMDArraySourceFromArray &
1848 operator=(
const VRTMDArraySourceFromArray &) =
delete;
1851 VRTMDArraySourceFromArray(
1852 const VRTMDArray *poDstArray,
bool bRelativeToVRTSet,
1853 bool bRelativeToVRT,
const std::string &osFilename,
1854 const std::string &osArray,
const std::string &osBand,
1855 std::vector<int> &&anTransposedAxis,
const std::string &osViewExpr,
1856 std::vector<GUInt64> &&anSrcOffset, std::vector<GUInt64> &&anCount,
1857 std::vector<GUInt64> &&anStep, std::vector<GUInt64> &&anDstOffset)
1858 : m_poDstArray(poDstArray), m_bRelativeToVRTSet(bRelativeToVRTSet),
1859 m_bRelativeToVRT(bRelativeToVRT), m_osFilename(osFilename),
1860 m_osArray(osArray), m_osBand(osBand),
1861 m_anTransposedAxis(std::move(anTransposedAxis)),
1862 m_osViewExpr(osViewExpr), m_anSrcOffset(std::move(anSrcOffset)),
1863 m_anCount(std::move(anCount)), m_anStep(std::move(anStep)),
1864 m_anDstOffset(std::move(anDstOffset))
1868 ~VRTMDArraySourceFromArray()
override;
1870 static std::unique_ptr<VRTMDArraySourceFromArray>
1871 Create(
const VRTMDArray *poDstArray,
const CPLXMLNode *psNode);
1873 bool Read(
const GUInt64 *arrayStartIdx,
const size_t *count,
1876 void *pDstBuffer)
const override;
1878 void Serialize(
CPLXMLNode *psParent,
const char *pszVRTPath)
const override;
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:438
Convenient string class based on std::string.
Definition cpl_string.h:312
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition gdal_priv.h:2333
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.
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition gdal_priv.h:2534
A color table / palette.
Definition gdal_priv.h:1093
A set of associated raster bands, usually from one file.
Definition gdal_priv.h:348
int Dereference()
Subtract one from dataset reference count.
Definition gdaldataset.cpp:1317
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition gdaldataset.cpp:1736
int GetShared() const
Returns shared flag.
Definition gdaldataset.cpp:1391
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition gdal_priv.h:2960
virtual std::shared_ptr< GDALMDArray > GetIndexingVariable() const
Return the variable that is used to index the dimension (if there is one).
Definition gdalmultidim.cpp:8762
virtual bool SetIndexingVariable(std::shared_ptr< GDALMDArray > poIndexingVariable)
Set the variable that is used to index the dimension.
Definition gdalmultidim.cpp:8783
Format specific driver.
Definition gdal_priv.h:1641
Class used to represent potentially complex data types.
Definition gdal_priv.h:1995
Class modeling a named container of GDALAttribute, GDALMDArray, OGRLayer or other GDALGroup.
Definition gdal_priv.h:2219
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:302
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:271
Class modeling a multi-dimensional array.
Definition gdal_priv.h:2646
virtual bool SetUnit(const std::string &osUnit)
Set the variable unit.
Definition gdalmultidim.cpp:2204
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:3418
virtual bool IsWritable() const =0
Return whether an array is writable.
virtual bool SetScale(double dfScale, GDALDataType eStorageType=GDT_Unknown)
Set the scale value to apply to raw values.
Definition gdalmultidim.cpp:2509
virtual bool SetRawNoDataValue(const void *pRawNoData)
Set the nodata value as a "raw" value.
Definition gdalmultidim.cpp:2396
virtual double GetOffset(bool *pbHasOffset=nullptr, GDALDataType *peStorageType=nullptr) const
Get the offset value to apply to raw values.
Definition gdalmultidim.cpp:2596
virtual const void * GetRawNoDataValue() const
Return the nodata value as a "raw" value.
Definition gdalmultidim.cpp:2280
virtual double GetScale(bool *pbHasScale=nullptr, GDALDataType *peStorageType=nullptr) const
Get the scale value to apply to raw values.
Definition gdalmultidim.cpp:2566
virtual std::shared_ptr< OGRSpatialReference > GetSpatialRef() const
Return the spatial reference system object associated with the array.
Definition gdalmultidim.cpp:2254
virtual const std::string & GetFilename() const =0
Return the filename that contains that array.
virtual bool SetSpatialRef(const OGRSpatialReference *poSRS)
Assign a spatial reference system object to the the array.
Definition gdalmultidim.cpp:2240
virtual bool SetOffset(double dfOffset, GDALDataType eStorageType=GDT_Unknown)
Set the offset value to apply to raw values.
Definition gdalmultidim.cpp:2537
virtual const std::string & GetUnit() const
Return the array unit.
Definition gdalmultidim.cpp:2226
Object with metadata.
Definition gdal_priv.h:138
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition gdalmajorobject.cpp:290
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition gdalmajorobject.cpp:160
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition gdalmajorobject.cpp:247
Class for dataset open functions.
Definition gdal_priv.h:277
Pansharpening operation class.
Definition gdalpansharpen.h:196
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:1238
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition gdalrasterband.cpp:3187
High level image warping class.
Definition gdalwarper.h:483
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:167
CPLErr
Error category.
Definition cpl_error.h:53
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition cpl_hash_set.h:52
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:274
#define CPL_NON_FINAL
Mark that a class is explicitly recognized as non-final.
Definition cpl_port.h:1042
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition cpl_port.h:236
GIntBig GInt64
Signed 64 bit integer type.
Definition cpl_port.h:254
#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:1049
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1190
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition cpl_port.h:256
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:205
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:233
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
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:314
GDALAccess
Definition gdal.h:124
@ GA_ReadOnly
Definition gdal.h:125
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition gdaldataset.cpp:3658
GDALDataType
Definition gdal.h:64
@ GDT_Unknown
Definition gdal.h:65
CPLErr(* GDALDerivedPixelFuncWithArgs)(void **papoSources, int nSources, void *pData, int nBufXSize, int nBufYSize, GDALDataType eSrcType, GDALDataType eBufType, int nPixelSpace, int nLineSpace, CSLConstList papszFunctionArgs)
Type of functions to pass to GDALAddDerivedBandPixelFuncWithArgs.
Definition gdal.h:1244
GDALColorInterp
Definition gdal.h:226
@ GCI_Undefined
Definition gdal.h:227
GDALRWFlag
Definition gdal.h:131
CPLErr(* GDALDerivedPixelFunc)(void **papoSources, int nSources, void *pData, int nBufXSize, int nBufYSize, GDALDataType eSrcType, GDALDataType eBufType, int nPixelSpace, int nLineSpace)
Type of functions to pass to GDALAddDerivedBandPixelFunc.
Definition gdal.h:1236
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal.h:293
Public (C callable) entry points for virtual GDAL dataset objects.
#define VRT_NODATA_UNSET
Special value to indicate that nodata is not set.
Definition gdal_vrt.h:45
void * VRTDatasetH
Opaque type for a VRT dataset.
Definition gdal_vrt.h:74
CPLErr(* VRTImageReadFunc)(void *hCBData, int nXOff, int nYOff, int nXSize, int nYSize, void *pData)
Type for a function that returns the pixel data in a provided window.
Definition gdal_vrt.h:50
VRTDatasetH VRTCreate(int, int)
Definition vrtdataset.cpp:77
Document node structure.
Definition cpl_minixml.h:70
Ground Control Point.
Definition gdal.h:959