#5909 closed defect (fixed)
multiple gdalwarp invocations only preserves last image, when input has nodata
Reported by: | Robert Coup | Owned by: | Even Rouault |
---|---|---|---|
Priority: | high | Milestone: | 1.11.3 |
Component: | GDAL_Raster | Version: | 1.11.2 |
Severity: | normal | Keywords: | warp |
Cc: |
Description (last modified by )
somewhere between these two revisions (github:OSGeo/gdal/trunk), multiple gdalwarp invocations to the same output seem to end up with only the final input file's contents.
Good: e6cdad5a884f18e16c3660300d0fae542ff10a1b Bad: 4418c47ad62a42363357e03a33ecab674e6ac973
Built with JP2KAK, which it's using for the below.
Output changes (out.oldgdal.tif => correct, out.newgdal.tif => wrong):
gdalwarp '-multi' '-of' 'GTiff' '-co' 'TILED=YES' '-co' 'BIGTIFF=IF_SAFER' \ '-te' '174.255653381' '-36.1153205766' '174.290066734' '-36.1101806196' \ '-dstalpha' '-wo' 'INIT_DEST=0,0,0,0' '-ts' '4480' '669' \ '-s_srs' '+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +wktext' \ '-t_srs' '+proj=longlat +datum=WGS84 +no_defs +wktext' \ '--config' 'GDAL_CACHEMAX' '128' '-wm' '128' '-r' 'cubic' \ '00000010.jp2' 'out.tif' gdalwarp '-multi' '-s_srs' '+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +wktext' \ '-t_srs' '+proj=longlat +datum=WGS84 +no_defs +wktext' \ '--config' 'GDAL_CACHEMAX' '128' '-wm' '128' '-r' 'cubic' \ '0000001e.jp2' 'out.tif'
Possibly relevant commits from a quick look, still working through them, and trying to simplify the test case:
- Those relating to #5387
- 3793b0e (JP2KAK)
Change History (5)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Robert,
I've tried something quite similar to your attempt, and I don't find issue (which I'm rather happy since #5837 went into the stable branch). So your issue must be something more subtle...
Preparation steps to cut a RGB raster in 2 halves:
cp ../autotest/gdrivers/data/small_world.tif . gdal_translate small_world.tif small_world_left.tif -srcwin 0 0 200 200 gdal_translate small_world.tif small_world_right.tif -srcwin 200 0 200 200
Merging them together :
gdalwarp small_world_left.tif out.tif -overwrite -te -180 -90 180 90 -dstalpha -wo "INIT_DEST=0,0,0,0" gdalwarp small_world_right.tif out.tif
I've also testing something closer to your attempt (reprojection, tiling, bigger output size), but still working OK :
gdalwarp small_world_left.tif out.tif -overwrite -te -20000000 -20000000 20000000 20000000 -dstalpha -wo "INIT_DEST=0,0,0,0" -s_srs EPSG:4326 -t_srs EPSG:3857 -ts 4000 4000 -co tiled=yes gdalwarp small_world_right.tif out.tif -s_srs EPSG:4326 -t_srs EPSG:3857
comment:3 by , 9 years ago
Hi Even, sorry for the delay. Sample data (source & output) is at https://dl.dropboxusercontent.com/u/726114/sample-data.zip
comment:4 by , 9 years ago
Keywords: | warp added |
---|---|
Milestone: | → 1.11.3 |
Resolution: | → fixed |
Status: | new → closed |
Summary: | multiple gdalwarp invocations only preserves last image → multiple gdalwarp invocations only preserves last image, when input has nodata |
Version: | svn-trunk → 1.11.2 |
Argh, file upload issues. Dropbox link coming soon