Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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 :

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)

fubar.vrt (645 bytes ) - added by bugbuster 8 years ago.
fubar_ori.tif (256.4 KB ) - added by bugbuster 8 years ago.
original TIF image
gdal_translate_modified.cpp (75.2 KB ) - added by bugbuster 8 years ago.
gdal_translate.cpp source code, with modification for SnafuFunc()

Download all attachments as: .zip

Change History (10)

by bugbuster, 8 years ago

Attachment: fubar.vrt added

by bugbuster, 8 years ago

Attachment: fubar_ori.tif added

original TIF image

by bugbuster, 8 years ago

Attachment: gdal_translate_modified.cpp added

gdal_translate.cpp source code, with modification for SnafuFunc()

comment:1 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

In 34728:

VRT: make CheckCompatibleForDatasetIO() return FALSE on VRTDerivedRasterBands (fixes #6599)

comment:2 by Even Rouault, 8 years ago

In 34729:

Test fixes #6599

comment:3 by Even Rouault, 8 years ago

In 34730:

VRT: make CheckCompatibleForDatasetIO() return FALSE on VRTDerivedRasterBands (fixes #6599)

comment:4 by Even Rouault, 8 years ago

In 34731:

VRT: make CheckCompatibleForDatasetIO() return FALSE on VRTDerivedRasterBands (fixes #6599)

comment:5 by Even Rouault, 8 years ago

In 34732:

VRT: make CheckCompatibleForDatasetIO() return FALSE on VRTDerivedRasterBands (fixes #6599)

comment:6 by Even Rouault, 8 years ago

A workaround can be to modify the VRT and replace <SimpleSource> by <ComplexSource>.

comment:7 by Even Rouault, 8 years ago

Component: defaultGDAL_Raster
Keywords: vrt derived added
Milestone: 1.11.6
Note: See TracTickets for help on using tickets.