31 #ifndef VIRTUALDATASET_H_INCLUDED
32 #define VIRTUALDATASET_H_INCLUDED
50 CPLErr GDALRegisterDefaultPixelFunc();
53 int VRTWarpedOverviewTransform(
void *pTransformArg,
int bDstToSrc,
55 double *padfX,
double *padfY,
double *padfZ,
57 void* VRTDeserializeWarpedOverviewTransformer(
CPLXMLNode *psTree );
71 int bTriedToOpen = FALSE;
73 VRTOverviewInfo() =
default;
74 VRTOverviewInfo(VRTOverviewInfo&& oOther) noexcept:
75 osFilename(std::move(oOther.osFilename)),
77 poBand(oOther.poBand),
78 bTriedToOpen(oOther.bTriedToOpen)
80 oOther.poBand =
nullptr;
84 if( poBand ==
nullptr )
97 class CPL_DLL VRTSource
100 virtual ~VRTSource();
103 int nXOff,
int nYOff,
int nXSize,
int nYSize,
104 void *pData,
int nBufXSize,
int nBufYSize,
109 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
110 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
111 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
112 double* adfMinMax ) = 0;
113 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
115 double *pdfMin,
double *pdfMax,
116 double *pdfMean,
double *pdfStdDev,
117 GDALProgressFunc pfnProgress,
118 void *pProgressData ) = 0;
119 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
120 double dfMin,
double dfMax,
121 int nBuckets,
GUIntBig * panHistogram,
122 int bIncludeOutOfRange,
int bApproxOK,
123 GDALProgressFunc pfnProgress,
124 void *pProgressData ) = 0;
127 std::map<CPLString, GDALDataset*>& ) = 0;
128 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath ) = 0;
130 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
133 virtual int IsSimpleSource() {
return FALSE; }
134 virtual CPLErr FlushCache() {
return CE_None; }
137 typedef VRTSource *(*VRTSourceParser)(
CPLXMLNode *,
const char *,
void* pUniqueHandle,
138 std::map<CPLString, GDALDataset*>& oMapSharedSources);
140 VRTSource *VRTParseCoreSources(
CPLXMLNode *psTree,
const char *,
void* pUniqueHandle,
141 std::map<CPLString, GDALDataset*>& oMapSharedSources);
142 VRTSource *VRTParseFilterSources(
CPLXMLNode *psTree,
const char *,
void* pUniqueHandle,
143 std::map<CPLString, GDALDataset*>& oMapSharedSources );
151 template<
class T>
struct VRTFlushCacheStruct
153 static void FlushCache(T& obj);
156 class VRTWarpedDataset;
157 class VRTPansharpenedDataset;
162 friend class VRTRasterBand;
163 friend struct VRTFlushCacheStruct<VRTDataset>;
164 friend struct VRTFlushCacheStruct<VRTWarpedDataset>;
165 friend struct VRTFlushCacheStruct<VRTPansharpenedDataset>;
166 friend class VRTSourcedRasterBand;
171 int m_bGeoTransformSet;
172 double m_adfGeoTransform[6];
183 VRTRasterBand *m_poMaskBand;
185 int m_bCompatibleForDatasetIO;
186 int CheckCompatibleForDatasetIO();
187 void ExpandProxyBands();
189 std::vector<GDALDataset*> m_apoOverviews{};
190 std::vector<GDALDataset*> m_apoOverviewsBak{};
191 char **m_papszXMLVRTMetadata;
193 std::map<CPLString, GDALDataset*> m_oMapSharedSources{};
194 std::shared_ptr<VRTGroup> m_poRootGroup{};
196 VRTRasterBand* InitBand(
const char* pszSubclass,
int nBand,
197 bool bAllowPansharpened);
198 static GDALDataset *OpenVRTProtocol(
const char* pszSpec );
206 VRTDataset(
int nXSize,
int nYSize);
207 virtual ~VRTDataset();
209 void SetNeedsFlush() { m_bNeedsFlush = TRUE; }
212 void SetWritable(
int bWritableIn) { m_bWritable = bWritableIn; }
215 void SetMaskBand(VRTRasterBand* poMaskBand);
224 const char *pszDomain =
"" )
override;
226 const char *pszDomain =
"" )
override;
228 virtual char**
GetMetadata(
const char *pszDomain =
"" )
override;
238 char **papszOptions=
nullptr )
override;
243 int nXOff,
int nYOff,
int nXSize,
int nYSize,
244 void * pData,
int nBufXSize,
int nBufYSize,
246 int nBandCount,
int *panBandMap,
252 int nBufXSize,
int nBufYSize,
254 int nBandCount,
int *panBandList,
255 char **papszOptions )
override;
257 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath);
260 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
261 int,
int *, GDALProgressFunc,
void * )
override;
263 std::shared_ptr<GDALGroup>
GetRootGroup()
const override;
267 void BuildVirtualOverviews();
269 void UnsetPreservedRelativeFilenames();
273 static GDALDataset *OpenXML(
const char *,
const char * =
nullptr,
276 int nXSize,
int nYSize,
int nBands,
278 static GDALDataset *CreateMultiDimensional(
const char * pszFilename,
281 static CPLErr Delete(
const char * pszFilename );
289 class VRTWarpedRasterBand;
291 class CPL_DLL VRTWarpedDataset final:
public VRTDataset
297 int m_nOverviewCount;
298 VRTWarpedDataset **m_papoOverviews;
301 void CreateImplicitOverviews();
303 struct VerticalShiftGrid
306 int bInverse =
false;
307 double dfToMeterSrc = 0.0;
308 double dfToMeterDest = 0.0;
311 std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids{};
313 friend class VRTWarpedRasterBand;
318 virtual int CloseDependentDatasets()
override;
321 VRTWarpedDataset(
int nXSize,
int nYSize );
322 virtual ~VRTWarpedDataset();
324 virtual void FlushCache()
override;
326 CPLErr Initialize(
void * );
328 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
329 int,
int *, GDALProgressFunc,
void * )
override;
331 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
332 const char *pszDomain =
"" )
override;
334 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
338 char **papszOptions=
nullptr )
override;
340 virtual char **GetFileList()
override;
342 CPLErr ProcessBlock(
int iBlockX,
int iBlockY );
344 void GetBlockSize(
int *,
int * )
const;
346 void SetApplyVerticalShiftGrid(
const char* pszVGrids,
349 double dfToMeterDest,
350 char** papszOptions );
362 GTAdjust_Intersection,
364 GTAdjust_NoneWithoutWarning
367 class VRTPansharpenedDataset final:
public VRTDataset
369 friend class VRTPansharpenedRasterBand;
374 VRTPansharpenedDataset* m_poMainDataset;
375 std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets{};
377 std::map<CPLString,CPLString> m_oMapToRelativeFilenames{};
379 int m_bLoadingOtherBands;
381 GByte *m_pabyLastBufferBandRasterIO;
382 int m_nLastBandRasterIOXOff;
383 int m_nLastBandRasterIOYOff;
384 int m_nLastBandRasterIOXSize;
385 int m_nLastBandRasterIOYSize;
388 GTAdjustment m_eGTAdjustment;
389 int m_bNoDataDisabled;
391 std::vector<GDALDataset*> m_apoDatasetsToClose{};
396 virtual int CloseDependentDatasets()
override;
399 VRTPansharpenedDataset(
int nXSize,
int nYSize );
400 virtual ~VRTPansharpenedDataset();
402 virtual void FlushCache()
override;
405 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
409 int nInputSpectralBandsIn,
413 char **papszOptions=
nullptr )
override;
415 virtual char **GetFileList()
override;
418 int nXOff,
int nYOff,
int nXSize,
int nYSize,
419 void * pData,
int nBufXSize,
int nBufYSize,
421 int nBandCount,
int *panBandMap,
426 void GetBlockSize(
int *,
int * )
const;
441 friend class VRTDataset;
445 int m_bNoDataValueSet;
447 int m_bHideNoDataValue;
448 double m_dfNoDataValue;
450 std::unique_ptr<GDALColorTable> m_poColorTable{};
455 char **m_papszCategoryNames;
462 void Initialize(
int nXSize,
int nYSize );
464 std::vector<VRTOverviewInfo> m_apoOverviews{};
466 VRTRasterBand *m_poMaskBand;
468 std::unique_ptr<GDALRasterAttributeTable> m_poRAT{};
475 virtual ~VRTRasterBand();
478 std::map<CPLString, GDALDataset*>& );
479 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath );
482 virtual double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
500 virtual CPLErr SetMetadata(
char **papszMD,
const char *pszDomain =
"" )
override;
502 const char *pszDomain =
"" )
override;
504 virtual double GetOffset(
int *pbSuccess =
nullptr )
override;
506 virtual double GetScale(
int *pbSuccess =
nullptr )
override;
513 int nBuckets,
GUIntBig * panHistogram,
514 int bIncludeOutOfRange,
int bApproxOK,
515 GDALProgressFunc,
void *pProgressData )
override;
518 int *pnBuckets,
GUIntBig ** ppanHistogram,
520 GDALProgressFunc,
void *pProgressData)
override;
523 int nBuckets,
GUIntBig *panHistogram )
override;
527 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
537 void SetMaskBand(VRTRasterBand* poMaskBand);
539 void SetIsMaskBand();
541 CPLErr UnsetNoDataValue();
543 virtual int CloseDependentDatasets();
545 virtual int IsSourcedRasterBand() {
return FALSE; }
546 virtual int IsPansharpenRasterBand() {
return FALSE; }
553 class VRTSimpleSource;
555 class CPL_DLL VRTSourcedRasterBand
CPL_NON_FINAL:
public VRTRasterBand
558 int m_nRecursionCounter;
560 char **m_papszSourceList;
562 bool CanUseSourcesMinMaxImplementations();
563 void CheckSource( VRTSimpleSource *poSS );
569 VRTSource **papoSources;
570 int bSkipBufferInitialization;
572 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand );
574 int nXSize,
int nYSize );
575 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand,
577 int nXSize,
int nYSize );
578 virtual ~VRTSourcedRasterBand();
585 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
586 int nXSize,
int nYSize,
588 double* pdfDataPct)
override;
590 virtual char **GetMetadataDomainList()
override;
591 virtual const char *GetMetadataItem(
const char * pszName,
592 const char * pszDomain =
"" )
override;
593 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
594 virtual CPLErr SetMetadata(
char ** papszMetadata,
595 const char * pszDomain =
"" )
override;
596 virtual CPLErr SetMetadataItem(
const char * pszName,
597 const char * pszValue,
598 const char * pszDomain =
"" )
override;
601 std::map<CPLString, GDALDataset*>& )
override;
602 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
604 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
605 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
606 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
607 virtual CPLErr ComputeStatistics(
int bApproxOK,
608 double *pdfMin,
double *pdfMax,
609 double *pdfMean,
double *pdfStdDev,
610 GDALProgressFunc pfnProgress,
611 void *pProgressData )
override;
612 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
613 int nBuckets,
GUIntBig * panHistogram,
614 int bIncludeOutOfRange,
int bApproxOK,
615 GDALProgressFunc pfnProgress,
616 void *pProgressData )
override;
618 CPLErr AddSource( VRTSource * );
620 double dfSrcXOff=-1,
double dfSrcYOff=-1,
621 double dfSrcXSize=-1,
double dfSrcYSize=-1,
622 double dfDstXOff=-1,
double dfDstYOff=-1,
623 double dfDstXSize=-1,
double dfDstYSize=-1,
624 const char *pszResampling =
"near",
627 double dfSrcXOff=-1,
double dfSrcYOff=-1,
628 double dfSrcXSize=-1,
double dfSrcYSize=-1,
629 double dfDstXOff=-1,
double dfDstYOff=-1,
630 double dfDstXSize=-1,
double dfDstYSize=-1,
631 double dfScaleOff=0.0,
632 double dfScaleRatio=1.0,
634 int nColorTableComponent = 0);
637 double dfSrcXOff=-1,
double dfSrcYOff=-1,
638 double dfSrcXSize=-1,
639 double dfSrcYSize=-1,
640 double dfDstXOff=-1,
double dfDstYOff=-1,
641 double dfDstXSize=-1,
642 double dfDstYSize=-1 );
647 void ConfigureSource(VRTSimpleSource *poSimpleSource,
650 double dfSrcXOff,
double dfSrcYOff,
651 double dfSrcXSize,
double dfSrcYSize,
652 double dfDstXOff,
double dfDstYOff,
653 double dfDstXSize,
double dfDstYSize );
655 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
657 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
658 int *pnMaxSize,
CPLHashSet* hSetFiles)
override;
660 virtual int CloseDependentDatasets()
override;
662 virtual int IsSourcedRasterBand()
override {
return TRUE; }
664 virtual CPLErr FlushCache()
override;
671 class CPL_DLL VRTWarpedRasterBand final:
public VRTRasterBand
676 virtual ~VRTWarpedRasterBand();
678 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
680 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
681 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
683 virtual int GetOverviewCount()
override;
690 class VRTPansharpenedRasterBand final:
public VRTRasterBand
692 int m_nIndexAsPansharpenedBand;
695 VRTPansharpenedRasterBand(
698 virtual ~VRTPansharpenedRasterBand();
700 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
702 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
705 int nXOff,
int nYOff,
int nXSize,
int nYSize,
706 void * pData,
int nBufXSize,
int nBufYSize,
711 virtual int GetOverviewCount()
override;
714 virtual int IsPansharpenRasterBand()
override {
return TRUE; }
716 void SetIndexAsPansharpenedBand(
int nIdx )
717 { m_nIndexAsPansharpenedBand = nIdx; }
718 int GetIndexAsPansharpenedBand()
const
719 {
return m_nIndexAsPansharpenedBand; }
726 class VRTDerivedRasterBandPrivateData;
728 class CPL_DLL VRTDerivedRasterBand
CPL_NON_FINAL:
public VRTSourcedRasterBand
730 VRTDerivedRasterBandPrivateData* m_poPrivate;
731 bool InitializePython();
739 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand );
740 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand,
742 virtual ~VRTDerivedRasterBand();
749 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
750 int nXSize,
int nYSize,
752 double* pdfDataPct)
override;
754 static CPLErr AddPixelFunction(
const char *pszFuncName,
758 void SetPixelFunctionName(
const char *pszFuncName );
760 void SetPixelFunctionLanguage(
const char* pszLanguage );
763 std::map<CPLString, GDALDataset*>& )
override;
764 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
766 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
767 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
768 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
769 virtual CPLErr ComputeStatistics(
int bApproxOK,
770 double *pdfMin,
double *pdfMax,
771 double *pdfMean,
double *pdfStdDev,
772 GDALProgressFunc pfnProgress,
773 void *pProgressData )
override;
774 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
775 int nBuckets,
GUIntBig * panHistogram,
776 int bIncludeOutOfRange,
int bApproxOK,
777 GDALProgressFunc pfnProgress,
778 void *pProgressData )
override;
780 static void Cleanup();
789 class CPL_DLL VRTRawRasterBand
CPL_NON_FINAL:
public VRTRasterBand
791 RawRasterBand *m_poRawRaster;
793 char *m_pszSourceFilename;
794 int m_bRelativeToVRT;
801 virtual ~VRTRawRasterBand();
804 std::map<CPLString, GDALDataset*>& )
override;
805 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
812 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
813 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
815 CPLErr SetRawLink(
const char *pszFilename,
816 const char *pszVRTPath,
819 int nPixelOffset,
int nLineOffset,
820 const char *pszByteOrder );
827 char **papszOptions )
override;
829 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
830 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
843 virtual ~VRTDriver();
845 char **papszSourceParsers;
848 virtual char **
GetMetadata(
const char * pszDomain =
"" )
override;
850 const char * pszDomain =
"" )
override;
852 VRTSource *ParseSource(
CPLXMLNode *psSrc,
const char *pszVRTPath,
854 std::map<CPLString, GDALDataset*>& oMapSharedSources );
855 void AddSourceParser(
const char *pszElementName,
856 VRTSourceParser pfnParser );
863 class CPL_DLL VRTSimpleSource
CPL_NON_FINAL:
public VRTSource
868 friend class VRTSourcedRasterBand;
887 double m_dfNoDataValue;
892 int m_bRelativeToVRTOri;
894 int m_nExplicitSharedStatus;
896 int NeedMaxValAdjustment()
const;
900 VRTSimpleSource(
const VRTSimpleSource* poSrcSource,
901 double dfXDstRatio,
double dfYDstRatio );
902 virtual ~VRTSimpleSource();
905 std::map<CPLString, GDALDataset*>& )
override;
906 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
910 void SetSrcWindow(
double,
double,
double,
double );
911 void SetDstWindow(
double,
double,
double,
double );
912 void SetNoDataValue(
double dfNoDataValue );
913 const CPLString& GetResampling()
const {
return m_osResampling; }
914 void SetResampling(
const char* pszResampling );
916 int GetSrcDstWindow(
int,
int,
int,
int,
int,
int,
917 double *pdfReqXOff,
double *pdfReqYOff,
918 double *pdfReqXSize,
double *pdfReqYSize,
919 int *,
int *,
int *,
int *,
920 int *,
int *,
int *,
int * );
923 int nXOff,
int nYOff,
int nXSize,
int nYSize,
924 void *pData,
int nBufXSize,
int nBufYSize,
929 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
930 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
931 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
932 double* adfMinMax )
override;
933 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
935 double *pdfMin,
double *pdfMax,
936 double *pdfMean,
double *pdfStdDev,
937 GDALProgressFunc pfnProgress,
938 void *pProgressData )
override;
939 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
940 double dfMin,
double dfMax,
941 int nBuckets,
GUIntBig * panHistogram,
942 int bIncludeOutOfRange,
int bApproxOK,
943 GDALProgressFunc pfnProgress,
944 void *pProgressData )
override;
946 void DstToSrc(
double dfX,
double dfY,
947 double &dfXOut,
double &dfYOut )
const;
948 void SrcToDst(
double dfX,
double dfY,
949 double &dfXOut,
double &dfYOut )
const;
951 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
952 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
954 virtual int IsSimpleSource()
override {
return TRUE; }
955 virtual const char* GetType() {
return "SimpleSource"; }
956 virtual CPLErr FlushCache()
override;
959 GDALRasterBand* GetMaskBandMainBand() {
return m_poMaskBandMainBand; }
960 int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
963 int nXOff,
int nYOff,
int nXSize,
int nYSize,
964 void * pData,
int nBufXSize,
int nBufYSize,
966 int nBandCount,
int *panBandMap,
971 void UnsetPreservedRelativeFilenames();
973 void SetMaxValue(
int nVal ) { m_nMaxValue = nVal; }
980 class VRTAveragedSource final:
public VRTSimpleSource
987 int nXOff,
int nYOff,
int nXSize,
int nYSize,
988 void *pData,
int nBufXSize,
int nBufYSize,
993 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
994 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
995 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
996 double* adfMinMax )
override;
997 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
999 double *pdfMin,
double *pdfMax,
1000 double *pdfMean,
double *pdfStdDev,
1001 GDALProgressFunc pfnProgress,
1002 void *pProgressData )
override;
1003 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1004 double dfMin,
double dfMax,
1005 int nBuckets,
GUIntBig * panHistogram,
1006 int bIncludeOutOfRange,
int bApproxOK,
1007 GDALProgressFunc pfnProgress,
1008 void *pProgressData )
override;
1010 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1011 virtual const char* GetType()
override {
return "AveragedSource"; }
1022 VRT_SCALING_EXPONENTIAL,
1023 } VRTComplexSourceScaling;
1025 class CPL_DLL VRTComplexSource
CPL_NON_FINAL:
public VRTSimpleSource
1028 bool AreValuesUnchanged()
const;
1031 VRTComplexSourceScaling m_eScalingType;
1032 double m_dfScaleOff;
1033 double m_dfScaleRatio;
1036 int m_bSrcMinMaxDefined;
1041 double m_dfExponent;
1043 int m_nColorTableComponent;
1045 template <
class WorkingDT>
1046 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
1047 int nReqXSize,
int nReqYSize,
1048 void *pData,
int nOutXSize,
int nOutYSize,
1056 VRTComplexSource(
const VRTComplexSource* poSrcSource,
1057 double dfXDstRatio,
double dfYDstRatio);
1058 virtual ~VRTComplexSource();
1061 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1062 void *pData,
int nBufXSize,
int nBufYSize,
1067 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1068 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1069 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1070 double* adfMinMax )
override;
1071 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1073 double *pdfMin,
double *pdfMax,
1074 double *pdfMean,
double *pdfStdDev,
1075 GDALProgressFunc pfnProgress,
1076 void *pProgressData )
override;
1077 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1078 double dfMin,
double dfMax,
1079 int nBuckets,
GUIntBig * panHistogram,
1080 int bIncludeOutOfRange,
int bApproxOK,
1081 GDALProgressFunc pfnProgress,
1082 void *pProgressData )
override;
1084 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1086 std::map<CPLString, GDALDataset*>& )
override;
1087 virtual const char* GetType()
override {
return "ComplexSource"; }
1089 double LookupValue(
double dfInput );
1091 void SetLinearScaling(
double dfOffset,
double dfScale );
1092 void SetPowerScaling(
double dfExponent,
1097 void SetColorTableComponent(
int nComponent );
1099 double *m_padfLUTInputs;
1100 double *m_padfLUTOutputs;
1101 int m_nLUTItemCount;
1108 class VRTFilteredSource
CPL_NON_FINAL:
public VRTComplexSource
1116 int m_nSupportedTypesCount;
1119 int m_nExtraEdgePixels;
1122 VRTFilteredSource();
1123 virtual ~VRTFilteredSource();
1125 void SetExtraEdgePixels(
int );
1126 void SetFilteringDataTypesSupported(
int,
GDALDataType * );
1129 GByte *pabySrcData,
GByte *pabyDstData ) = 0;
1132 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1133 void *pData,
int nBufXSize,
int nBufYSize,
1143 class VRTKernelFilteredSource
CPL_NON_FINAL:
public VRTFilteredSource
1152 double *m_padfKernelCoefs;
1157 VRTKernelFilteredSource();
1158 virtual ~VRTKernelFilteredSource();
1161 std::map<CPLString, GDALDataset*>& )
override;
1162 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1165 GByte *pabySrcData,
GByte *pabyDstData )
override;
1167 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs );
1168 void SetNormalized(
int );
1175 class VRTAverageFilteredSource final:
public VRTKernelFilteredSource
1180 explicit VRTAverageFilteredSource(
int nKernelSize );
1181 virtual ~VRTAverageFilteredSource();
1184 std::map<CPLString, GDALDataset*>& )
override;
1185 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1191 class VRTFuncSource final:
public VRTSource
1197 virtual ~VRTFuncSource();
1200 std::map<CPLString, GDALDataset*>& )
override {
return CE_Failure; }
1201 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1204 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1205 void *pData,
int nBufXSize,
int nBufYSize,
1210 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1211 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1212 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1213 double* adfMinMax )
override;
1214 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1216 double *pdfMin,
double *pdfMax,
1217 double *pdfMean,
double *pdfStdDev,
1218 GDALProgressFunc pfnProgress,
1219 void *pProgressData )
override;
1220 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1221 double dfMin,
double dfMax,
1222 int nBuckets,
GUIntBig * panHistogram,
1223 int bIncludeOutOfRange,
int bApproxOK,
1224 GDALProgressFunc pfnProgress,
1225 void *pProgressData )
override;
1239 #define TMP_CPL_DLL CPL_DLL
1254 explicit Ref(VRTGroup* ptr): m_ptr(ptr) {}
1255 Ref(
const Ref&) =
delete;
1256 Ref& operator=(
const Ref&) =
delete;
1260 std::shared_ptr<Ref> m_poSharedRefRootGroup{};
1261 std::weak_ptr<Ref> m_poWeakRefRootGroup{};
1262 std::shared_ptr<Ref> m_poRefSelf{};
1264 std::string m_osFilename{};
1265 mutable bool m_bDirty =
false;
1266 std::string m_osVRTPath{};
1267 std::map<std::string, std::shared_ptr<VRTGroup>> m_oMapGroups{};
1268 std::map<std::string, std::shared_ptr<VRTMDArray>> m_oMapMDArrays{};
1269 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1270 std::map<std::string, std::shared_ptr<VRTDimension>> m_oMapDimensions{};
1272 std::shared_ptr<VRTGroup> OpenGroupInternal(
const std::string& osName)
const;
1273 void SetRootGroupRef(
const std::weak_ptr<Ref>& rgRef);
1274 std::weak_ptr<Ref> GetRootGroupRef()
const;
1278 VRTGroup(
const std::string& osParentName,
const std::string& osName);
1281 bool XMLInit(
const std::shared_ptr<VRTGroup>& poRoot,
1282 const std::shared_ptr<VRTGroup>& poThisGroup,
1284 const char* pszVRTPath);
1287 std::shared_ptr<GDALMDArray>
OpenMDArray(
const std::string& osName,
1291 std::shared_ptr<GDALGroup>
OpenGroup(
const std::string& osName,
1294 return OpenGroupInternal(osName);
1301 std::shared_ptr<VRTDimension> GetDimension(
const std::string& name)
const {
1302 auto oIter = m_oMapDimensions.find(name);
1303 return oIter == m_oMapDimensions.end() ? nullptr : oIter->second;
1305 std::shared_ptr<VRTDimension> GetDimensionFromFullName(
const std::string& name,
1306 bool bEmitError)
const;
1308 std::shared_ptr<GDALGroup>
CreateGroup(
const std::string& osName,
1311 std::shared_ptr<GDALDimension>
CreateDimension(
const std::string& osName,
1312 const std::string& osType,
1313 const std::string& osDirection,
1318 const std::string& osName,
1319 const std::vector<GUInt64>& anDimensions,
1323 std::shared_ptr<GDALMDArray>
CreateMDArray(
const std::string& osName,
1324 const std::vector<std::shared_ptr<GDALDimension>>& aoDimensions,
1328 void SetIsRootGroup();
1330 const std::shared_ptr<Ref>& GetRef()
const {
return m_poRefSelf; }
1331 VRTGroup* GetRootGroup()
const;
1333 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1335 void SetFilename(
const std::string& osFilename) { m_osFilename = osFilename; }
1336 void Serialize()
const;
1337 CPLXMLNode* SerializeToXML(
const char *pszVRTPathIn )
const;
1338 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn)
const;
1347 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1348 std::string m_osIndexingVariableName;
1351 VRTDimension(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1352 const std::string& osParentName,
1353 const std::string& osName,
1354 const std::string& osType,
1355 const std::string& osDirection,
1357 const std::string& osIndexingVariableName):
1358 GDALDimension(osParentName, osName, osType, osDirection, nSize),
1359 m_poGroupRef(poGroupRef),
1360 m_osIndexingVariableName(osIndexingVariableName)
1363 VRTGroup* GetGroup()
const;
1365 static std::shared_ptr<VRTDimension> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1366 const std::string& osParentName,
1383 std::vector<std::string> m_aosList{};
1384 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
1388 bool IRead(
const GUInt64* arrayStartIdx,
1389 const size_t* count,
1393 void* pDstBuffer)
const override;
1395 bool IWrite(
const GUInt64* arrayStartIdx,
1396 const size_t* count,
1400 const void* pSrcBuffer)
override;
1404 VRTAttribute(
const std::string& osParentName,
1405 const std::string& osName,
1407 std::vector<std::string>&& aosList):
1411 m_aosList(std::move(aosList))
1413 if( m_aosList.size() > 1 )
1415 m_dims.emplace_back(std::make_shared<GDALDimension>(
1416 std::string(),
"dim",
1417 std::string(), std::string(), m_aosList.size()));
1421 VRTAttribute(
const std::string& osParentName,
1422 const std::string& osName,
1431 m_dims.emplace_back(std::make_shared<GDALDimension>(
1432 std::string(),
"dim",
1433 std::string(), std::string(), nDim));
1437 static bool CreationCommonChecks(
const std::string& osName,
1438 const std::vector<GUInt64>& anDimensions,
1439 const std::map<std::string, std::shared_ptr<VRTAttribute>>& oMapAttributes);
1441 static std::shared_ptr<VRTAttribute> Create(
const std::string& osParentName,
1444 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1455 class VRTMDArraySource
1458 virtual ~VRTMDArraySource() =
default;
1460 virtual bool Read(
const GUInt64* arrayStartIdx,
1461 const size_t* count,
1465 void* pDstBuffer)
const = 0;
1467 virtual void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const = 0;
1477 friend class VRTGroup;
1479 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1480 std::string m_osVRTPath{};
1483 std::vector<std::shared_ptr<GDALDimension>> m_dims;
1484 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1485 std::vector<std::unique_ptr<VRTMDArraySource>> m_sources{};
1486 std::shared_ptr<OGRSpatialReference> m_poSRS{};
1487 std::vector<GByte> m_abyNoData{};
1488 std::string m_osUnit{};
1489 double m_dfScale = 1.0;
1490 double m_dfOffset = 0.0;
1491 bool m_bHasScale =
false;
1492 bool m_bHasOffset =
false;
1494 bool IRead(
const GUInt64* arrayStartIdx,
1495 const size_t* count,
1499 void* pDstBuffer)
const override;
1504 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1505 const std::string& osParentName,
1506 const std::string& osName,
1508 std::vector<std::shared_ptr<GDALDimension>>&& dims,
1509 std::map<std::string, std::shared_ptr<VRTAttribute>>&& oMapAttributes) :
1512 m_poGroupRef(poGroupRef),
1513 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1515 m_dims(std::move(dims)),
1516 m_oMapAttributes(std::move(oMapAttributes))
1520 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1521 const std::string& osParentName,
1522 const std::string& osName,
1523 const std::vector<std::shared_ptr<GDALDimension>>& dims,
1527 m_poGroupRef(poGroupRef),
1528 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1534 bool IsWritable()
const override {
return false; }
1536 static std::shared_ptr<VRTMDArray> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1537 const std::string& osParentName,
1540 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1548 std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const override {
return m_poSRS; }
1554 const std::string&
GetUnit()
const override {
return m_osUnit; }
1556 bool SetUnit(
const std::string& osUnit)
override {
1557 m_osUnit = osUnit;
return true; }
1559 double GetOffset(
bool* pbHasOffset)
const override
1561 if( pbHasOffset) *pbHasOffset = m_bHasOffset;
1565 double GetScale(
bool* pbHasScale)
const override
1567 if( pbHasScale) *pbHasScale = m_bHasScale;
1571 bool SetOffset(
double dfOffset)
override
1572 { SetDirty(); m_bHasOffset =
true; m_dfOffset = dfOffset;
return true; }
1574 bool SetScale(
double dfScale)
override
1575 { SetDirty(); m_bHasScale =
true; m_dfScale = dfScale;
return true; }
1577 void AddSource(std::unique_ptr<VRTMDArraySource>&& poSource);
1580 const std::string& osName,
1581 const std::vector<GUInt64>& anDimensions,
1590 GDALProgressFunc pfnProgress,
1591 void * pProgressData)
override;
1593 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn )
const;
1595 VRTGroup* GetGroup()
const;
1597 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1604 class VRTMDArraySourceInlinedValues final:
public VRTMDArraySource
1606 const VRTMDArray* m_poDstArray =
nullptr;
1607 bool m_bIsConstantValue;
1608 std::vector<GUInt64> m_anOffset{};
1609 std::vector<size_t> m_anCount{};
1610 std::vector<GByte> m_abyValues{};
1611 std::vector<size_t> m_anInlinedArrayStrideInBytes{};
1614 VRTMDArraySourceInlinedValues(
const VRTMDArraySourceInlinedValues&) =
delete;
1615 VRTMDArraySourceInlinedValues& operator=(
const VRTMDArraySourceInlinedValues&) =
delete;
1618 VRTMDArraySourceInlinedValues(
const VRTMDArray* poDstArray,
1619 bool bIsConstantValue,
1620 std::vector<GUInt64>&& anOffset,
1621 std::vector<size_t>&& anCount,
1622 std::vector<GByte>&& abyValues):
1623 m_poDstArray(poDstArray),
1624 m_bIsConstantValue(bIsConstantValue),
1625 m_anOffset(std::move(anOffset)),
1626 m_anCount(std::move(anCount)),
1627 m_abyValues(std::move(abyValues)),
1628 m_dt(poDstArray->GetDataType())
1630 const auto nDims(poDstArray->GetDimensionCount());
1631 m_anInlinedArrayStrideInBytes.resize(nDims);
1632 if( !bIsConstantValue && nDims > 0 )
1634 m_anInlinedArrayStrideInBytes.back() = poDstArray->GetDataType().GetSize();
1635 for(
size_t i = nDims - 1; i > 0; )
1638 m_anInlinedArrayStrideInBytes[i] =
1639 m_anInlinedArrayStrideInBytes[i+1] * m_anCount[i+1];
1644 ~VRTMDArraySourceInlinedValues();
1646 static std::unique_ptr<VRTMDArraySourceInlinedValues> Create(
1647 const VRTMDArray* poDstArray,
1650 bool Read(
const GUInt64* arrayStartIdx,
1651 const size_t* count,
1655 void* pDstBuffer)
const override;
1657 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1664 class VRTMDArraySourceRegularlySpaced final:
public VRTMDArraySource
1667 double m_dfIncrement;
1670 VRTMDArraySourceRegularlySpaced(
1671 double dfStart,
double dfIncrement):
1673 m_dfIncrement(dfIncrement)
1677 bool Read(
const GUInt64* arrayStartIdx,
1678 const size_t* count,
1682 void* pDstBuffer)
const override;
1684 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1691 class VRTMDArraySourceFromArray final:
public VRTMDArraySource
1693 const VRTMDArray* m_poDstArray =
nullptr;
1694 bool m_bRelativeToVRTSet =
false;
1695 bool m_bRelativeToVRT =
false;
1696 std::string m_osFilename{};
1697 std::string m_osArray{};
1698 std::string m_osBand{};
1699 std::vector<int> m_anTransposedAxis{};
1700 std::string m_osViewExpr{};
1701 std::vector<GUInt64> m_anSrcOffset{};
1702 mutable std::vector<GUInt64> m_anCount{};
1703 std::vector<GUInt64> m_anStep{};
1704 std::vector<GUInt64> m_anDstOffset{};
1706 VRTMDArraySourceFromArray(
const VRTMDArraySourceFromArray&) =
delete;
1707 VRTMDArraySourceFromArray& operator=(
const VRTMDArraySourceFromArray&) =
delete;
1710 VRTMDArraySourceFromArray(
const VRTMDArray* poDstArray,
1711 bool bRelativeToVRTSet,
1712 bool bRelativeToVRT,
1713 const std::string& osFilename,
1714 const std::string& osArray,
1715 const std::string& osBand,
1716 std::vector<int>&& anTransposedAxis,
1717 const std::string& osViewExpr,
1718 std::vector<GUInt64>&& anSrcOffset,
1719 std::vector<GUInt64>&& anCount,
1720 std::vector<GUInt64>&& anStep,
1721 std::vector<GUInt64>&& anDstOffset):
1722 m_poDstArray(poDstArray),
1723 m_bRelativeToVRTSet(bRelativeToVRTSet),
1724 m_bRelativeToVRT(bRelativeToVRT),
1725 m_osFilename(osFilename),
1728 m_anTransposedAxis(std::move(anTransposedAxis)),
1729 m_osViewExpr(osViewExpr),
1730 m_anSrcOffset(std::move(anSrcOffset)),
1731 m_anCount(std::move(anCount)),
1732 m_anStep(std::move(anStep)),
1733 m_anDstOffset(std::move(anDstOffset))
1737 ~VRTMDArraySourceFromArray()
override;
1739 static std::unique_ptr<VRTMDArraySourceFromArray> Create(
1740 const VRTMDArray* poDstArray,
1743 bool Read(
const GUInt64* arrayStartIdx,
1744 const size_t* count,
1748 void* pDstBuffer)
const override;
1750 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
virtual std::shared_ptr< GDALMDArray > CreateMDArray(const std::string &osName, const std::vector< std::shared_ptr< GDALDimension >> &aoDimensions, const GDALExtendedDataType &oDataType, CSLConstList papszOptions=nullptr)
Create a multidimensional array within a group.
Definition: gdalmultidim.cpp:399
int GetShared() const
Returns shared flag.
Definition: gdaldataset.cpp:1438
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1674
virtual bool SetIndexingVariable(std::shared_ptr< GDALMDArray > poIndexingVariable)
Set the variable that is used to index the dimension.
Definition: gdalmultidim.cpp:5359
virtual const std::string & GetUnit() const
Return the array unit.
Definition: gdalmultidim.cpp:1555
virtual std::shared_ptr< OGRSpatialReference > GetSpatialRef() const
Return the spatial reference system object associated with the array.
Definition: gdalmultidim.cpp:1583
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2050
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
Class used to represent potentially complex data types.
Definition: gdal_priv.h:1772
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition: cpl_port.h:269
Class for dataset open functions.
Definition: gdal_priv.h:267
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2627
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:1728
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2425
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2099
#define VRT_NODATA_UNSET
Special value to indicate that nodata is not set.
Definition: gdal_vrt.h:45
virtual CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets, GUIntBig **ppanHistogram, int bForce, GDALProgressFunc, void *pProgressData)
Fetch default raster histogram.
Definition: gdalrasterband.cpp:3469
void * VRTDatasetH
Opaque type for a VRT dataset.
Definition: gdal_vrt.h:76
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition: gdalrasterband.cpp:2837
virtual bool SetUnit(const std::string &osUnit)
Set the variable unit.
Definition: gdalmultidim.cpp:1533
virtual CPLErr AddBand(GDALDataType eType, char **papszOptions=nullptr)
Add a band to a dataset.
Definition: gdaldataset.cpp:570
virtual bool IsWritable() const =0
Return whether an array is writable;.
virtual std::shared_ptr< GDALGroup > GetRootGroup() const
Return the root GDALGroup of this dataset.
Definition: gdaldataset.cpp:8049
virtual double GetScale(bool *pbHasScale=nullptr) const
Get the scale value to apply to raw values.
Definition: gdalmultidim.cpp:1768
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:442
@ GDT_Unknown
Definition: gdal.h:61
Definitions for CPL mini XML Parser/Serializer.
Format specific driver.
Definition: gdal_priv.h:1455
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:158
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition: gdal_priv.h:2023
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:5723
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3624
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:2675
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:1958
Public (C callable) entry points for virtual GDAL dataset objects.
virtual std::shared_ptr< GDALDimension > CreateDimension(const std::string &osName, const std::string &osType, const std::string &osDirection, GUInt64 nSize, CSLConstList papszOptions=nullptr)
Create a dimension within a group.
Definition: gdalmultidim.cpp:359
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1515
virtual const std::vector< std::shared_ptr< GDALDimension > > & GetDimensions() const =0
Return the dimensions of an attribute/array.
GDALColorInterp
Definition: gdal.h:194
virtual void SetDescription(const char *)
Set object description.
Definition: gdalmajorobject.cpp:120
Convenient string class based on std::string.
Definition: cpl_string.h:333
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:418
A single raster band (or channel).
Definition: gdal_priv.h:1099
GIntBig GInt64
Signed 64 bit integer type.
Definition: cpl_port.h:267
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:113
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition: cpl_port.h:289
#define CPL_NON_FINAL
Mark that a class is explicitly recognized as non-final.
Definition: cpl_port.h:996
virtual CPLErr AdviseRead(int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eDT, int nBandCount, int *panBandList, char **papszOptions)
Advise driver of upcoming read requests.
Definition: gdaldataset.cpp:2762
void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:4047
GDALDataType
Definition: gdal.h:60
Document node structure.
Definition: cpl_minixml.h:70
High level image warping class.
Definition: gdalwarper.h:444
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1783
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1678
Class modeling a named container of GDALAttribute, GDALMDArray or other GDALGroup.
Definition: gdal_priv.h:1936
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:338
virtual bool SetScale(double dfScale)
Set the scale value to apply to raw values.
Definition: gdalmultidim.cpp:1722
virtual std::vector< std::string > GetGroupNames(CSLConstList papszOptions=nullptr) const
Return the list of sub-groups contained in this group.
Definition: gdalmultidim.cpp:238
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:52
virtual int GetOverviewCount()
Return the number of overview layers available.
Definition: gdalrasterband.cpp:2184
Class modeling a multi-dimensional array.
Definition: gdal_priv.h:2316
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:5870
virtual bool SetSpatialRef(const OGRSpatialReference *poSRS)
Assign a spatial reference system object to the the array.
Definition: gdalmultidim.cpp:1569
virtual GDALRasterBand * GetMaskBand()
Return the mask band associated with the band.
Definition: gdalrasterband.cpp:5955
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
virtual double GetOffset(bool *pbHasOffset=nullptr) const
Get the offset value to apply to raw values.
Definition: gdalmultidim.cpp:1794
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1212
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
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:639
virtual std::shared_ptr< GDALGroup > CreateGroup(const std::string &osName, CSLConstList papszOptions=nullptr)
Create a sub-group within a group.
Definition: gdalmultidim.cpp:330
virtual const OGRSpatialReference * GetGCPSpatialRef() const
Get output spatial reference system for GCPs.
Definition: gdaldataset.cpp:1595
virtual CPLErr SetSpatialRef(const OGRSpatialReference *poSRS)
Set the spatial reference system for this dataset.
Definition: gdaldataset.cpp:1040
int Dereference()
Subtract one from dataset reference count.
Definition: gdaldataset.cpp:1366
Ground Control Point.
Definition: gdal.h:664
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition: gdal_priv.h:2502
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1500
virtual GDALRasterBand * GetOverview(int)
Fetch overview raster band object.
Definition: gdalrasterband.cpp:2226
virtual const GDALExtendedDataType & GetDataType() const =0
Return the data type of an attribute/array.
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
virtual bool SetRawNoDataValue(const void *pRawNoData)
Set the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:1674
virtual CPLErr SetScale(double dfNewScale)
Set scaling ratio.
Definition: gdalrasterband.cpp:2580
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: gdalmajorobject.cpp:292
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3995
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:3034
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:51
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:276
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:140
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1615
GDALAccess
Definition: gdal.h:113
@ GA_ReadOnly
Definition: gdal.h:114
virtual std::shared_ptr< GDALMDArray > GetIndexingVariable() const
Return the variable that is used to index the dimension (if there is one).
Definition: gdalmultidim.cpp:5338
virtual const OGRSpatialReference * GetSpatialRef() const
Fetch the spatial reference for this dataset.
Definition: gdaldataset.cpp:909
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:1213
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:144
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2923
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:5822
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2531
GDALRWFlag
Definition: gdal.h:119
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:2608
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:2003
virtual std::vector< std::shared_ptr< GDALDimension > > GetDimensions(CSLConstList papszOptions=nullptr) const
Return the list of dimensions contained in this group and used by its arrays.
Definition: gdalmultidim.cpp:288
Object with metadata.
Definition: gdal_priv.h:134
Pansharpening operation class.
Definition: gdalpansharpen.h:189
virtual bool SetOffset(double dfOffset)
Set the offset value to apply to raw values.
Definition: gdalmultidim.cpp:1743
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
CPLErr
Error category.
Definition: cpl_error.h:53
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition: gdal_priv.h:2199
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
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:874
virtual CPLErr SetCategoryNames(char **papszNames)
Set the category names for this band.
Definition: gdalrasterband.cpp:1563
virtual CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc, void *pProgressData)
Compute raster histogram.
Definition: gdalrasterband.cpp:2927
virtual std::vector< std::string > GetMDArrayNames(CSLConstList papszOptions=nullptr) const
Return the list of multidimensional array names contained in this group.
Definition: gdalmultidim.cpp:190
virtual int GetMaskFlags()
Return the status flags of the mask band associated with the band.
Definition: gdalrasterband.cpp:6220
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:1158
virtual std::shared_ptr< GDALGroup > OpenGroup(const std::string &osName, CSLConstList papszOptions=nullptr) const
Open and return a sub-group.
Definition: gdalmultidim.cpp:262
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the current band.
Definition: gdalrasterband.cpp:6301
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:48
virtual const void * GetRawNoDataValue() const
Return the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:1609
virtual std::shared_ptr< GDALMDArray > OpenMDArray(const std::string &osName, CSLConstList papszOptions=nullptr) const
Open and return a multidimensional array.
Definition: gdalmultidim.cpp:214
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2474
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:261
VRTDatasetH VRTCreate(int, int)
Definition: vrtdataset.cpp:88
#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:1003
A color table / palette.
Definition: gdal_priv.h:993