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;
89 if( poBand ==
nullptr )
108 class CPL_DLL VRTSource
111 virtual ~VRTSource();
114 int nXOff,
int nYOff,
int nXSize,
int nYSize,
115 void *pData,
int nBufXSize,
int nBufYSize,
120 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
121 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess ) = 0;
122 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
123 double* adfMinMax ) = 0;
124 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
126 double *pdfMin,
double *pdfMax,
127 double *pdfMean,
double *pdfStdDev,
128 GDALProgressFunc pfnProgress,
129 void *pProgressData ) = 0;
130 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
131 double dfMin,
double dfMax,
132 int nBuckets,
GUIntBig * panHistogram,
133 int bIncludeOutOfRange,
int bApproxOK,
134 GDALProgressFunc pfnProgress,
135 void *pProgressData ) = 0;
138 std::map<CPLString, GDALDataset*>& ) = 0;
139 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath ) = 0;
141 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
144 virtual int IsSimpleSource() {
return FALSE; }
145 virtual CPLErr FlushCache() {
return CE_None; }
148 typedef VRTSource *(*VRTSourceParser)(
CPLXMLNode *,
const char *,
void* pUniqueHandle,
149 std::map<CPLString, GDALDataset*>& oMapSharedSources);
151 VRTSource *VRTParseCoreSources(
CPLXMLNode *psTree,
const char *,
void* pUniqueHandle,
152 std::map<CPLString, GDALDataset*>& oMapSharedSources);
153 VRTSource *VRTParseFilterSources(
CPLXMLNode *psTree,
const char *,
void* pUniqueHandle,
154 std::map<CPLString, GDALDataset*>& oMapSharedSources );
162 template<
class T>
struct VRTFlushCacheStruct
164 static void FlushCache(T& obj);
167 class VRTWarpedDataset;
168 class VRTPansharpenedDataset;
173 friend class VRTRasterBand;
174 friend struct VRTFlushCacheStruct<VRTDataset>;
175 friend struct VRTFlushCacheStruct<VRTWarpedDataset>;
176 friend struct VRTFlushCacheStruct<VRTPansharpenedDataset>;
177 friend class VRTSourcedRasterBand;
182 int m_bGeoTransformSet =
false;
183 double m_adfGeoTransform[6];
189 bool m_bNeedsFlush =
false;
190 bool m_bWritable =
true;
191 bool m_bCanTakeRef =
true;
193 char *m_pszVRTPath =
nullptr;
195 VRTRasterBand *m_poMaskBand =
nullptr;
197 int m_bCompatibleForDatasetIO = -1;
198 int CheckCompatibleForDatasetIO();
199 void ExpandProxyBands();
203 std::vector<GDALDataset*> m_apoOverviews{};
204 std::vector<GDALDataset*> m_apoOverviewsBak{};
206 std::vector<int> m_anOverviewFactors{};
208 char **m_papszXMLVRTMetadata =
nullptr;
210 std::map<CPLString, GDALDataset*> m_oMapSharedSources{};
211 std::shared_ptr<VRTGroup> m_poRootGroup{};
213 int m_nRecursionCounter = 0;
215 VRTRasterBand* InitBand(
const char* pszSubclass,
int nBand,
216 bool bAllowPansharpened);
217 static GDALDataset *OpenVRTProtocol(
const char* pszSpec );
218 bool AddVirtualOverview(
int nOvFactor,
219 const char* pszResampling);
224 virtual int CloseDependentDatasets()
override;
227 VRTDataset(
int nXSize,
int nYSize);
228 virtual ~VRTDataset();
230 void SetNeedsFlush() { m_bNeedsFlush =
true; }
231 virtual void FlushCache()
override;
233 void SetWritable(
int bWritableIn) { m_bWritable = CPL_TO_BOOL(bWritableIn); }
235 virtual CPLErr CreateMaskBand(
int nFlags )
override;
236 void SetMaskBand(VRTRasterBand* poMaskBand);
241 virtual CPLErr GetGeoTransform(
double * )
override;
242 virtual CPLErr SetGeoTransform(
double * )
override;
244 virtual CPLErr SetMetadata(
char **papszMetadata,
245 const char *pszDomain =
"" )
override;
246 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
247 const char *pszDomain =
"" )
override;
249 virtual char** GetMetadata(
const char *pszDomain =
"" )
override;
251 virtual int GetGCPCount()
override;
253 virtual const GDAL_GCP *GetGCPs()
override;
259 char **papszOptions=
nullptr )
override;
261 virtual char **GetFileList()
override;
264 int nXOff,
int nYOff,
int nXSize,
int nYSize,
265 void * pData,
int nBufXSize,
int nBufYSize,
267 int nBandCount,
int *panBandMap,
272 virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
273 int nBufXSize,
int nBufYSize,
275 int nBandCount,
int *panBandList,
276 char **papszOptions )
override;
278 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath);
281 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
282 int,
int *, GDALProgressFunc,
void * )
override;
284 std::shared_ptr<GDALGroup> GetRootGroup()
const override;
288 void BuildVirtualOverviews();
290 void UnsetPreservedRelativeFilenames();
294 static GDALDataset *OpenXML(
const char *,
const char * =
nullptr,
297 int nXSize,
int nYSize,
int nBands,
299 static GDALDataset *CreateMultiDimensional(
const char * pszFilename,
302 static CPLErr Delete(
const char * pszFilename );
310 class VRTWarpedRasterBand;
312 class CPL_DLL VRTWarpedDataset final:
public VRTDataset
318 int m_nOverviewCount;
319 VRTWarpedDataset **m_papoOverviews;
322 void CreateImplicitOverviews();
324 struct VerticalShiftGrid
327 int bInverse =
false;
328 double dfToMeterSrc = 0.0;
329 double dfToMeterDest = 0.0;
332 std::vector<VerticalShiftGrid> m_aoVerticalShiftGrids{};
334 friend class VRTWarpedRasterBand;
339 virtual int CloseDependentDatasets()
override;
342 VRTWarpedDataset(
int nXSize,
int nYSize );
343 virtual ~VRTWarpedDataset();
345 virtual void FlushCache()
override;
347 CPLErr Initialize(
void * );
349 virtual CPLErr IBuildOverviews(
const char *,
int,
int *,
350 int,
int *, GDALProgressFunc,
void * )
override;
352 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
353 const char *pszDomain =
"" )
override;
355 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
359 char **papszOptions=
nullptr )
override;
361 virtual char **GetFileList()
override;
363 CPLErr ProcessBlock(
int iBlockX,
int iBlockY );
365 void GetBlockSize(
int *,
int * )
const;
367 void SetApplyVerticalShiftGrid(
const char* pszVGrids,
370 double dfToMeterDest,
371 char** papszOptions );
383 GTAdjust_Intersection,
385 GTAdjust_NoneWithoutWarning
388 class VRTPansharpenedDataset final:
public VRTDataset
390 friend class VRTPansharpenedRasterBand;
395 VRTPansharpenedDataset* m_poMainDataset;
396 std::vector<VRTPansharpenedDataset*> m_apoOverviewDatasets{};
398 std::map<CPLString,CPLString> m_oMapToRelativeFilenames{};
400 int m_bLoadingOtherBands;
402 GByte *m_pabyLastBufferBandRasterIO;
403 int m_nLastBandRasterIOXOff;
404 int m_nLastBandRasterIOYOff;
405 int m_nLastBandRasterIOXSize;
406 int m_nLastBandRasterIOYSize;
409 GTAdjustment m_eGTAdjustment;
410 int m_bNoDataDisabled;
412 std::vector<GDALDataset*> m_apoDatasetsToClose{};
417 virtual int CloseDependentDatasets()
override;
420 VRTPansharpenedDataset(
int nXSize,
int nYSize );
421 virtual ~VRTPansharpenedDataset();
423 virtual void FlushCache()
override;
426 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
430 int nInputSpectralBandsIn,
434 char **papszOptions=
nullptr )
override;
436 virtual char **GetFileList()
override;
439 int nXOff,
int nYOff,
int nXSize,
int nYSize,
440 void * pData,
int nBufXSize,
int nBufYSize,
442 int nBandCount,
int *panBandMap,
447 void GetBlockSize(
int *,
int * )
const;
462 friend class VRTDataset;
466 int m_bNoDataValueSet;
468 int m_bHideNoDataValue;
469 double m_dfNoDataValue;
471 std::unique_ptr<GDALColorTable> m_poColorTable{};
476 char **m_papszCategoryNames;
483 void Initialize(
int nXSize,
int nYSize );
485 std::vector<VRTOverviewInfo> m_aoOverviewInfos{};
487 VRTRasterBand *m_poMaskBand;
489 std::unique_ptr<GDALRasterAttributeTable> m_poRAT{};
496 virtual ~VRTRasterBand();
499 std::map<CPLString, GDALDataset*>& );
500 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath );
502 virtual CPLErr SetNoDataValue(
double )
override;
503 virtual double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
504 virtual CPLErr DeleteNoDataValue()
override;
515 virtual const char *GetUnitType()
override;
516 CPLErr SetUnitType(
const char * )
override;
518 virtual char **GetCategoryNames()
override;
519 virtual CPLErr SetCategoryNames(
char ** )
override;
521 virtual CPLErr SetMetadata(
char **papszMD,
const char *pszDomain =
"" )
override;
522 virtual CPLErr SetMetadataItem(
const char *pszName,
const char *pszValue,
523 const char *pszDomain =
"" )
override;
525 virtual double GetOffset(
int *pbSuccess =
nullptr )
override;
526 CPLErr SetOffset(
double )
override;
527 virtual double GetScale(
int *pbSuccess =
nullptr )
override;
528 CPLErr SetScale(
double )
override;
530 virtual int GetOverviewCount()
override;
533 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
534 int nBuckets,
GUIntBig * panHistogram,
535 int bIncludeOutOfRange,
int bApproxOK,
536 GDALProgressFunc,
void *pProgressData )
override;
538 virtual CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
539 int *pnBuckets,
GUIntBig ** ppanHistogram,
541 GDALProgressFunc,
void *pProgressData)
override;
543 virtual CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
544 int nBuckets,
GUIntBig *panHistogram )
override;
548 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
551 virtual void SetDescription(
const char * )
override;
554 virtual int GetMaskFlags()
override;
556 virtual CPLErr CreateMaskBand(
int nFlagsIn )
override;
558 void SetMaskBand(VRTRasterBand* poMaskBand);
560 void SetIsMaskBand();
562 CPLErr UnsetNoDataValue();
564 virtual int CloseDependentDatasets();
566 virtual int IsSourcedRasterBand() {
return FALSE; }
567 virtual int IsPansharpenRasterBand() {
return FALSE; }
574 class VRTSimpleSource;
576 class CPL_DLL VRTSourcedRasterBand
CPL_NON_FINAL:
public VRTRasterBand
579 int m_nRecursionCounter;
581 char **m_papszSourceList;
583 bool CanUseSourcesMinMaxImplementations();
584 void CheckSource( VRTSimpleSource *poSS );
590 VRTSource **papoSources;
591 int bSkipBufferInitialization;
593 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand );
595 int nXSize,
int nYSize );
596 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand,
598 int nXSize,
int nYSize );
599 VRTSourcedRasterBand(
GDALDataset *poDS,
int nBand,
601 int nXSize,
int nYSize,
602 int nBlockXSizeIn,
int nBlockYSizeIn );
603 virtual ~VRTSourcedRasterBand();
610 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
611 int nXSize,
int nYSize,
613 double* pdfDataPct)
override;
615 virtual char **GetMetadataDomainList()
override;
616 virtual const char *GetMetadataItem(
const char * pszName,
617 const char * pszDomain =
"" )
override;
618 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
619 virtual CPLErr SetMetadata(
char ** papszMetadata,
620 const char * pszDomain =
"" )
override;
621 virtual CPLErr SetMetadataItem(
const char * pszName,
622 const char * pszValue,
623 const char * pszDomain =
"" )
override;
626 std::map<CPLString, GDALDataset*>& )
override;
627 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
629 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
630 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
631 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
632 virtual CPLErr ComputeStatistics(
int bApproxOK,
633 double *pdfMin,
double *pdfMax,
634 double *pdfMean,
double *pdfStdDev,
635 GDALProgressFunc pfnProgress,
636 void *pProgressData )
override;
637 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
638 int nBuckets,
GUIntBig * panHistogram,
639 int bIncludeOutOfRange,
int bApproxOK,
640 GDALProgressFunc pfnProgress,
641 void *pProgressData )
override;
643 CPLErr AddSource( VRTSource * );
645 double dfSrcXOff=-1,
double dfSrcYOff=-1,
646 double dfSrcXSize=-1,
double dfSrcYSize=-1,
647 double dfDstXOff=-1,
double dfDstYOff=-1,
648 double dfDstXSize=-1,
double dfDstYSize=-1,
649 const char *pszResampling =
"near",
652 double dfSrcXOff=-1,
double dfSrcYOff=-1,
653 double dfSrcXSize=-1,
double dfSrcYSize=-1,
654 double dfDstXOff=-1,
double dfDstYOff=-1,
655 double dfDstXSize=-1,
double dfDstYSize=-1,
656 double dfScaleOff=0.0,
657 double dfScaleRatio=1.0,
659 int nColorTableComponent = 0);
662 double dfSrcXOff=-1,
double dfSrcYOff=-1,
663 double dfSrcXSize=-1,
664 double dfSrcYSize=-1,
665 double dfDstXOff=-1,
double dfDstYOff=-1,
666 double dfDstXSize=-1,
667 double dfDstYSize=-1 );
672 void ConfigureSource(VRTSimpleSource *poSimpleSource,
675 double dfSrcXOff,
double dfSrcYOff,
676 double dfSrcXSize,
double dfSrcYSize,
677 double dfDstXOff,
double dfDstYOff,
678 double dfDstXSize,
double dfDstYSize );
680 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
682 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
683 int *pnMaxSize,
CPLHashSet* hSetFiles)
override;
685 virtual int CloseDependentDatasets()
override;
687 virtual int IsSourcedRasterBand()
override {
return TRUE; }
689 virtual CPLErr FlushCache()
override;
696 class CPL_DLL VRTWarpedRasterBand final:
public VRTRasterBand
701 virtual ~VRTWarpedRasterBand();
703 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
705 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
706 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
708 virtual int GetOverviewCount()
override;
715 class VRTPansharpenedRasterBand final:
public VRTRasterBand
717 int m_nIndexAsPansharpenedBand;
720 VRTPansharpenedRasterBand(
723 virtual ~VRTPansharpenedRasterBand();
725 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
727 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
730 int nXOff,
int nYOff,
int nXSize,
int nYSize,
731 void * pData,
int nBufXSize,
int nBufYSize,
736 virtual int GetOverviewCount()
override;
739 virtual int IsPansharpenRasterBand()
override {
return TRUE; }
741 void SetIndexAsPansharpenedBand(
int nIdx )
742 { m_nIndexAsPansharpenedBand = nIdx; }
743 int GetIndexAsPansharpenedBand()
const
744 {
return m_nIndexAsPansharpenedBand; }
751 class VRTDerivedRasterBandPrivateData;
753 class CPL_DLL VRTDerivedRasterBand
CPL_NON_FINAL:
public VRTSourcedRasterBand
755 VRTDerivedRasterBandPrivateData* m_poPrivate;
756 bool InitializePython();
764 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand );
765 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand,
767 virtual ~VRTDerivedRasterBand();
774 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
775 int nXSize,
int nYSize,
777 double* pdfDataPct)
override;
779 static CPLErr AddPixelFunction(
const char *pszFuncName,
783 void SetPixelFunctionName(
const char *pszFuncName );
785 void SetPixelFunctionLanguage(
const char* pszLanguage );
788 std::map<CPLString, GDALDataset*>& )
override;
789 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
791 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
792 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
793 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
794 virtual CPLErr ComputeStatistics(
int bApproxOK,
795 double *pdfMin,
double *pdfMax,
796 double *pdfMean,
double *pdfStdDev,
797 GDALProgressFunc pfnProgress,
798 void *pProgressData )
override;
799 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
800 int nBuckets,
GUIntBig * panHistogram,
801 int bIncludeOutOfRange,
int bApproxOK,
802 GDALProgressFunc pfnProgress,
803 void *pProgressData )
override;
805 static void Cleanup();
814 class CPL_DLL VRTRawRasterBand
CPL_NON_FINAL:
public VRTRasterBand
816 RawRasterBand *m_poRawRaster;
818 char *m_pszSourceFilename;
819 int m_bRelativeToVRT;
826 virtual ~VRTRawRasterBand();
829 std::map<CPLString, GDALDataset*>& )
override;
830 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
837 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
838 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
840 CPLErr SetRawLink(
const char *pszFilename,
841 const char *pszVRTPath,
844 int nPixelOffset,
int nLineOffset,
845 const char *pszByteOrder );
852 char **papszOptions )
override;
854 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
855 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
868 virtual ~VRTDriver();
870 char **papszSourceParsers;
873 virtual char **
GetMetadata(
const char * pszDomain =
"" )
override;
875 const char * pszDomain =
"" )
override;
877 VRTSource *ParseSource(
CPLXMLNode *psSrc,
const char *pszVRTPath,
879 std::map<CPLString, GDALDataset*>& oMapSharedSources );
880 void AddSourceParser(
const char *pszElementName,
881 VRTSourceParser pfnParser );
888 class CPL_DLL VRTSimpleSource
CPL_NON_FINAL:
public VRTSource
893 friend class VRTSourcedRasterBand;
894 friend class VRTDataset;
913 double m_dfNoDataValue;
918 int m_bRelativeToVRTOri;
920 int m_nExplicitSharedStatus;
922 bool m_bDropRefOnSrcBand;
924 int NeedMaxValAdjustment()
const;
928 VRTSimpleSource(
const VRTSimpleSource* poSrcSource,
929 double dfXDstRatio,
double dfYDstRatio );
930 virtual ~VRTSimpleSource();
933 std::map<CPLString, GDALDataset*>& )
override;
934 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
938 void SetSrcWindow(
double,
double,
double,
double );
939 void SetDstWindow(
double,
double,
double,
double );
940 void SetNoDataValue(
double dfNoDataValue );
941 const CPLString& GetResampling()
const {
return m_osResampling; }
942 void SetResampling(
const char* pszResampling );
944 int GetSrcDstWindow(
int,
int,
int,
int,
int,
int,
945 double *pdfReqXOff,
double *pdfReqYOff,
946 double *pdfReqXSize,
double *pdfReqYSize,
947 int *,
int *,
int *,
int *,
948 int *,
int *,
int *,
int * );
951 int nXOff,
int nYOff,
int nXSize,
int nYSize,
952 void *pData,
int nBufXSize,
int nBufYSize,
957 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
958 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
959 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
960 double* adfMinMax )
override;
961 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
963 double *pdfMin,
double *pdfMax,
964 double *pdfMean,
double *pdfStdDev,
965 GDALProgressFunc pfnProgress,
966 void *pProgressData )
override;
967 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
968 double dfMin,
double dfMax,
969 int nBuckets,
GUIntBig * panHistogram,
970 int bIncludeOutOfRange,
int bApproxOK,
971 GDALProgressFunc pfnProgress,
972 void *pProgressData )
override;
974 void DstToSrc(
double dfX,
double dfY,
975 double &dfXOut,
double &dfYOut )
const;
976 void SrcToDst(
double dfX,
double dfY,
977 double &dfXOut,
double &dfYOut )
const;
979 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
980 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
982 virtual int IsSimpleSource()
override {
return TRUE; }
983 virtual const char* GetType() {
return "SimpleSource"; }
984 virtual CPLErr FlushCache()
override;
987 GDALRasterBand* GetMaskBandMainBand() {
return m_poMaskBandMainBand; }
988 int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
991 int nXOff,
int nYOff,
int nXSize,
int nYSize,
992 void * pData,
int nBufXSize,
int nBufYSize,
994 int nBandCount,
int *panBandMap,
999 void UnsetPreservedRelativeFilenames();
1001 void SetMaxValue(
int nVal ) { m_nMaxValue = nVal; }
1008 class VRTAveragedSource final:
public VRTSimpleSource
1013 VRTAveragedSource();
1015 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1016 void *pData,
int nBufXSize,
int nBufYSize,
1021 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1022 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1023 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1024 double* adfMinMax )
override;
1025 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1027 double *pdfMin,
double *pdfMax,
1028 double *pdfMean,
double *pdfStdDev,
1029 GDALProgressFunc pfnProgress,
1030 void *pProgressData )
override;
1031 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1032 double dfMin,
double dfMax,
1033 int nBuckets,
GUIntBig * panHistogram,
1034 int bIncludeOutOfRange,
int bApproxOK,
1035 GDALProgressFunc pfnProgress,
1036 void *pProgressData )
override;
1038 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1039 virtual const char* GetType()
override {
return "AveragedSource"; }
1050 VRT_SCALING_EXPONENTIAL,
1051 } VRTComplexSourceScaling;
1053 class CPL_DLL VRTComplexSource
CPL_NON_FINAL:
public VRTSimpleSource
1056 bool AreValuesUnchanged()
const;
1059 VRTComplexSourceScaling m_eScalingType;
1060 double m_dfScaleOff;
1061 double m_dfScaleRatio;
1064 int m_bSrcMinMaxDefined;
1069 double m_dfExponent;
1071 int m_nColorTableComponent;
1073 bool m_bUseMaskBand =
false;
1075 template <
class WorkingDT>
1076 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
1077 int nReqXSize,
int nReqYSize,
1078 void *pData,
int nOutXSize,
int nOutYSize,
1086 VRTComplexSource(
const VRTComplexSource* poSrcSource,
1087 double dfXDstRatio,
double dfYDstRatio);
1088 virtual ~VRTComplexSource();
1091 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1092 void *pData,
int nBufXSize,
int nBufYSize,
1097 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1098 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1099 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1100 double* adfMinMax )
override;
1101 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1103 double *pdfMin,
double *pdfMax,
1104 double *pdfMean,
double *pdfStdDev,
1105 GDALProgressFunc pfnProgress,
1106 void *pProgressData )
override;
1107 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1108 double dfMin,
double dfMax,
1109 int nBuckets,
GUIntBig * panHistogram,
1110 int bIncludeOutOfRange,
int bApproxOK,
1111 GDALProgressFunc pfnProgress,
1112 void *pProgressData )
override;
1114 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1116 std::map<CPLString, GDALDataset*>& )
override;
1117 virtual const char* GetType()
override {
return "ComplexSource"; }
1119 double LookupValue(
double dfInput );
1121 void SetUseMaskBand(
bool bUseMaskBand) { m_bUseMaskBand = bUseMaskBand; }
1123 void SetLinearScaling(
double dfOffset,
double dfScale );
1124 void SetPowerScaling(
double dfExponent,
1129 void SetColorTableComponent(
int nComponent );
1131 double *m_padfLUTInputs;
1132 double *m_padfLUTOutputs;
1133 int m_nLUTItemCount;
1140 class VRTFilteredSource
CPL_NON_FINAL:
public VRTComplexSource
1148 int m_nSupportedTypesCount;
1151 int m_nExtraEdgePixels;
1154 VRTFilteredSource();
1155 virtual ~VRTFilteredSource();
1157 void SetExtraEdgePixels(
int );
1158 void SetFilteringDataTypesSupported(
int,
GDALDataType * );
1161 GByte *pabySrcData,
GByte *pabyDstData ) = 0;
1164 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1165 void *pData,
int nBufXSize,
int nBufYSize,
1175 class VRTKernelFilteredSource
CPL_NON_FINAL:
public VRTFilteredSource
1184 double *m_padfKernelCoefs;
1189 VRTKernelFilteredSource();
1190 virtual ~VRTKernelFilteredSource();
1193 std::map<CPLString, GDALDataset*>& )
override;
1194 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1197 GByte *pabySrcData,
GByte *pabyDstData )
override;
1199 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs );
1200 void SetNormalized(
int );
1207 class VRTAverageFilteredSource final:
public VRTKernelFilteredSource
1212 explicit VRTAverageFilteredSource(
int nKernelSize );
1213 virtual ~VRTAverageFilteredSource();
1216 std::map<CPLString, GDALDataset*>& )
override;
1217 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1223 class VRTFuncSource final:
public VRTSource
1229 virtual ~VRTFuncSource();
1232 std::map<CPLString, GDALDataset*>& )
override {
return CE_Failure; }
1233 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1236 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1237 void *pData,
int nBufXSize,
int nBufYSize,
1242 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1243 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1244 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1245 double* adfMinMax )
override;
1246 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1248 double *pdfMin,
double *pdfMax,
1249 double *pdfMean,
double *pdfStdDev,
1250 GDALProgressFunc pfnProgress,
1251 void *pProgressData )
override;
1252 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1253 double dfMin,
double dfMax,
1254 int nBuckets,
GUIntBig * panHistogram,
1255 int bIncludeOutOfRange,
int bApproxOK,
1256 GDALProgressFunc pfnProgress,
1257 void *pProgressData )
override;
1271 #define TMP_CPL_DLL CPL_DLL
1286 explicit Ref(VRTGroup* ptr): m_ptr(ptr) {}
1287 Ref(
const Ref&) =
delete;
1288 Ref& operator=(
const Ref&) =
delete;
1292 std::shared_ptr<Ref> m_poSharedRefRootGroup{};
1293 std::weak_ptr<Ref> m_poWeakRefRootGroup{};
1294 std::shared_ptr<Ref> m_poRefSelf{};
1296 std::string m_osFilename{};
1297 mutable bool m_bDirty =
false;
1298 std::string m_osVRTPath{};
1299 std::map<std::string, std::shared_ptr<VRTGroup>> m_oMapGroups{};
1300 std::map<std::string, std::shared_ptr<VRTMDArray>> m_oMapMDArrays{};
1301 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1302 std::map<std::string, std::shared_ptr<VRTDimension>> m_oMapDimensions{};
1304 std::shared_ptr<VRTGroup> OpenGroupInternal(
const std::string& osName)
const;
1305 void SetRootGroupRef(
const std::weak_ptr<Ref>& rgRef);
1306 std::weak_ptr<Ref> GetRootGroupRef()
const;
1310 VRTGroup(
const std::string& osParentName,
const std::string& osName);
1313 bool XMLInit(
const std::shared_ptr<VRTGroup>& poRoot,
1314 const std::shared_ptr<VRTGroup>& poThisGroup,
1316 const char* pszVRTPath);
1318 std::vector<std::string> GetMDArrayNames(
CSLConstList papszOptions)
const override;
1319 std::shared_ptr<GDALMDArray> OpenMDArray(
const std::string& osName,
1322 std::vector<std::string> GetGroupNames(
CSLConstList papszOptions)
const override;
1323 std::shared_ptr<GDALGroup> OpenGroup(
const std::string& osName,
1326 return OpenGroupInternal(osName);
1329 std::vector<std::shared_ptr<GDALDimension>> GetDimensions(
CSLConstList)
const override;
1331 std::vector<std::shared_ptr<GDALAttribute>> GetAttributes(
CSLConstList)
const override;
1333 std::shared_ptr<VRTDimension> GetDimension(
const std::string& name)
const {
1334 auto oIter = m_oMapDimensions.find(name);
1335 return oIter == m_oMapDimensions.end() ? nullptr : oIter->second;
1337 std::shared_ptr<VRTDimension> GetDimensionFromFullName(
const std::string& name,
1338 bool bEmitError)
const;
1340 std::shared_ptr<GDALGroup> CreateGroup(
const std::string& osName,
1343 std::shared_ptr<GDALDimension> CreateDimension(
const std::string& osName,
1344 const std::string& osType,
1345 const std::string& osDirection,
1349 std::shared_ptr<GDALAttribute> CreateAttribute(
1350 const std::string& osName,
1351 const std::vector<GUInt64>& anDimensions,
1355 std::shared_ptr<GDALMDArray> CreateMDArray(
const std::string& osName,
1356 const std::vector<std::shared_ptr<GDALDimension>>& aoDimensions,
1360 void SetIsRootGroup();
1362 const std::shared_ptr<Ref>& GetRef()
const {
return m_poRefSelf; }
1363 VRTGroup* GetRootGroup()
const;
1365 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1367 void SetFilename(
const std::string& osFilename) { m_osFilename = osFilename; }
1368 void Serialize()
const;
1369 CPLXMLNode* SerializeToXML(
const char *pszVRTPathIn )
const;
1370 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn)
const;
1379 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1380 std::string m_osIndexingVariableName;
1383 VRTDimension(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1384 const std::string& osParentName,
1385 const std::string& osName,
1386 const std::string& osType,
1387 const std::string& osDirection,
1389 const std::string& osIndexingVariableName):
1390 GDALDimension(osParentName, osName, osType, osDirection, nSize),
1391 m_poGroupRef(poGroupRef),
1392 m_osIndexingVariableName(osIndexingVariableName)
1395 VRTGroup* GetGroup()
const;
1397 static std::shared_ptr<VRTDimension> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1398 const std::string& osParentName,
1415 std::vector<std::string> m_aosList{};
1416 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
1420 bool IRead(
const GUInt64* arrayStartIdx,
1421 const size_t* count,
1425 void* pDstBuffer)
const override;
1427 bool IWrite(
const GUInt64* arrayStartIdx,
1428 const size_t* count,
1432 const void* pSrcBuffer)
override;
1436 VRTAttribute(
const std::string& osParentName,
1437 const std::string& osName,
1439 std::vector<std::string>&& aosList):
1443 m_aosList(std::move(aosList))
1445 if( m_aosList.size() > 1 )
1447 m_dims.emplace_back(std::make_shared<GDALDimension>(
1448 std::string(),
"dim",
1449 std::string(), std::string(), m_aosList.size()));
1453 VRTAttribute(
const std::string& osParentName,
1454 const std::string& osName,
1463 m_dims.emplace_back(std::make_shared<GDALDimension>(
1464 std::string(),
"dim",
1465 std::string(), std::string(), nDim));
1469 static bool CreationCommonChecks(
const std::string& osName,
1470 const std::vector<GUInt64>& anDimensions,
1471 const std::map<std::string, std::shared_ptr<VRTAttribute>>& oMapAttributes);
1473 static std::shared_ptr<VRTAttribute> Create(
const std::string& osParentName,
1476 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1487 class VRTMDArraySource
1490 virtual ~VRTMDArraySource() =
default;
1492 virtual bool Read(
const GUInt64* arrayStartIdx,
1493 const size_t* count,
1497 void* pDstBuffer)
const = 0;
1499 virtual void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const = 0;
1509 friend class VRTGroup;
1511 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1512 std::string m_osVRTPath{};
1515 std::vector<std::shared_ptr<GDALDimension>> m_dims;
1516 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1517 std::vector<std::unique_ptr<VRTMDArraySource>> m_sources{};
1518 std::shared_ptr<OGRSpatialReference> m_poSRS{};
1519 std::vector<GByte> m_abyNoData{};
1520 std::string m_osUnit{};
1521 double m_dfScale = 1.0;
1522 double m_dfOffset = 0.0;
1523 bool m_bHasScale =
false;
1524 bool m_bHasOffset =
false;
1526 bool IRead(
const GUInt64* arrayStartIdx,
1527 const size_t* count,
1531 void* pDstBuffer)
const override;
1536 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1537 const std::string& osParentName,
1538 const std::string& osName,
1540 std::vector<std::shared_ptr<GDALDimension>>&& dims,
1541 std::map<std::string, std::shared_ptr<VRTAttribute>>&& oMapAttributes) :
1544 m_poGroupRef(poGroupRef),
1545 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1547 m_dims(std::move(dims)),
1548 m_oMapAttributes(std::move(oMapAttributes))
1552 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1553 const std::string& osParentName,
1554 const std::string& osName,
1555 const std::vector<std::shared_ptr<GDALDimension>>& dims,
1559 m_poGroupRef(poGroupRef),
1560 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1566 bool IsWritable()
const override {
return false; }
1568 static std::shared_ptr<VRTMDArray> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1569 const std::string& osParentName,
1572 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1580 std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const override {
return m_poSRS; }
1586 const std::string&
GetUnit()
const override {
return m_osUnit; }
1588 bool SetUnit(
const std::string& osUnit)
override {
1589 m_osUnit = osUnit;
return true; }
1593 if( pbHasOffset) *pbHasOffset = m_bHasOffset;
1600 if( pbHasScale) *pbHasScale = m_bHasScale;
1606 { SetDirty(); m_bHasOffset =
true; m_dfOffset = dfOffset;
return true; }
1609 { SetDirty(); m_bHasScale =
true; m_dfScale = dfScale;
return true; }
1611 void AddSource(std::unique_ptr<VRTMDArraySource>&& poSource);
1614 const std::string& osName,
1615 const std::vector<GUInt64>& anDimensions,
1624 GDALProgressFunc pfnProgress,
1625 void * pProgressData)
override;
1627 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn )
const;
1629 VRTGroup* GetGroup()
const;
1631 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1638 class VRTMDArraySourceInlinedValues final:
public VRTMDArraySource
1640 const VRTMDArray* m_poDstArray =
nullptr;
1641 bool m_bIsConstantValue;
1642 std::vector<GUInt64> m_anOffset{};
1643 std::vector<size_t> m_anCount{};
1644 std::vector<GByte> m_abyValues{};
1645 std::vector<size_t> m_anInlinedArrayStrideInBytes{};
1648 VRTMDArraySourceInlinedValues(
const VRTMDArraySourceInlinedValues&) =
delete;
1649 VRTMDArraySourceInlinedValues& operator=(
const VRTMDArraySourceInlinedValues&) =
delete;
1652 VRTMDArraySourceInlinedValues(
const VRTMDArray* poDstArray,
1653 bool bIsConstantValue,
1654 std::vector<GUInt64>&& anOffset,
1655 std::vector<size_t>&& anCount,
1656 std::vector<GByte>&& abyValues):
1657 m_poDstArray(poDstArray),
1658 m_bIsConstantValue(bIsConstantValue),
1659 m_anOffset(std::move(anOffset)),
1660 m_anCount(std::move(anCount)),
1661 m_abyValues(std::move(abyValues)),
1662 m_dt(poDstArray->GetDataType())
1664 const auto nDims(poDstArray->GetDimensionCount());
1665 m_anInlinedArrayStrideInBytes.resize(nDims);
1666 if( !bIsConstantValue && nDims > 0 )
1668 m_anInlinedArrayStrideInBytes.back() = poDstArray->GetDataType().GetSize();
1669 for(
size_t i = nDims - 1; i > 0; )
1672 m_anInlinedArrayStrideInBytes[i] =
1673 m_anInlinedArrayStrideInBytes[i+1] * m_anCount[i+1];
1678 ~VRTMDArraySourceInlinedValues();
1680 static std::unique_ptr<VRTMDArraySourceInlinedValues> Create(
1681 const VRTMDArray* poDstArray,
1684 bool Read(
const GUInt64* arrayStartIdx,
1685 const size_t* count,
1689 void* pDstBuffer)
const override;
1691 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1698 class VRTMDArraySourceRegularlySpaced final:
public VRTMDArraySource
1701 double m_dfIncrement;
1704 VRTMDArraySourceRegularlySpaced(
1705 double dfStart,
double dfIncrement):
1707 m_dfIncrement(dfIncrement)
1711 bool Read(
const GUInt64* arrayStartIdx,
1712 const size_t* count,
1716 void* pDstBuffer)
const override;
1718 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1725 class VRTMDArraySourceFromArray final:
public VRTMDArraySource
1727 const VRTMDArray* m_poDstArray =
nullptr;
1728 bool m_bRelativeToVRTSet =
false;
1729 bool m_bRelativeToVRT =
false;
1730 std::string m_osFilename{};
1731 std::string m_osArray{};
1732 std::string m_osBand{};
1733 std::vector<int> m_anTransposedAxis{};
1734 std::string m_osViewExpr{};
1735 std::vector<GUInt64> m_anSrcOffset{};
1736 mutable std::vector<GUInt64> m_anCount{};
1737 std::vector<GUInt64> m_anStep{};
1738 std::vector<GUInt64> m_anDstOffset{};
1740 VRTMDArraySourceFromArray(
const VRTMDArraySourceFromArray&) =
delete;
1741 VRTMDArraySourceFromArray& operator=(
const VRTMDArraySourceFromArray&) =
delete;
1744 VRTMDArraySourceFromArray(
const VRTMDArray* poDstArray,
1745 bool bRelativeToVRTSet,
1746 bool bRelativeToVRT,
1747 const std::string& osFilename,
1748 const std::string& osArray,
1749 const std::string& osBand,
1750 std::vector<int>&& anTransposedAxis,
1751 const std::string& osViewExpr,
1752 std::vector<GUInt64>&& anSrcOffset,
1753 std::vector<GUInt64>&& anCount,
1754 std::vector<GUInt64>&& anStep,
1755 std::vector<GUInt64>&& anDstOffset):
1756 m_poDstArray(poDstArray),
1757 m_bRelativeToVRTSet(bRelativeToVRTSet),
1758 m_bRelativeToVRT(bRelativeToVRT),
1759 m_osFilename(osFilename),
1762 m_anTransposedAxis(std::move(anTransposedAxis)),
1763 m_osViewExpr(osViewExpr),
1764 m_anSrcOffset(std::move(anSrcOffset)),
1765 m_anCount(std::move(anCount)),
1766 m_anStep(std::move(anStep)),
1767 m_anDstOffset(std::move(anDstOffset))
1771 ~VRTMDArraySourceFromArray()
override;
1773 static std::unique_ptr<VRTMDArraySourceFromArray> Create(
1774 const VRTMDArray* poDstArray,
1777 bool Read(
const GUInt64* arrayStartIdx,
1778 const size_t* count,
1782 void* pDstBuffer)
const override;
1784 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:442
Convenient string class based on std::string.
Definition: cpl_string.h:333
Abstract class, implemented by GDALAttribute and GDALMDArray.
Definition: gdal_priv.h:2060
virtual const std::vector< std::shared_ptr< GDALDimension > > & GetDimensions() const =0
Return the dimensions of an attribute/array.
virtual const GDALExtendedDataType & GetDataType() const =0
Return the data type of an attribute/array.
Class modeling an attribute that has a name, a value and a type, and is typically used to describe a ...
Definition: gdal_priv.h:2236
A color table / palette.
Definition: gdal_priv.h:1021
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:340
int Dereference()
Subtract one from dataset reference count.
Definition: gdaldataset.cpp:1371
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1790
int GetShared() const
Returns shared flag.
Definition: gdaldataset.cpp:1443
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition: gdal_priv.h:2569
virtual std::shared_ptr< GDALMDArray > GetIndexingVariable() const
Return the variable that is used to index the dimension (if there is one).
Definition: gdalmultidim.cpp:6717
virtual bool SetIndexingVariable(std::shared_ptr< GDALMDArray > poIndexingVariable)
Set the variable that is used to index the dimension.
Definition: gdalmultidim.cpp:6738
Format specific driver.
Definition: gdal_priv.h:1483
Class used to represent potentially complex data types.
Definition: gdal_priv.h:1800
Class modeling a named container of GDALAttribute, GDALMDArray or other GDALGroup.
Definition: gdal_priv.h:1964
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:234
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:203
Class modeling a multi-dimensional array.
Definition: gdal_priv.h:2353
virtual bool SetUnit(const std::string &osUnit)
Set the variable unit.
Definition: gdalmultidim.cpp:1955
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:3071
virtual bool IsWritable() const =0
Return whether an array is writable;.
virtual bool SetScale(double dfScale, GDALDataType eStorageType=GDT_Unknown)
Set the scale value to apply to raw values.
Definition: gdalmultidim.cpp:2151
virtual bool SetRawNoDataValue(const void *pRawNoData)
Set the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:2096
virtual double GetOffset(bool *pbHasOffset=nullptr, GDALDataType *peStorageType=nullptr) const
Get the offset value to apply to raw values.
Definition: gdalmultidim.cpp:2239
virtual const void * GetRawNoDataValue() const
Return the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:2031
virtual double GetScale(bool *pbHasScale=nullptr, GDALDataType *peStorageType=nullptr) const
Get the scale value to apply to raw values.
Definition: gdalmultidim.cpp:2209
virtual std::shared_ptr< OGRSpatialReference > GetSpatialRef() const
Return the spatial reference system object associated with the array.
Definition: gdalmultidim.cpp:2005
virtual bool SetSpatialRef(const OGRSpatialReference *poSRS)
Assign a spatial reference system object to the the array.
Definition: gdalmultidim.cpp:1991
virtual bool SetOffset(double dfOffset, GDALDataType eStorageType=GDT_Unknown)
Set the offset value to apply to raw values.
Definition: gdalmultidim.cpp:2180
virtual const std::string & GetUnit() const
Return the array unit.
Definition: gdalmultidim.cpp:1977
Object with metadata.
Definition: gdal_priv.h:136
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: gdalmajorobject.cpp:292
virtual char ** GetMetadataDomainList()
Fetch list of metadata domains.
Definition: gdalmajorobject.cpp:161
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
Class for dataset open functions.
Definition: gdal_priv.h:269
Pansharpening operation class.
Definition: gdalpansharpen.h:189
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:48
A single raster band (or channel).
Definition: gdal_priv.h:1127
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition: gdalrasterband.cpp:2837
High level image warping class.
Definition: gdalwarper.h:456
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:158
CPLErr
Error category.
Definition: cpl_error.h:53
struct _CPLHashSet CPLHashSet
Opaque type for a hash set.
Definition: cpl_hash_set.h:52
Definitions for CPL mini XML Parser/Serializer.
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition: cpl_port.h:289
#define CPL_NON_FINAL
Mark that a class is explicitly recognized as non-final.
Definition: cpl_port.h:1000
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
GIntBig GInt64
Signed 64 bit integer type.
Definition: cpl_port.h:267
#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:1007
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1216
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition: cpl_port.h:269
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:140
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:286
GDALAccess
Definition: gdal.h:115
@ GA_ReadOnly
Definition: gdal.h:116
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3675
GDALDataType
Definition: gdal.h:62
@ GDT_Unknown
Definition: gdal.h:63
GDALColorInterp
Definition: gdal.h:204
GDALRWFlag
Definition: gdal.h:121
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:897
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:271
Public (C callable) entry points for virtual GDAL dataset objects.
#define VRT_NODATA_UNSET
Special value to indicate that nodata is not set.
Definition: gdal_vrt.h:45
void * VRTDatasetH
Opaque type for a VRT dataset.
Definition: gdal_vrt.h:76
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
VRTDatasetH VRTCreate(int, int)
Definition: vrtdataset.cpp:79
Document node structure.
Definition: cpl_minixml.h:70
Ground Control Point.
Definition: gdal.h:679