I have an ecw file and I want create tile via gdal2tiles.py. The file is as follow:
Note: Green color is style of a polygon layer that is under the ecw layer.
I want to transparent nodata sections in tile generating, How can I do it?
I have an ecw file and I want create tile via gdal2tiles.py. The file is as follow:
Note: Green color is style of a polygon layer that is under the ecw layer.
I want to transparent nodata sections in tile generating, How can I do it?
I had a look into gdal2tiles.py code, and there is commented out part in update_no_data_values function with TODO: gbataille - check the need for this replacement. Seems to work without replace BandMapping tag for NODATA bands....
Well it seems it is not working that well. For now the fastest workaround I could find:
In QGIS top menu use Raster / Miscellaneous / Build Virtual Raster
Select your ECW as input layer, un-check Place each input file into a separate band, and in Advanced parameters add your desired nodata value (space separated) - depending on how many bands you have e.g. 255 255 255 255 (you can find number of bands in layer properties - information tab).
That is all, after that you can run gdal2tiles.py on your created vrt file, using your line from comment: gdal2tiles.py -z 18 file.vrt
You do not have to specify nodata value as it is capable to take it from vrt and make it transparent.
Additional no data valuewhen in set 255, I reach the desired result, but when I set 255,255,255 no desired result. – Morteza Malvandi Sep 23 '20 at 10:21