2

I read nice tutorial about making transparent DEM TIFF on (Creating transparent hillshade?)

My Goal is creating transparent PNG tiles from transparent GeoTIFF for serving my own TMS map service.

I followed tutorial with SRTM1 N35E128.hgt dem file

  1. gdaldem hillshade c:\n35e128.hgt c:\hillshade.tmp.tif -s 111120 -z 5 -az 315 -alt 60 -compute_edges

  2. gdal_calc -A c:\hillshade.tmp.tif --outfile=c:\opacity.tif --calc="255-A"

  3. gdalbuildvrt -separate c:\final.vrt c:\hillshade.tmp.tif c:\opacity.tif

  4. gdal_translate -of Gtiff c:\final.vrt c:\final.tif

enter image description here

At last I got final.tif (please check attatched file)

----> https://mega.nz/#!2XYhiQoY!YPzrS0Z_9CGvIJIRkkSDlJ5M3biW9gvrGr7SHSNjYnU

enter image description here

then I execute

gdal2tiles -z 13 c:\final.tif c:\output

But output PNG files are not transparent at all.

(nodata option or -a 0,0,0,0 wasn't effective)

And then I open the tif file with glabal mapper and export TMS tiles (with trnasparent png option checked) but the result was the same. Just blank area of tile was transparent.

I want transparent tile like this. It's fully transparent.

transparent png tile example

open with photoshop

How can I get transparent png tiles (TMS) ?

  • Hi, what does TMS means ? You may also check out gis.stackexchange.com/q/127928/19460 , which deals with transparencies and "may" give some hints. – Hugolpz Aug 2 at 15:26
  • Thanks, Hugolpz. TMS means Tile Map Service.(consist of 256x256 px tiles). I tried transparent tiles with QGIS. Adjusting transparecny of tiff file at layer attribution, and then use qmetatiles plugin. It worked. But transparency pre-adjusted tiff file can't create transparent tiles with gdal2tiles. I don't know why. sorry for bothering. – Wewebang Aug 5 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.