gdalbuildvrt error when mosaicking SRTM data with different NoData values

المشرف العام

Administrator
طاقم الإدارة
I'm attempting to mosaic together 9 SRTM tiles downloaded from CGIAR to produce a DEM of Borneo. I'm using:

gdalbuildvrt Borneo.vrt BorneoSRTM/*.tifwhere BorneoSRTM contains the 9 tif files to be combined. The command runs without error, however the resulting DEM looks like the below image and all the elevations are less than 13m (some of the input files have elevations close to 4000 m).


Clearly there's a problem with the tile corresponding to the big white square (5-10N, 110-115E). Looking at the original tif files and I've noticed that NoData is 255 for the problem tile and -32768 for all others. I tried changing NoData to -32768 using:

gdal_translate -a_nodata -32768 srtm_59_11.tif out.tifbut this didn't solve the problem.

Calling gdalinfo on the problem tile gives:

Driver: GTiff/GeoTIFFFiles: srtm_59_11.tif srtm_59_11.tfwSize is 6001, 6001Coordinate System is:GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]]Origin = (109.999583817610983,10.000416763514124)Pixel Size = (0.000833333333333,-0.000833333333333)Metadata: AREA_OR_POINT=AreaImage Structure Metadata: INTERLEAVE=BANDCorner Coordinates:Upper Left ( 109.9995838, 10.0004168) Lower Left ( 109.9995838, 4.9995834) Upper Right ( 115.0004172, 10.0004168) Lower Right ( 115.0004172, 4.9995834) Center ( 112.5000005, 7.5000001) Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray NoData Value=255And, calling it on another tile gives:

Driver: GTiff/GeoTIFFFiles: srtm_59_12.tif srtm_59_12.tfwSize is 6001, 6001Coordinate System is:GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]]Origin = (109.999583817610983,5.000416642442191)Pixel Size = (0.000833333333333,-0.000833333333333)Metadata: AREA_OR_POINT=AreaImage Structure Metadata: INTERLEAVE=BANDCorner Coordinates:Upper Left ( 109.9995838, 5.0004166) Lower Left ( 109.9995838, -0.0004167) Upper Right ( 115.0004172, 5.0004166) Lower Right ( 115.0004172, -0.0004167) Center ( 112.5000005, 2.5000000) Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray NoData Value=-32768When I call gdalbuildvrt without this problem tile, everything works fine. I realize that this tile only includes a tiny piece of Borneo, but if possible I'd like to figure out a way to include it. Any help would be appreciated.



أكثر...
 
أعلى