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;
443 int m_bNoDataValueSet;
445 int m_bHideNoDataValue;
446 double m_dfNoDataValue;
448 std::unique_ptr<GDALColorTable> m_poColorTable{};
453 char **m_papszCategoryNames;
460 void Initialize(
int nXSize,
int nYSize );
462 std::vector<VRTOverviewInfo> m_apoOverviews{};
464 VRTRasterBand *m_poMaskBand;
466 std::unique_ptr<GDALRasterAttributeTable> m_poRAT{};
473 virtual ~VRTRasterBand();
476 std::map<CPLString, GDALDataset*>& );
477 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath );
480 virtual double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
498 virtual CPLErr SetMetadata(
char **papszMD,
const char *pszDomain =
"" )
override;
500 const char *pszDomain =
"" )
override;
502 virtual double GetOffset(
int *pbSuccess =
nullptr )
override;
504 virtual double GetScale(
int *pbSuccess =
nullptr )
override;
511 int nBuckets,
GUIntBig * panHistogram,
512 int bIncludeOutOfRange,
int bApproxOK,
513 GDALProgressFunc,
void *pProgressData )
override;
516 int *pnBuckets,
GUIntBig ** ppanHistogram,
518 GDALProgressFunc,
void *pProgressData)
override;
521 int nBuckets,
GUIntBig *panHistogram )
override;
525 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
535 void SetMaskBand(VRTRasterBand* poMaskBand);
537 void SetIsMaskBand();
539 CPLErr UnsetNoDataValue();
541 virtual int CloseDependentDatasets();
543 virtual int IsSourcedRasterBand() {
return FALSE; }
544 virtual int IsPansharpenRasterBand() {
return FALSE; }
551 class VRTSimpleSource;
553 class CPL_DLL VRTSourcedRasterBand
CPL_NON_FINAL:
public VRTRasterBand
556 int m_nRecursionCounter;
558 char **m_papszSourceList;
560 bool CanUseSourcesMinMaxImplementations();
561 void CheckSource( VRTSimpleSource *poSS );
567 VRTSource **papoSources;
568 int bSkipBufferInitialization;
570 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand );
572 int nXSize,
int nYSize );
573 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand,
575 int nXSize,
int nYSize );
576 virtual ~VRTSourcedRasterBand();
583 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
584 int nXSize,
int nYSize,
586 double* pdfDataPct)
override;
588 virtual char **GetMetadataDomainList()
override;
589 virtual const char *GetMetadataItem(
const char * pszName,
590 const char * pszDomain =
"" )
override;
591 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
592 virtual CPLErr SetMetadata(
char ** papszMetadata,
593 const char * pszDomain =
"" )
override;
594 virtual CPLErr SetMetadataItem(
const char * pszName,
595 const char * pszValue,
596 const char * pszDomain =
"" )
override;
599 std::map<CPLString, GDALDataset*>& )
override;
600 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
602 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
603 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
604 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
605 virtual CPLErr ComputeStatistics(
int bApproxOK,
606 double *pdfMin,
double *pdfMax,
607 double *pdfMean,
double *pdfStdDev,
608 GDALProgressFunc pfnProgress,
609 void *pProgressData )
override;
610 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
611 int nBuckets,
GUIntBig * panHistogram,
612 int bIncludeOutOfRange,
int bApproxOK,
613 GDALProgressFunc pfnProgress,
614 void *pProgressData )
override;
616 CPLErr AddSource( VRTSource * );
618 double dfSrcXOff=-1,
double dfSrcYOff=-1,
619 double dfSrcXSize=-1,
double dfSrcYSize=-1,
620 double dfDstXOff=-1,
double dfDstYOff=-1,
621 double dfDstXSize=-1,
double dfDstYSize=-1,
622 const char *pszResampling =
"near",
625 double dfSrcXOff=-1,
double dfSrcYOff=-1,
626 double dfSrcXSize=-1,
double dfSrcYSize=-1,
627 double dfDstXOff=-1,
double dfDstYOff=-1,
628 double dfDstXSize=-1,
double dfDstYSize=-1,
629 double dfScaleOff=0.0,
630 double dfScaleRatio=1.0,
632 int nColorTableComponent = 0);
635 double dfSrcXOff=-1,
double dfSrcYOff=-1,
636 double dfSrcXSize=-1,
637 double dfSrcYSize=-1,
638 double dfDstXOff=-1,
double dfDstYOff=-1,
639 double dfDstXSize=-1,
640 double dfDstYSize=-1 );
645 void ConfigureSource(VRTSimpleSource *poSimpleSource,
648 double dfSrcXOff,
double dfSrcYOff,
649 double dfSrcXSize,
double dfSrcYSize,
650 double dfDstXOff,
double dfDstYOff,
651 double dfDstXSize,
double dfDstYSize );
653 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
655 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
656 int *pnMaxSize,
CPLHashSet* hSetFiles)
override;
658 virtual int CloseDependentDatasets()
override;
660 virtual int IsSourcedRasterBand()
override {
return TRUE; }
662 virtual CPLErr FlushCache()
override;
669 class CPL_DLL VRTWarpedRasterBand final:
public VRTRasterBand
674 virtual ~VRTWarpedRasterBand();
676 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
678 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
679 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
681 virtual int GetOverviewCount()
override;
688 class VRTPansharpenedRasterBand final:
public VRTRasterBand
690 int m_nIndexAsPansharpenedBand;
693 VRTPansharpenedRasterBand(
696 virtual ~VRTPansharpenedRasterBand();
698 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
700 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
703 int nXOff,
int nYOff,
int nXSize,
int nYSize,
704 void * pData,
int nBufXSize,
int nBufYSize,
709 virtual int GetOverviewCount()
override;
712 virtual int IsPansharpenRasterBand()
override {
return TRUE; }
714 void SetIndexAsPansharpenedBand(
int nIdx )
715 { m_nIndexAsPansharpenedBand = nIdx; }
716 int GetIndexAsPansharpenedBand()
const
717 {
return m_nIndexAsPansharpenedBand; }
724 class VRTDerivedRasterBandPrivateData;
726 class CPL_DLL VRTDerivedRasterBand
CPL_NON_FINAL:
public VRTSourcedRasterBand
728 VRTDerivedRasterBandPrivateData* m_poPrivate;
729 bool InitializePython();
737 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand );
738 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand,
740 virtual ~VRTDerivedRasterBand();
747 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
748 int nXSize,
int nYSize,
750 double* pdfDataPct)
override;
752 static CPLErr AddPixelFunction(
const char *pszFuncName,
756 void SetPixelFunctionName(
const char *pszFuncName );
758 void SetPixelFunctionLanguage(
const char* pszLanguage );
761 std::map<CPLString, GDALDataset*>& )
override;
762 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
764 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
765 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
766 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
767 virtual CPLErr ComputeStatistics(
int bApproxOK,
768 double *pdfMin,
double *pdfMax,
769 double *pdfMean,
double *pdfStdDev,
770 GDALProgressFunc pfnProgress,
771 void *pProgressData )
override;
772 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
773 int nBuckets,
GUIntBig * panHistogram,
774 int bIncludeOutOfRange,
int bApproxOK,
775 GDALProgressFunc pfnProgress,
776 void *pProgressData )
override;
778 static void Cleanup();
787 class CPL_DLL VRTRawRasterBand
CPL_NON_FINAL:
public VRTRasterBand
789 RawRasterBand *m_poRawRaster;
791 char *m_pszSourceFilename;
792 int m_bRelativeToVRT;
799 virtual ~VRTRawRasterBand();
802 std::map<CPLString, GDALDataset*>& )
override;
803 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
810 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
811 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
813 CPLErr SetRawLink(
const char *pszFilename,
814 const char *pszVRTPath,
817 int nPixelOffset,
int nLineOffset,
818 const char *pszByteOrder );
825 char **papszOptions )
override;
827 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
828 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
841 virtual ~VRTDriver();
843 char **papszSourceParsers;
846 virtual char **
GetMetadata(
const char * pszDomain =
"" )
override;
848 const char * pszDomain =
"" )
override;
850 VRTSource *ParseSource(
CPLXMLNode *psSrc,
const char *pszVRTPath,
852 std::map<CPLString, GDALDataset*>& oMapSharedSources );
853 void AddSourceParser(
const char *pszElementName,
854 VRTSourceParser pfnParser );
861 class CPL_DLL VRTSimpleSource
CPL_NON_FINAL:
public VRTSource
866 friend class VRTSourcedRasterBand;
885 double m_dfNoDataValue;
890 int m_bRelativeToVRTOri;
892 int m_nExplicitSharedStatus;
894 int NeedMaxValAdjustment()
const;
898 VRTSimpleSource(
const VRTSimpleSource* poSrcSource,
899 double dfXDstRatio,
double dfYDstRatio );
900 virtual ~VRTSimpleSource();
903 std::map<CPLString, GDALDataset*>& )
override;
904 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
908 void SetSrcWindow(
double,
double,
double,
double );
909 void SetDstWindow(
double,
double,
double,
double );
910 void SetNoDataValue(
double dfNoDataValue );
911 const CPLString& GetResampling()
const {
return m_osResampling; }
912 void SetResampling(
const char* pszResampling );
914 int GetSrcDstWindow(
int,
int,
int,
int,
int,
int,
915 double *pdfReqXOff,
double *pdfReqYOff,
916 double *pdfReqXSize,
double *pdfReqYSize,
917 int *,
int *,
int *,
int *,
918 int *,
int *,
int *,
int * );
921 int nXOff,
int nYOff,
int nXSize,
int nYSize,
922 void *pData,
int nBufXSize,
int nBufYSize,
927 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
928 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
929 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
930 double* adfMinMax )
override;
931 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
933 double *pdfMin,
double *pdfMax,
934 double *pdfMean,
double *pdfStdDev,
935 GDALProgressFunc pfnProgress,
936 void *pProgressData )
override;
937 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
938 double dfMin,
double dfMax,
939 int nBuckets,
GUIntBig * panHistogram,
940 int bIncludeOutOfRange,
int bApproxOK,
941 GDALProgressFunc pfnProgress,
942 void *pProgressData )
override;
944 void DstToSrc(
double dfX,
double dfY,
945 double &dfXOut,
double &dfYOut )
const;
946 void SrcToDst(
double dfX,
double dfY,
947 double &dfXOut,
double &dfYOut )
const;
949 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
950 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
952 virtual int IsSimpleSource()
override {
return TRUE; }
953 virtual const char* GetType() {
return "SimpleSource"; }
954 virtual CPLErr FlushCache()
override;
957 GDALRasterBand* GetMaskBandMainBand() {
return m_poMaskBandMainBand; }
958 int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
961 int nXOff,
int nYOff,
int nXSize,
int nYSize,
962 void * pData,
int nBufXSize,
int nBufYSize,
964 int nBandCount,
int *panBandMap,
969 void UnsetPreservedRelativeFilenames();
971 void SetMaxValue(
int nVal ) { m_nMaxValue = nVal; }
978 class VRTAveragedSource final:
public VRTSimpleSource
985 int nXOff,
int nYOff,
int nXSize,
int nYSize,
986 void *pData,
int nBufXSize,
int nBufYSize,
991 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
992 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
993 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
994 double* adfMinMax )
override;
995 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
997 double *pdfMin,
double *pdfMax,
998 double *pdfMean,
double *pdfStdDev,
999 GDALProgressFunc pfnProgress,
1000 void *pProgressData )
override;
1001 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1002 double dfMin,
double dfMax,
1003 int nBuckets,
GUIntBig * panHistogram,
1004 int bIncludeOutOfRange,
int bApproxOK,
1005 GDALProgressFunc pfnProgress,
1006 void *pProgressData )
override;
1008 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1009 virtual const char* GetType()
override {
return "AveragedSource"; }
1020 VRT_SCALING_EXPONENTIAL,
1021 } VRTComplexSourceScaling;
1023 class CPL_DLL VRTComplexSource
CPL_NON_FINAL:
public VRTSimpleSource
1026 bool AreValuesUnchanged()
const;
1029 VRTComplexSourceScaling m_eScalingType;
1030 double m_dfScaleOff;
1031 double m_dfScaleRatio;
1034 int m_bSrcMinMaxDefined;
1039 double m_dfExponent;
1041 int m_nColorTableComponent;
1043 template <
class WorkingDT>
1044 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
1045 int nReqXSize,
int nReqYSize,
1046 void *pData,
int nOutXSize,
int nOutYSize,
1054 VRTComplexSource(
const VRTComplexSource* poSrcSource,
1055 double dfXDstRatio,
double dfYDstRatio);
1056 virtual ~VRTComplexSource();
1059 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1060 void *pData,
int nBufXSize,
int nBufYSize,
1065 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1066 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1067 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1068 double* adfMinMax )
override;
1069 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1071 double *pdfMin,
double *pdfMax,
1072 double *pdfMean,
double *pdfStdDev,
1073 GDALProgressFunc pfnProgress,
1074 void *pProgressData )
override;
1075 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1076 double dfMin,
double dfMax,
1077 int nBuckets,
GUIntBig * panHistogram,
1078 int bIncludeOutOfRange,
int bApproxOK,
1079 GDALProgressFunc pfnProgress,
1080 void *pProgressData )
override;
1082 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1084 std::map<CPLString, GDALDataset*>& )
override;
1085 virtual const char* GetType()
override {
return "ComplexSource"; }
1087 double LookupValue(
double dfInput );
1089 void SetLinearScaling(
double dfOffset,
double dfScale );
1090 void SetPowerScaling(
double dfExponent,
1095 void SetColorTableComponent(
int nComponent );
1097 double *m_padfLUTInputs;
1098 double *m_padfLUTOutputs;
1099 int m_nLUTItemCount;
1106 class VRTFilteredSource
CPL_NON_FINAL:
public VRTComplexSource
1114 int m_nSupportedTypesCount;
1117 int m_nExtraEdgePixels;
1120 VRTFilteredSource();
1121 virtual ~VRTFilteredSource();
1123 void SetExtraEdgePixels(
int );
1124 void SetFilteringDataTypesSupported(
int,
GDALDataType * );
1127 GByte *pabySrcData,
GByte *pabyDstData ) = 0;
1130 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1131 void *pData,
int nBufXSize,
int nBufYSize,
1141 class VRTKernelFilteredSource
CPL_NON_FINAL:
public VRTFilteredSource
1150 double *m_padfKernelCoefs;
1155 VRTKernelFilteredSource();
1156 virtual ~VRTKernelFilteredSource();
1159 std::map<CPLString, GDALDataset*>& )
override;
1160 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1163 GByte *pabySrcData,
GByte *pabyDstData )
override;
1165 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs );
1166 void SetNormalized(
int );
1173 class VRTAverageFilteredSource final:
public VRTKernelFilteredSource
1178 explicit VRTAverageFilteredSource(
int nKernelSize );
1179 virtual ~VRTAverageFilteredSource();
1182 std::map<CPLString, GDALDataset*>& )
override;
1183 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1189 class VRTFuncSource final:
public VRTSource
1195 virtual ~VRTFuncSource();
1198 std::map<CPLString, GDALDataset*>& )
override {
return CE_Failure; }
1199 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1202 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1203 void *pData,
int nBufXSize,
int nBufYSize,
1208 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1209 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1210 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1211 double* adfMinMax )
override;
1212 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1214 double *pdfMin,
double *pdfMax,
1215 double *pdfMean,
double *pdfStdDev,
1216 GDALProgressFunc pfnProgress,
1217 void *pProgressData )
override;
1218 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1219 double dfMin,
double dfMax,
1220 int nBuckets,
GUIntBig * panHistogram,
1221 int bIncludeOutOfRange,
int bApproxOK,
1222 GDALProgressFunc pfnProgress,
1223 void *pProgressData )
override;
1237 #define TMP_CPL_DLL CPL_DLL
1252 explicit Ref(VRTGroup* ptr): m_ptr(ptr) {}
1253 Ref(
const Ref&) =
delete;
1254 Ref& operator=(
const Ref&) =
delete;
1258 std::shared_ptr<Ref> m_poSharedRefRootGroup{};
1259 std::weak_ptr<Ref> m_poWeakRefRootGroup{};
1260 std::shared_ptr<Ref> m_poRefSelf{};
1262 std::string m_osFilename{};
1263 mutable bool m_bDirty =
false;
1264 std::string m_osVRTPath{};
1265 std::map<std::string, std::shared_ptr<VRTGroup>> m_oMapGroups{};
1266 std::map<std::string, std::shared_ptr<VRTMDArray>> m_oMapMDArrays{};
1267 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1268 std::map<std::string, std::shared_ptr<VRTDimension>> m_oMapDimensions{};
1270 std::shared_ptr<VRTGroup> OpenGroupInternal(
const std::string& osName)
const;
1271 void SetRootGroupRef(
const std::weak_ptr<Ref>& rgRef);
1272 std::weak_ptr<Ref> GetRootGroupRef()
const;
1276 VRTGroup(
const std::string& osParentName,
const std::string& osName);
1279 bool XMLInit(
const std::shared_ptr<VRTGroup>& poRoot,
1280 const std::shared_ptr<VRTGroup>& poThisGroup,
1282 const char* pszVRTPath);
1285 std::shared_ptr<GDALMDArray>
OpenMDArray(
const std::string& osName,
1289 std::shared_ptr<GDALGroup>
OpenGroup(
const std::string& osName,
1292 return OpenGroupInternal(osName);
1299 std::shared_ptr<VRTDimension> GetDimension(
const std::string& name)
const {
1300 auto oIter = m_oMapDimensions.find(name);
1301 return oIter == m_oMapDimensions.end() ? nullptr : oIter->second;
1303 std::shared_ptr<VRTDimension> GetDimensionFromFullName(
const std::string& name,
1304 bool bEmitError)
const;
1306 std::shared_ptr<GDALGroup>
CreateGroup(
const std::string& osName,
1309 std::shared_ptr<GDALDimension>
CreateDimension(
const std::string& osName,
1310 const std::string& osType,
1311 const std::string& osDirection,
1316 const std::string& osName,
1317 const std::vector<GUInt64>& anDimensions,
1321 std::shared_ptr<GDALMDArray>
CreateMDArray(
const std::string& osName,
1322 const std::vector<std::shared_ptr<GDALDimension>>& aoDimensions,
1326 void SetIsRootGroup();
1328 const std::shared_ptr<Ref>& GetRef()
const {
return m_poRefSelf; }
1329 VRTGroup* GetRootGroup()
const;
1331 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1333 void SetFilename(
const std::string& osFilename) { m_osFilename = osFilename; }
1334 void Serialize()
const;
1335 CPLXMLNode* SerializeToXML(
const char *pszVRTPathIn )
const;
1336 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn)
const;
1345 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1346 std::string m_osIndexingVariableName;
1349 VRTDimension(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1350 const std::string& osParentName,
1351 const std::string& osName,
1352 const std::string& osType,
1353 const std::string& osDirection,
1355 const std::string& osIndexingVariableName):
1356 GDALDimension(osParentName, osName, osType, osDirection, nSize),
1357 m_poGroupRef(poGroupRef),
1358 m_osIndexingVariableName(osIndexingVariableName)
1361 VRTGroup* GetGroup()
const;
1363 static std::shared_ptr<VRTDimension> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1364 const std::string& osParentName,
1381 std::vector<std::string> m_aosList{};
1382 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
1386 bool IRead(
const GUInt64* arrayStartIdx,
1387 const size_t* count,
1391 void* pDstBuffer)
const override;
1393 bool IWrite(
const GUInt64* arrayStartIdx,
1394 const size_t* count,
1398 const void* pSrcBuffer)
override;
1402 VRTAttribute(
const std::string& osParentName,
1403 const std::string& osName,
1405 std::vector<std::string>&& aosList):
1409 m_aosList(std::move(aosList))
1411 if( m_aosList.size() > 1 )
1413 m_dims.emplace_back(std::make_shared<GDALDimension>(
1414 std::string(),
"dim",
1415 std::string(), std::string(), m_aosList.size()));
1419 VRTAttribute(
const std::string& osParentName,
1420 const std::string& osName,
1429 m_dims.emplace_back(std::make_shared<GDALDimension>(
1430 std::string(),
"dim",
1431 std::string(), std::string(), nDim));
1435 static bool CreationCommonChecks(
const std::string& osName,
1436 const std::vector<GUInt64>& anDimensions,
1437 const std::map<std::string, std::shared_ptr<VRTAttribute>>& oMapAttributes);
1439 static std::shared_ptr<VRTAttribute> Create(
const std::string& osParentName,
1442 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1453 class VRTMDArraySource
1456 virtual ~VRTMDArraySource() =
default;
1458 virtual bool Read(
const GUInt64* arrayStartIdx,
1459 const size_t* count,
1463 void* pDstBuffer)
const = 0;
1465 virtual void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const = 0;
1475 friend class VRTGroup;
1477 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1478 std::string m_osVRTPath{};
1481 std::vector<std::shared_ptr<GDALDimension>> m_dims;
1482 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1483 std::vector<std::unique_ptr<VRTMDArraySource>> m_sources{};
1484 std::shared_ptr<OGRSpatialReference> m_poSRS{};
1485 std::vector<GByte> m_abyNoData{};
1486 std::string m_osUnit{};
1487 double m_dfScale = 1.0;
1488 double m_dfOffset = 0.0;
1489 bool m_bHasScale =
false;
1490 bool m_bHasOffset =
false;
1492 bool IRead(
const GUInt64* arrayStartIdx,
1493 const size_t* count,
1497 void* pDstBuffer)
const override;
1502 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1503 const std::string& osParentName,
1504 const std::string& osName,
1506 std::vector<std::shared_ptr<GDALDimension>>&& dims,
1507 std::map<std::string, std::shared_ptr<VRTAttribute>>&& oMapAttributes) :
1510 m_poGroupRef(poGroupRef),
1511 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1513 m_dims(std::move(dims)),
1514 m_oMapAttributes(std::move(oMapAttributes))
1518 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1519 const std::string& osParentName,
1520 const std::string& osName,
1521 const std::vector<std::shared_ptr<GDALDimension>>& dims,
1525 m_poGroupRef(poGroupRef),
1526 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1532 bool IsWritable()
const override {
return false; }
1534 static std::shared_ptr<VRTMDArray> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1535 const std::string& osParentName,
1538 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1546 std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const override {
return m_poSRS; }
1552 const std::string&
GetUnit()
const override {
return m_osUnit; }
1554 bool SetUnit(
const std::string& osUnit)
override {
1555 m_osUnit = osUnit;
return true; }
1557 double GetOffset(
bool* pbHasOffset)
const override
1559 if( pbHasOffset) *pbHasOffset = m_bHasOffset;
1563 double GetScale(
bool* pbHasScale)
const override
1565 if( pbHasScale) *pbHasScale = m_bHasScale;
1569 bool SetOffset(
double dfOffset)
override
1570 { SetDirty(); m_bHasOffset =
true; m_dfOffset = dfOffset;
return true; }
1572 bool SetScale(
double dfScale)
override
1573 { SetDirty(); m_bHasScale =
true; m_dfScale = dfScale;
return true; }
1575 void AddSource(std::unique_ptr<VRTMDArraySource>&& poSource);
1578 const std::string& osName,
1579 const std::vector<GUInt64>& anDimensions,
1588 GDALProgressFunc pfnProgress,
1589 void * pProgressData)
override;
1591 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn )
const;
1593 VRTGroup* GetGroup()
const;
1595 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1602 class VRTMDArraySourceInlinedValues final:
public VRTMDArraySource
1604 const VRTMDArray* m_poDstArray =
nullptr;
1605 bool m_bIsConstantValue;
1606 std::vector<GUInt64> m_anOffset{};
1607 std::vector<size_t> m_anCount{};
1608 std::vector<GByte> m_abyValues{};
1609 std::vector<size_t> m_anInlinedArrayStrideInBytes{};
1612 VRTMDArraySourceInlinedValues(
const VRTMDArraySourceInlinedValues&) =
delete;
1613 VRTMDArraySourceInlinedValues& operator=(
const VRTMDArraySourceInlinedValues&) =
delete;
1616 VRTMDArraySourceInlinedValues(
const VRTMDArray* poDstArray,
1617 bool bIsConstantValue,
1618 std::vector<GUInt64>&& anOffset,
1619 std::vector<size_t>&& anCount,
1620 std::vector<GByte>&& abyValues):
1621 m_poDstArray(poDstArray),
1622 m_bIsConstantValue(bIsConstantValue),
1623 m_anOffset(std::move(anOffset)),
1624 m_anCount(std::move(anCount)),
1625 m_abyValues(std::move(abyValues)),
1626 m_dt(poDstArray->GetDataType())
1628 const auto nDims(poDstArray->GetDimensionCount());
1629 m_anInlinedArrayStrideInBytes.resize(nDims);
1630 if( !bIsConstantValue && nDims > 0 )
1632 m_anInlinedArrayStrideInBytes.back() = poDstArray->GetDataType().GetSize();
1633 for(
size_t i = nDims - 1; i > 0; )
1636 m_anInlinedArrayStrideInBytes[i] =
1637 m_anInlinedArrayStrideInBytes[i+1] * m_anCount[i+1];
1642 ~VRTMDArraySourceInlinedValues();
1644 static std::unique_ptr<VRTMDArraySourceInlinedValues> Create(
1645 const VRTMDArray* poDstArray,
1648 bool Read(
const GUInt64* arrayStartIdx,
1649 const size_t* count,
1653 void* pDstBuffer)
const override;
1655 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1662 class VRTMDArraySourceRegularlySpaced final:
public VRTMDArraySource
1665 double m_dfIncrement;
1668 VRTMDArraySourceRegularlySpaced(
1669 double dfStart,
double dfIncrement):
1671 m_dfIncrement(dfIncrement)
1675 bool Read(
const GUInt64* arrayStartIdx,
1676 const size_t* count,
1680 void* pDstBuffer)
const override;
1682 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1689 class VRTMDArraySourceFromArray final:
public VRTMDArraySource
1691 const VRTMDArray* m_poDstArray =
nullptr;
1692 bool m_bRelativeToVRTSet =
false;
1693 bool m_bRelativeToVRT =
false;
1694 std::string m_osFilename{};
1695 std::string m_osArray{};
1696 std::string m_osBand{};
1697 std::vector<int> m_anTransposedAxis{};
1698 std::string m_osViewExpr{};
1699 std::vector<GUInt64> m_anSrcOffset{};
1700 mutable std::vector<GUInt64> m_anCount{};
1701 std::vector<GUInt64> m_anStep{};
1702 std::vector<GUInt64> m_anDstOffset{};
1704 VRTMDArraySourceFromArray(
const VRTMDArraySourceFromArray&) =
delete;
1705 VRTMDArraySourceFromArray& operator=(
const VRTMDArraySourceFromArray&) =
delete;
1708 VRTMDArraySourceFromArray(
const VRTMDArray* poDstArray,
1709 bool bRelativeToVRTSet,
1710 bool bRelativeToVRT,
1711 const std::string& osFilename,
1712 const std::string& osArray,
1713 const std::string& osBand,
1714 std::vector<int>&& anTransposedAxis,
1715 const std::string& osViewExpr,
1716 std::vector<GUInt64>&& anSrcOffset,
1717 std::vector<GUInt64>&& anCount,
1718 std::vector<GUInt64>&& anStep,
1719 std::vector<GUInt64>&& anDstOffset):
1720 m_poDstArray(poDstArray),
1721 m_bRelativeToVRTSet(bRelativeToVRTSet),
1722 m_bRelativeToVRT(bRelativeToVRT),
1723 m_osFilename(osFilename),
1726 m_anTransposedAxis(std::move(anTransposedAxis)),
1727 m_osViewExpr(osViewExpr),
1728 m_anSrcOffset(std::move(anSrcOffset)),
1729 m_anCount(std::move(anCount)),
1730 m_anStep(std::move(anStep)),
1731 m_anDstOffset(std::move(anDstOffset))
1735 ~VRTMDArraySourceFromArray()
override;
1737 static std::unique_ptr<VRTMDArraySourceFromArray> Create(
1738 const VRTMDArray* poDstArray,
1741 bool Read(
const GUInt64* arrayStartIdx,
1742 const size_t* count,
1746 void* pDstBuffer)
const override;
1748 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