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?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
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.