id summary reporter owner description type status priority milestone component version severity resolution keywords cc
6642 gdal_translate incorrectly transfers very small int32 nodata pixel values during vrt mosaic pauldzy warmerdam "Hello,
I am pretty sure this a followup to https://trac.osgeo.org/gdal/ticket/6151.
Using GDAL 2.1.0:
gdalbuildvrt is working as expected but I assume there is another alteration needed in the mosaic section of gdal_translate.
Attached is a working example of issue:
1) Given two rasters in same coordinate space each with nodata value of -2147483647: fac_22M.tiff and fac_22G.tiff. Rasters obtained from US EPA NHDPlus project at https://www.epa.gov/waterdata/nhdplus-national-hydrography-dataset-plus
2) Execute '''gdallocationinfo -xml -b 1 -wgs84 fac_22M.tif 145.7 15.28''' to examine upper corner to verify value
{{{
-2147483647
}}}
3) Execute '''gdalbuild foo.vrt fac_22M.tif fac_22G.tif''' and check resulting vrt, everything looks good per 6151. See attached foo.vrt.
4) Execute '''gdal_translate -of GTiff foo.vrt foo.tif'''
5) Execute '''gdalinfo foo.tif''' and verify nodata remains -2147483647.
6) Execute '''gdallocationinfo -xml -b 1 -wgs84 foo.tif 144.6 15.28''' to check pixel in the padded area of the mosaic - all is good.
{{{
-2147483647
}}}
7) But then execute '''gdallocationinfo -xml -b 1 -wgs84 foo.tif 145.7 15.28''' to check the pixel value of nodata area of original raster.
{{{
-2147483648
}}}
For unknown reasons the original nodata values have shifted to -2147483648.
If I can clarify this any further just ask.
Thanks,
Paul
" defect closed normal 2.1.2 GDAL_Raster 2.1.0 normal fixed gdal_translate nodata