#6599 closed defect (fixed)
Error when applying PixelFuntion to a VRTDerivedRasterBand
Reported by: | bugbuster | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.6 |
Component: | GDAL_Raster | Version: | 2.0.2 |
Severity: | normal | Keywords: | vrt derived |
Cc: |
Description
I have tried to apply a PixelFunction to a VRTDerivedRasterBand with no succes. My environment :
- windows 8 64 bits
- VisualC++ 2010
To illustrate the problem, I slightly modified gdal_translate.cpp code :
- add a GDALDerivedPixelFunc function (called SnafuFunc()), based on the great plugin developped by Antonio (see https://github.com/avalentino/gdal-pixfun-plugin)
- register the function along with plugins
GDALAddDerivedBandPixelFunc("MySnafuFunc", SnafuFunc); GDALAllRegister()
In every call to SnafuFunc(), I print several Input/output parameters. I noticed that I always get :
- nSources = 0
- papoSources = 0x000 (which is consistent with nSources being null)
The data I have used for this test are :
- original image : TIF gray scale 8-bit depth
- VRT image :
<VRTDataset rasterXSize="512" rasterYSize="512" > <VRTRasterBand dataType="Byte" band="1" subClass="VRTDerivedRasterBand"> <Description>SnafuFunc</Description> <PixelFunctionType>MySnafuFunc</PixelFunctionType> <SourceTransferType>Byte</SourceTransferType> <SimpleSource> <SourceFilename relativeToVRT="1">fubar_ori.tif</SourceFilename> <SourceBand>1</SourceBand> <SourceProperties RasterXSize="512" RasterYSize="512" DataType="Byte" /> <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/> <DstRect xOff="0" yOff="0" xSize="512" ySize="512"/> </SimpleSource> </VRTRasterBand> </VRTDataset>
Why do I always get nSources = 0 in every call to SnafuFunc() ? Every call to SnafuFunc() exit with a CE_Failure status. Am I doing something wrong ?
Thanks for your help
Attachments (3)
Change History (10)
by , 8 years ago
by , 8 years ago
Attachment: | fubar_ori.tif added |
---|
by , 8 years ago
Attachment: | gdal_translate_modified.cpp added |
---|
gdal_translate.cpp source code, with modification for SnafuFunc()
comment:6 by , 8 years ago
A workaround can be to modify the VRT and replace <SimpleSource> by <ComplexSource>.
comment:7 by , 8 years ago
Component: | default → GDAL_Raster |
---|---|
Keywords: | vrt derived added |
Milestone: | → 1.11.6 |
original TIF image