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 virtual ~VRTSourcedRasterBand();
606 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
607 int nXSize,
int nYSize,
609 double* pdfDataPct)
override;
611 virtual char **GetMetadataDomainList()
override;
612 virtual const char *GetMetadataItem(
const char * pszName,
613 const char * pszDomain =
"" )
override;
614 virtual char **GetMetadata(
const char * pszDomain =
"" )
override;
615 virtual CPLErr SetMetadata(
char ** papszMetadata,
616 const char * pszDomain =
"" )
override;
617 virtual CPLErr SetMetadataItem(
const char * pszName,
618 const char * pszValue,
619 const char * pszDomain =
"" )
override;
622 std::map<CPLString, GDALDataset*>& )
override;
623 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
625 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
626 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
627 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
628 virtual CPLErr ComputeStatistics(
int bApproxOK,
629 double *pdfMin,
double *pdfMax,
630 double *pdfMean,
double *pdfStdDev,
631 GDALProgressFunc pfnProgress,
632 void *pProgressData )
override;
633 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
634 int nBuckets,
GUIntBig * panHistogram,
635 int bIncludeOutOfRange,
int bApproxOK,
636 GDALProgressFunc pfnProgress,
637 void *pProgressData )
override;
639 CPLErr AddSource( VRTSource * );
641 double dfSrcXOff=-1,
double dfSrcYOff=-1,
642 double dfSrcXSize=-1,
double dfSrcYSize=-1,
643 double dfDstXOff=-1,
double dfDstYOff=-1,
644 double dfDstXSize=-1,
double dfDstYSize=-1,
645 const char *pszResampling =
"near",
648 double dfSrcXOff=-1,
double dfSrcYOff=-1,
649 double dfSrcXSize=-1,
double dfSrcYSize=-1,
650 double dfDstXOff=-1,
double dfDstYOff=-1,
651 double dfDstXSize=-1,
double dfDstYSize=-1,
652 double dfScaleOff=0.0,
653 double dfScaleRatio=1.0,
655 int nColorTableComponent = 0);
658 double dfSrcXOff=-1,
double dfSrcYOff=-1,
659 double dfSrcXSize=-1,
660 double dfSrcYSize=-1,
661 double dfDstXOff=-1,
double dfDstYOff=-1,
662 double dfDstXSize=-1,
663 double dfDstYSize=-1 );
668 void ConfigureSource(VRTSimpleSource *poSimpleSource,
671 double dfSrcXOff,
double dfSrcYOff,
672 double dfSrcXSize,
double dfSrcYSize,
673 double dfDstXOff,
double dfDstYOff,
674 double dfDstXSize,
double dfDstYSize );
676 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
678 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
679 int *pnMaxSize,
CPLHashSet* hSetFiles)
override;
681 virtual int CloseDependentDatasets()
override;
683 virtual int IsSourcedRasterBand()
override {
return TRUE; }
685 virtual CPLErr FlushCache()
override;
692 class CPL_DLL VRTWarpedRasterBand final:
public VRTRasterBand
697 virtual ~VRTWarpedRasterBand();
699 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
701 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
702 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
704 virtual int GetOverviewCount()
override;
711 class VRTPansharpenedRasterBand final:
public VRTRasterBand
713 int m_nIndexAsPansharpenedBand;
716 VRTPansharpenedRasterBand(
719 virtual ~VRTPansharpenedRasterBand();
721 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
723 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
726 int nXOff,
int nYOff,
int nXSize,
int nYSize,
727 void * pData,
int nBufXSize,
int nBufYSize,
732 virtual int GetOverviewCount()
override;
735 virtual int IsPansharpenRasterBand()
override {
return TRUE; }
737 void SetIndexAsPansharpenedBand(
int nIdx )
738 { m_nIndexAsPansharpenedBand = nIdx; }
739 int GetIndexAsPansharpenedBand()
const
740 {
return m_nIndexAsPansharpenedBand; }
747 class VRTDerivedRasterBandPrivateData;
749 class CPL_DLL VRTDerivedRasterBand
CPL_NON_FINAL:
public VRTSourcedRasterBand
751 VRTDerivedRasterBandPrivateData* m_poPrivate;
752 bool InitializePython();
760 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand );
761 VRTDerivedRasterBand(
GDALDataset *poDS,
int nBand,
763 virtual ~VRTDerivedRasterBand();
770 virtual int IGetDataCoverageStatus(
int nXOff,
int nYOff,
771 int nXSize,
int nYSize,
773 double* pdfDataPct)
override;
775 static CPLErr AddPixelFunction(
const char *pszFuncName,
779 void SetPixelFunctionName(
const char *pszFuncName );
781 void SetPixelFunctionLanguage(
const char* pszLanguage );
784 std::map<CPLString, GDALDataset*>& )
override;
785 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
787 virtual double GetMinimum(
int *pbSuccess =
nullptr )
override;
788 virtual double GetMaximum(
int *pbSuccess =
nullptr )
override;
789 virtual CPLErr ComputeRasterMinMax(
int bApproxOK,
double* adfMinMax )
override;
790 virtual CPLErr ComputeStatistics(
int bApproxOK,
791 double *pdfMin,
double *pdfMax,
792 double *pdfMean,
double *pdfStdDev,
793 GDALProgressFunc pfnProgress,
794 void *pProgressData )
override;
795 virtual CPLErr GetHistogram(
double dfMin,
double dfMax,
796 int nBuckets,
GUIntBig * panHistogram,
797 int bIncludeOutOfRange,
int bApproxOK,
798 GDALProgressFunc pfnProgress,
799 void *pProgressData )
override;
801 static void Cleanup();
810 class CPL_DLL VRTRawRasterBand
CPL_NON_FINAL:
public VRTRasterBand
812 RawRasterBand *m_poRawRaster;
814 char *m_pszSourceFilename;
815 int m_bRelativeToVRT;
822 virtual ~VRTRawRasterBand();
825 std::map<CPLString, GDALDataset*>& )
override;
826 virtual CPLXMLNode * SerializeToXML(
const char *pszVRTPath )
override;
833 virtual CPLErr IReadBlock(
int,
int,
void * )
override;
834 virtual CPLErr IWriteBlock(
int,
int,
void * )
override;
836 CPLErr SetRawLink(
const char *pszFilename,
837 const char *pszVRTPath,
840 int nPixelOffset,
int nLineOffset,
841 const char *pszByteOrder );
848 char **papszOptions )
override;
850 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
851 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
864 virtual ~VRTDriver();
866 char **papszSourceParsers;
869 virtual char **
GetMetadata(
const char * pszDomain =
"" )
override;
871 const char * pszDomain =
"" )
override;
873 VRTSource *ParseSource(
CPLXMLNode *psSrc,
const char *pszVRTPath,
875 std::map<CPLString, GDALDataset*>& oMapSharedSources );
876 void AddSourceParser(
const char *pszElementName,
877 VRTSourceParser pfnParser );
884 class CPL_DLL VRTSimpleSource
CPL_NON_FINAL:
public VRTSource
889 friend class VRTSourcedRasterBand;
890 friend class VRTDataset;
909 double m_dfNoDataValue;
914 int m_bRelativeToVRTOri;
916 int m_nExplicitSharedStatus;
918 bool m_bDropRefOnSrcBand;
920 int NeedMaxValAdjustment()
const;
924 VRTSimpleSource(
const VRTSimpleSource* poSrcSource,
925 double dfXDstRatio,
double dfYDstRatio );
926 virtual ~VRTSimpleSource();
929 std::map<CPLString, GDALDataset*>& )
override;
930 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
934 void SetSrcWindow(
double,
double,
double,
double );
935 void SetDstWindow(
double,
double,
double,
double );
936 void SetNoDataValue(
double dfNoDataValue );
937 const CPLString& GetResampling()
const {
return m_osResampling; }
938 void SetResampling(
const char* pszResampling );
940 int GetSrcDstWindow(
int,
int,
int,
int,
int,
int,
941 double *pdfReqXOff,
double *pdfReqYOff,
942 double *pdfReqXSize,
double *pdfReqYSize,
943 int *,
int *,
int *,
int *,
944 int *,
int *,
int *,
int * );
947 int nXOff,
int nYOff,
int nXSize,
int nYSize,
948 void *pData,
int nBufXSize,
int nBufYSize,
953 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
954 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
955 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
956 double* adfMinMax )
override;
957 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
959 double *pdfMin,
double *pdfMax,
960 double *pdfMean,
double *pdfStdDev,
961 GDALProgressFunc pfnProgress,
962 void *pProgressData )
override;
963 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
964 double dfMin,
double dfMax,
965 int nBuckets,
GUIntBig * panHistogram,
966 int bIncludeOutOfRange,
int bApproxOK,
967 GDALProgressFunc pfnProgress,
968 void *pProgressData )
override;
970 void DstToSrc(
double dfX,
double dfY,
971 double &dfXOut,
double &dfYOut )
const;
972 void SrcToDst(
double dfX,
double dfY,
973 double &dfXOut,
double &dfYOut )
const;
975 virtual void GetFileList(
char*** ppapszFileList,
int *pnSize,
976 int *pnMaxSize,
CPLHashSet* hSetFiles )
override;
978 virtual int IsSimpleSource()
override {
return TRUE; }
979 virtual const char* GetType() {
return "SimpleSource"; }
980 virtual CPLErr FlushCache()
override;
983 GDALRasterBand* GetMaskBandMainBand() {
return m_poMaskBandMainBand; }
984 int IsSameExceptBandNumber( VRTSimpleSource* poOtherSource );
987 int nXOff,
int nYOff,
int nXSize,
int nYSize,
988 void * pData,
int nBufXSize,
int nBufYSize,
990 int nBandCount,
int *panBandMap,
995 void UnsetPreservedRelativeFilenames();
997 void SetMaxValue(
int nVal ) { m_nMaxValue = nVal; }
1004 class VRTAveragedSource final:
public VRTSimpleSource
1009 VRTAveragedSource();
1011 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1012 void *pData,
int nBufXSize,
int nBufYSize,
1017 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1018 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1019 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1020 double* adfMinMax )
override;
1021 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1023 double *pdfMin,
double *pdfMax,
1024 double *pdfMean,
double *pdfStdDev,
1025 GDALProgressFunc pfnProgress,
1026 void *pProgressData )
override;
1027 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1028 double dfMin,
double dfMax,
1029 int nBuckets,
GUIntBig * panHistogram,
1030 int bIncludeOutOfRange,
int bApproxOK,
1031 GDALProgressFunc pfnProgress,
1032 void *pProgressData )
override;
1034 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1035 virtual const char* GetType()
override {
return "AveragedSource"; }
1046 VRT_SCALING_EXPONENTIAL,
1047 } VRTComplexSourceScaling;
1049 class CPL_DLL VRTComplexSource
CPL_NON_FINAL:
public VRTSimpleSource
1052 bool AreValuesUnchanged()
const;
1055 VRTComplexSourceScaling m_eScalingType;
1056 double m_dfScaleOff;
1057 double m_dfScaleRatio;
1060 int m_bSrcMinMaxDefined;
1065 double m_dfExponent;
1067 int m_nColorTableComponent;
1069 template <
class WorkingDT>
1070 CPLErr RasterIOInternal(
int nReqXOff,
int nReqYOff,
1071 int nReqXSize,
int nReqYSize,
1072 void *pData,
int nOutXSize,
int nOutYSize,
1080 VRTComplexSource(
const VRTComplexSource* poSrcSource,
1081 double dfXDstRatio,
double dfYDstRatio);
1082 virtual ~VRTComplexSource();
1085 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1086 void *pData,
int nBufXSize,
int nBufYSize,
1091 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1092 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1093 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1094 double* adfMinMax )
override;
1095 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1097 double *pdfMin,
double *pdfMax,
1098 double *pdfMean,
double *pdfStdDev,
1099 GDALProgressFunc pfnProgress,
1100 void *pProgressData )
override;
1101 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1102 double dfMin,
double dfMax,
1103 int nBuckets,
GUIntBig * panHistogram,
1104 int bIncludeOutOfRange,
int bApproxOK,
1105 GDALProgressFunc pfnProgress,
1106 void *pProgressData )
override;
1108 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1110 std::map<CPLString, GDALDataset*>& )
override;
1111 virtual const char* GetType()
override {
return "ComplexSource"; }
1113 double LookupValue(
double dfInput );
1115 void SetLinearScaling(
double dfOffset,
double dfScale );
1116 void SetPowerScaling(
double dfExponent,
1121 void SetColorTableComponent(
int nComponent );
1123 double *m_padfLUTInputs;
1124 double *m_padfLUTOutputs;
1125 int m_nLUTItemCount;
1132 class VRTFilteredSource
CPL_NON_FINAL:
public VRTComplexSource
1140 int m_nSupportedTypesCount;
1143 int m_nExtraEdgePixels;
1146 VRTFilteredSource();
1147 virtual ~VRTFilteredSource();
1149 void SetExtraEdgePixels(
int );
1150 void SetFilteringDataTypesSupported(
int,
GDALDataType * );
1153 GByte *pabySrcData,
GByte *pabyDstData ) = 0;
1156 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1157 void *pData,
int nBufXSize,
int nBufYSize,
1167 class VRTKernelFilteredSource
CPL_NON_FINAL:
public VRTFilteredSource
1176 double *m_padfKernelCoefs;
1181 VRTKernelFilteredSource();
1182 virtual ~VRTKernelFilteredSource();
1185 std::map<CPLString, GDALDataset*>& )
override;
1186 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1189 GByte *pabySrcData,
GByte *pabyDstData )
override;
1191 CPLErr SetKernel(
int nKernelSize,
bool bSeparable,
double *padfCoefs );
1192 void SetNormalized(
int );
1199 class VRTAverageFilteredSource final:
public VRTKernelFilteredSource
1204 explicit VRTAverageFilteredSource(
int nKernelSize );
1205 virtual ~VRTAverageFilteredSource();
1208 std::map<CPLString, GDALDataset*>& )
override;
1209 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1215 class VRTFuncSource final:
public VRTSource
1221 virtual ~VRTFuncSource();
1224 std::map<CPLString, GDALDataset*>& )
override {
return CE_Failure; }
1225 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath )
override;
1228 int nXOff,
int nYOff,
int nXSize,
int nYSize,
1229 void *pData,
int nBufXSize,
int nBufYSize,
1234 virtual double GetMinimum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1235 virtual double GetMaximum(
int nXSize,
int nYSize,
int *pbSuccess )
override;
1236 virtual CPLErr ComputeRasterMinMax(
int nXSize,
int nYSize,
int bApproxOK,
1237 double* adfMinMax )
override;
1238 virtual CPLErr ComputeStatistics(
int nXSize,
int nYSize,
1240 double *pdfMin,
double *pdfMax,
1241 double *pdfMean,
double *pdfStdDev,
1242 GDALProgressFunc pfnProgress,
1243 void *pProgressData )
override;
1244 virtual CPLErr GetHistogram(
int nXSize,
int nYSize,
1245 double dfMin,
double dfMax,
1246 int nBuckets,
GUIntBig * panHistogram,
1247 int bIncludeOutOfRange,
int bApproxOK,
1248 GDALProgressFunc pfnProgress,
1249 void *pProgressData )
override;
1263 #define TMP_CPL_DLL CPL_DLL
1278 explicit Ref(VRTGroup* ptr): m_ptr(ptr) {}
1279 Ref(
const Ref&) =
delete;
1280 Ref& operator=(
const Ref&) =
delete;
1284 std::shared_ptr<Ref> m_poSharedRefRootGroup{};
1285 std::weak_ptr<Ref> m_poWeakRefRootGroup{};
1286 std::shared_ptr<Ref> m_poRefSelf{};
1288 std::string m_osFilename{};
1289 mutable bool m_bDirty =
false;
1290 std::string m_osVRTPath{};
1291 std::map<std::string, std::shared_ptr<VRTGroup>> m_oMapGroups{};
1292 std::map<std::string, std::shared_ptr<VRTMDArray>> m_oMapMDArrays{};
1293 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1294 std::map<std::string, std::shared_ptr<VRTDimension>> m_oMapDimensions{};
1296 std::shared_ptr<VRTGroup> OpenGroupInternal(
const std::string& osName)
const;
1297 void SetRootGroupRef(
const std::weak_ptr<Ref>& rgRef);
1298 std::weak_ptr<Ref> GetRootGroupRef()
const;
1302 VRTGroup(
const std::string& osParentName,
const std::string& osName);
1305 bool XMLInit(
const std::shared_ptr<VRTGroup>& poRoot,
1306 const std::shared_ptr<VRTGroup>& poThisGroup,
1308 const char* pszVRTPath);
1310 std::vector<std::string> GetMDArrayNames(
CSLConstList papszOptions)
const override;
1311 std::shared_ptr<GDALMDArray> OpenMDArray(
const std::string& osName,
1314 std::vector<std::string> GetGroupNames(
CSLConstList papszOptions)
const override;
1315 std::shared_ptr<GDALGroup> OpenGroup(
const std::string& osName,
1318 return OpenGroupInternal(osName);
1321 std::vector<std::shared_ptr<GDALDimension>> GetDimensions(
CSLConstList)
const override;
1323 std::vector<std::shared_ptr<GDALAttribute>> GetAttributes(
CSLConstList)
const override;
1325 std::shared_ptr<VRTDimension> GetDimension(
const std::string& name)
const {
1326 auto oIter = m_oMapDimensions.find(name);
1327 return oIter == m_oMapDimensions.end() ? nullptr : oIter->second;
1329 std::shared_ptr<VRTDimension> GetDimensionFromFullName(
const std::string& name,
1330 bool bEmitError)
const;
1332 std::shared_ptr<GDALGroup> CreateGroup(
const std::string& osName,
1335 std::shared_ptr<GDALDimension> CreateDimension(
const std::string& osName,
1336 const std::string& osType,
1337 const std::string& osDirection,
1341 std::shared_ptr<GDALAttribute> CreateAttribute(
1342 const std::string& osName,
1343 const std::vector<GUInt64>& anDimensions,
1347 std::shared_ptr<GDALMDArray> CreateMDArray(
const std::string& osName,
1348 const std::vector<std::shared_ptr<GDALDimension>>& aoDimensions,
1352 void SetIsRootGroup();
1354 const std::shared_ptr<Ref>& GetRef()
const {
return m_poRefSelf; }
1355 VRTGroup* GetRootGroup()
const;
1357 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1359 void SetFilename(
const std::string& osFilename) { m_osFilename = osFilename; }
1360 void Serialize()
const;
1361 CPLXMLNode* SerializeToXML(
const char *pszVRTPathIn )
const;
1362 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn)
const;
1371 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1372 std::string m_osIndexingVariableName;
1375 VRTDimension(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1376 const std::string& osParentName,
1377 const std::string& osName,
1378 const std::string& osType,
1379 const std::string& osDirection,
1381 const std::string& osIndexingVariableName):
1382 GDALDimension(osParentName, osName, osType, osDirection, nSize),
1383 m_poGroupRef(poGroupRef),
1384 m_osIndexingVariableName(osIndexingVariableName)
1387 VRTGroup* GetGroup()
const;
1389 static std::shared_ptr<VRTDimension> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1390 const std::string& osParentName,
1407 std::vector<std::string> m_aosList{};
1408 std::vector<std::shared_ptr<GDALDimension>> m_dims{};
1412 bool IRead(
const GUInt64* arrayStartIdx,
1413 const size_t* count,
1417 void* pDstBuffer)
const override;
1419 bool IWrite(
const GUInt64* arrayStartIdx,
1420 const size_t* count,
1424 const void* pSrcBuffer)
override;
1428 VRTAttribute(
const std::string& osParentName,
1429 const std::string& osName,
1431 std::vector<std::string>&& aosList):
1435 m_aosList(std::move(aosList))
1437 if( m_aosList.size() > 1 )
1439 m_dims.emplace_back(std::make_shared<GDALDimension>(
1440 std::string(),
"dim",
1441 std::string(), std::string(), m_aosList.size()));
1445 VRTAttribute(
const std::string& osParentName,
1446 const std::string& osName,
1455 m_dims.emplace_back(std::make_shared<GDALDimension>(
1456 std::string(),
"dim",
1457 std::string(), std::string(), nDim));
1461 static bool CreationCommonChecks(
const std::string& osName,
1462 const std::vector<GUInt64>& anDimensions,
1463 const std::map<std::string, std::shared_ptr<VRTAttribute>>& oMapAttributes);
1465 static std::shared_ptr<VRTAttribute> Create(
const std::string& osParentName,
1468 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1479 class VRTMDArraySource
1482 virtual ~VRTMDArraySource() =
default;
1484 virtual bool Read(
const GUInt64* arrayStartIdx,
1485 const size_t* count,
1489 void* pDstBuffer)
const = 0;
1491 virtual void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const = 0;
1501 friend class VRTGroup;
1503 std::weak_ptr<VRTGroup::Ref> m_poGroupRef;
1504 std::string m_osVRTPath{};
1507 std::vector<std::shared_ptr<GDALDimension>> m_dims;
1508 std::map<std::string, std::shared_ptr<VRTAttribute>> m_oMapAttributes{};
1509 std::vector<std::unique_ptr<VRTMDArraySource>> m_sources{};
1510 std::shared_ptr<OGRSpatialReference> m_poSRS{};
1511 std::vector<GByte> m_abyNoData{};
1512 std::string m_osUnit{};
1513 double m_dfScale = 1.0;
1514 double m_dfOffset = 0.0;
1515 bool m_bHasScale =
false;
1516 bool m_bHasOffset =
false;
1518 bool IRead(
const GUInt64* arrayStartIdx,
1519 const size_t* count,
1523 void* pDstBuffer)
const override;
1528 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1529 const std::string& osParentName,
1530 const std::string& osName,
1532 std::vector<std::shared_ptr<GDALDimension>>&& dims,
1533 std::map<std::string, std::shared_ptr<VRTAttribute>>&& oMapAttributes) :
1536 m_poGroupRef(poGroupRef),
1537 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1539 m_dims(std::move(dims)),
1540 m_oMapAttributes(std::move(oMapAttributes))
1544 VRTMDArray(
const std::shared_ptr<VRTGroup::Ref>& poGroupRef,
1545 const std::string& osParentName,
1546 const std::string& osName,
1547 const std::vector<std::shared_ptr<GDALDimension>>& dims,
1551 m_poGroupRef(poGroupRef),
1552 m_osVRTPath(poGroupRef->m_ptr->GetVRTPath()),
1558 bool IsWritable()
const override {
return false; }
1560 static std::shared_ptr<VRTMDArray> Create(
const std::shared_ptr<VRTGroup>& poThisGroup,
1561 const std::string& osParentName,
1564 const std::vector<std::shared_ptr<GDALDimension>>&
GetDimensions()
const override {
return m_dims; }
1572 std::shared_ptr<OGRSpatialReference>
GetSpatialRef()
const override {
return m_poSRS; }
1578 const std::string&
GetUnit()
const override {
return m_osUnit; }
1580 bool SetUnit(
const std::string& osUnit)
override {
1581 m_osUnit = osUnit;
return true; }
1583 double GetOffset(
bool* pbHasOffset)
const override
1585 if( pbHasOffset) *pbHasOffset = m_bHasOffset;
1589 double GetScale(
bool* pbHasScale)
const override
1591 if( pbHasScale) *pbHasScale = m_bHasScale;
1595 bool SetOffset(
double dfOffset)
override
1596 { SetDirty(); m_bHasOffset =
true; m_dfOffset = dfOffset;
return true; }
1598 bool SetScale(
double dfScale)
override
1599 { SetDirty(); m_bHasScale =
true; m_dfScale = dfScale;
return true; }
1601 void AddSource(std::unique_ptr<VRTMDArraySource>&& poSource);
1604 const std::string& osName,
1605 const std::vector<GUInt64>& anDimensions,
1614 GDALProgressFunc pfnProgress,
1615 void * pProgressData)
override;
1617 void Serialize(
CPLXMLNode* psParent,
const char *pszVRTPathIn )
const;
1619 VRTGroup* GetGroup()
const;
1621 const std::string& GetVRTPath()
const {
return m_osVRTPath; }
1628 class VRTMDArraySourceInlinedValues final:
public VRTMDArraySource
1630 const VRTMDArray* m_poDstArray =
nullptr;
1631 bool m_bIsConstantValue;
1632 std::vector<GUInt64> m_anOffset{};
1633 std::vector<size_t> m_anCount{};
1634 std::vector<GByte> m_abyValues{};
1635 std::vector<size_t> m_anInlinedArrayStrideInBytes{};
1638 VRTMDArraySourceInlinedValues(
const VRTMDArraySourceInlinedValues&) =
delete;
1639 VRTMDArraySourceInlinedValues& operator=(
const VRTMDArraySourceInlinedValues&) =
delete;
1642 VRTMDArraySourceInlinedValues(
const VRTMDArray* poDstArray,
1643 bool bIsConstantValue,
1644 std::vector<GUInt64>&& anOffset,
1645 std::vector<size_t>&& anCount,
1646 std::vector<GByte>&& abyValues):
1647 m_poDstArray(poDstArray),
1648 m_bIsConstantValue(bIsConstantValue),
1649 m_anOffset(std::move(anOffset)),
1650 m_anCount(std::move(anCount)),
1651 m_abyValues(std::move(abyValues)),
1652 m_dt(poDstArray->GetDataType())
1654 const auto nDims(poDstArray->GetDimensionCount());
1655 m_anInlinedArrayStrideInBytes.resize(nDims);
1656 if( !bIsConstantValue && nDims > 0 )
1658 m_anInlinedArrayStrideInBytes.back() = poDstArray->GetDataType().GetSize();
1659 for(
size_t i = nDims - 1; i > 0; )
1662 m_anInlinedArrayStrideInBytes[i] =
1663 m_anInlinedArrayStrideInBytes[i+1] * m_anCount[i+1];
1668 ~VRTMDArraySourceInlinedValues();
1670 static std::unique_ptr<VRTMDArraySourceInlinedValues> Create(
1671 const VRTMDArray* poDstArray,
1674 bool Read(
const GUInt64* arrayStartIdx,
1675 const size_t* count,
1679 void* pDstBuffer)
const override;
1681 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1688 class VRTMDArraySourceRegularlySpaced final:
public VRTMDArraySource
1691 double m_dfIncrement;
1694 VRTMDArraySourceRegularlySpaced(
1695 double dfStart,
double dfIncrement):
1697 m_dfIncrement(dfIncrement)
1701 bool Read(
const GUInt64* arrayStartIdx,
1702 const size_t* count,
1706 void* pDstBuffer)
const override;
1708 void Serialize(
CPLXMLNode* psParent,
const char* pszVRTPath)
const override;
1715 class VRTMDArraySourceFromArray final:
public VRTMDArraySource
1717 const VRTMDArray* m_poDstArray =
nullptr;
1718 bool m_bRelativeToVRTSet =
false;
1719 bool m_bRelativeToVRT =
false;
1720 std::string m_osFilename{};
1721 std::string m_osArray{};
1722 std::string m_osBand{};
1723 std::vector<int> m_anTransposedAxis{};
1724 std::string m_osViewExpr{};
1725 std::vector<GUInt64> m_anSrcOffset{};
1726 mutable std::vector<GUInt64> m_anCount{};
1727 std::vector<GUInt64> m_anStep{};
1728 std::vector<GUInt64> m_anDstOffset{};
1730 VRTMDArraySourceFromArray(
const VRTMDArraySourceFromArray&) =
delete;
1731 VRTMDArraySourceFromArray& operator=(
const VRTMDArraySourceFromArray&) =
delete;
1734 VRTMDArraySourceFromArray(
const VRTMDArray* poDstArray,
1735 bool bRelativeToVRTSet,
1736 bool bRelativeToVRT,
1737 const std::string& osFilename,
1738 const std::string& osArray,
1739 const std::string& osBand,
1740 std::vector<int>&& anTransposedAxis,
1741 const std::string& osViewExpr,
1742 std::vector<GUInt64>&& anSrcOffset,
1743 std::vector<GUInt64>&& anCount,
1744 std::vector<GUInt64>&& anStep,
1745 std::vector<GUInt64>&& anDstOffset):
1746 m_poDstArray(poDstArray),
1747 m_bRelativeToVRTSet(bRelativeToVRTSet),
1748 m_bRelativeToVRT(bRelativeToVRT),
1749 m_osFilename(osFilename),
1752 m_anTransposedAxis(std::move(anTransposedAxis)),
1753 m_osViewExpr(osViewExpr),
1754 m_anSrcOffset(std::move(anSrcOffset)),
1755 m_anCount(std::move(anCount)),
1756 m_anStep(std::move(anStep)),
1757 m_anDstOffset(std::move(anDstOffset))
1761 ~VRTMDArraySourceFromArray()
override;
1763 static std::unique_ptr<VRTMDArraySourceFromArray> Create(
1764 const VRTMDArray* poDstArray,
1767 bool Read(
const GUInt64* arrayStartIdx,
1768 const size_t* count,
1772 void* pDstBuffer)
const override;
1774 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:2044
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:2220
A color table / palette.
Definition: gdal_priv.h:1006
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:1366
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1783
int GetShared() const
Returns shared flag.
Definition: gdaldataset.cpp:1438
Class modeling a a dimension / axis used to index multidimensional arrays.
Definition: gdal_priv.h:2550
virtual std::shared_ptr< GDALMDArray > GetIndexingVariable() const
Return the variable that is used to index the dimension (if there is one).
Definition: gdalmultidim.cpp:6252
virtual bool SetIndexingVariable(std::shared_ptr< GDALMDArray > poIndexingVariable)
Set the variable that is used to index the dimension.
Definition: gdalmultidim.cpp:6273
Format specific driver.
Definition: gdal_priv.h:1468
Class used to represent potentially complex data types.
Definition: gdal_priv.h:1785
Class modeling a named container of GDALAttribute, GDALMDArray or other GDALGroup.
Definition: gdal_priv.h:1949
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:147
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:116
Class modeling a multi-dimensional array.
Definition: gdal_priv.h:2337
virtual bool SetUnit(const std::string &osUnit)
Set the variable unit.
Definition: gdalmultidim.cpp:1677
virtual bool SetOffset(double dfOffset)
Set the offset value to apply to raw values.
Definition: gdalmultidim.cpp:1887
virtual double GetScale(bool *pbHasScale=nullptr) const
Get the scale value to apply to raw values.
Definition: gdalmultidim.cpp:1912
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:2753
virtual bool IsWritable() const =0
Return whether an array is writable;.
virtual bool SetRawNoDataValue(const void *pRawNoData)
Set the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:1818
virtual const void * GetRawNoDataValue() const
Return the nodata value as a "raw" value.
Definition: gdalmultidim.cpp:1753
virtual std::shared_ptr< OGRSpatialReference > GetSpatialRef() const
Return the spatial reference system object associated with the array.
Definition: gdalmultidim.cpp:1727
virtual bool SetSpatialRef(const OGRSpatialReference *poSRS)
Assign a spatial reference system object to the the array.
Definition: gdalmultidim.cpp:1713
virtual double GetOffset(bool *pbHasOffset=nullptr) const
Get the offset value to apply to raw values.
Definition: gdalmultidim.cpp:1938
virtual bool SetScale(double dfScale)
Set the scale value to apply to raw values.
Definition: gdalmultidim.cpp:1866
virtual const std::string & GetUnit() const
Return the array unit.
Definition: gdalmultidim.cpp:1699
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:1112
GDALDataset * GetDataset()
Fetch the owning dataset handle.
Definition: gdalrasterband.cpp:2837
High level image warping class.
Definition: gdalwarper.h:451
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.
#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
GIntBig GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition: cpl_port.h:286
#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:276
GDALAccess
Definition: gdal.h:113
@ GA_ReadOnly
Definition: gdal.h:114
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3656
GDALDataType
Definition: gdal.h:60
@ GDT_Unknown
Definition: gdal.h:61
GDALColorInterp
Definition: gdal.h:194
GDALRWFlag
Definition: gdal.h:119
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:881
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:261
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:669