Ticket #859 (closed defect: fixed)
gdalwarp from VRTRasterBand SimpleSource to VRTRawRasterBand should create/update raw output file
| Reported by: | dkleiner@… | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.0 |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | major | Keywords: | |
| Cc: |
Description (last modified by rouault) (diff)
Overview Description:
Trying to write to a VRT dataset that uses VRTRawRasterBands does not properly
create or update the file named by <SourceFilename>. Using gdalwarp, either the
whole VRT file is overwritten as a GeoTIFF file if the <SourceFilename> does not
exists, or an read-only error is generated if <SourceFilename> does exists.
Steps to Reproduce:
1) Create a small grey-scale TIFF file, 512 x 512, named 'test-in.tif'.
2) Create 'test-in.vrt' to add some (meaningless) georeferencing:
<VRTDataset rasterXSize="512" rasterYSize="512">
<SRS>WGS84</SRS>
<GeoTransform>0.0, 0.1, 0.0, 0.0, 0.0, -0.1</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Gray</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">test-in.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
<DstRect xOff="0" yOff="0" xSize="512" ySize="512"/>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
3) Create 'test-out.vrt' to specify a raw output file:
<VRTDataset rasterXSize="512" rasterYSize="512">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTRawRasterBand">
<ColorInterp>Gray</ColorInterp>
<SourceFilename relativetoVRT="1">test-out.raw</SourceFilename>
<ImageOffset>0</ImageOffset>
<PixelOffset>1</PixelOffset>
<LineOffset>512</LineOffset>
</VRTRasterBand>
</VRTDataset>
4) $ gdalwarp test-in.vrt test-out.vrt
Creating output file that is 512P x 512L.
:0...10...20...30...40...50...60...70...80...90...100 - done.
5) $ file test-out.vrt
test-out.vrt: TIFF image data, little-endian
6) Make test-out.vrt again as in step 3.
7) $ touch test-out.raw
8) $ gdalwarp test-in.vrt test-out.vrt
ERROR 5: Destination band 1 appears to be read-only.
Actual Results:
Either the output VRT file is overwritten as a GeoTIFF file, or an error message
indicating read-only state of the output is given.
Expected Results:
The test-out.raw file should be created or updated with the raw image data. The
file should be of size 262144 bytes. Each byte should be the gray-scale
equivalent of the corresponding pixel in the original source TIFF.
Build Version:
$ gdalinfo --version
GDAL 1.2.6.0, released 2005/03/13
Platform:
Red Hat Fedora Core 1
Change History
Note: See
TracTickets for help on using
tickets.
