OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.9k stars 2.55k forks source link

gdal2tiles.py reproject dataset ignoring nodata value #1381

Open protodonuts opened 5 years ago

protodonuts commented 5 years ago

Expected behavior and actual behavior.

Expected behavior: gdal2tiles.py reprojection of dataset(nodata pixels set to white) using correct nodata argument( gdal2tiles.py -a 255,255,255 ...) should affect as the same with (gdalwrap -srcnodata '255 255 255' ...) Actual behavior:gdal2tiles.py -a 255,255,255 ... == gdalwrap -srcnodata '0 0 0' ...

As a result, there will be black triangle borders around the final tiles.

Operating system

Cygwin 3.0.3

GDAL version and provenance

2.4.0 from cygwin packages

jratike80 commented 5 years ago

Gdal2tiles creates tiles in png format with an alpha channel. If the area that is masked as nodata with alpha shows black for you it may be a problem on the image viewer side. If you still feel that there is a bug attach one small test image and full gdal2tiles command for reproducing the issue.

protodonuts commented 5 years ago

@jratike80 Thanks for your reply. Here is an example, using gdal 2.4.0 cygwin package.

gdal2tiles.py -w none -a 255,255,255 sample.tif tiles

9652 tiles.zip sample-dom.zip

Elter71 commented 1 year ago

Any update on this? @protodonuts Do you find work around for this issue?