Opened 19 years ago
Closed 13 years ago
#859 closed defect (fixed)
gdalwarp from VRTRasterBand SimpleSource to VRTRawRasterBand should create/update raw output file
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | major | Keywords: | |
Cc: |
Description (last modified by )
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 (2)
comment:2 by , 13 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 1.9.0 |
Resolution: | → fixed |
Status: | new → closed |
gdalwarp byte.tif test.vrt
where test.vrt is :
<VRTDataset rasterXSize="20" rasterYSize="20"> <SRS>PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982139006,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4267"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26711"]]</SRS> <GeoTransform> 4.4072000000000000e+05, 6.0000000000000000e+01, 0.0000000000000000e+00, 3.7513200000000000e+06, 0.0000000000000000e+00, -6.0000000000000000e+01</GeoTransform> <VRTRasterBand dataType="Byte" band="1" subClass="VRTRawRasterBand"> <ColorInterp>Gray</ColorInterp> <SourceFilename relativetoVRT="1">test.raw</SourceFilename> <ImageOffset>0</ImageOffset> <PixelOffset>1</PixelOffset> <LineOffset>20</LineOffset> </VRTRasterBand> </VRTDataset>
works.
And I've jsut fixed the case where test.raw didn't yet exist in r22776
Note:
See TracTickets
for help on using tickets.