2

I found Hugolpz's tutorial for creating a GeoTIFF that contains grayscale with an alpha band.

Creating transparent hillshade?

# filter the color band, keep greyness of relevant shadows below limit
gdal_calc.py -A ./hillshade.tmp.tif  --outfile=./color_crop.tmp.tif \
    --calc="255*(A>220) +      A*(A<=220)"
# filter the opacity band, keep opacity of relevant shadows below limit
gdal_calc.py -A ./hillshade.tmp.tif  --outfile=./opacity_crop.tmp.tif \
    --calc="  1*(A>220) +(256-A)*(A<=220)"
# gdalbuildvrt -separate ./final.vrt ./color_crop.tmp.tif ./opacity_crop.tmp.tif
# gdal_translate -co COMPRESS=LZW -co ALPHA=YES ./final.vrt ./final_crop.tif

I wonder if it's posible to have also the .OVR that contains each zoom level's alpha band? I have tried this

gdaladdo -r bilinear -ro -b 1,2 --config COMPRESS_OVERVIEW DEFLATE --config PREDICTOR_OVERVIEW 2 --config ZLEVEL 9 GrayWithAlpha.tif 2 4 8 16 32 64

I found out that if the command lacks of -b 1,2, it doesn't work at all. Then the result still doesn't match the smoothness of QGIS raster layer oversampling feature. Despite beauty of oversampling, it's very very slow.

So I wonder if I can create .OVR that is as smooth as what presented by QGIS oversampling feature?

sandthorn
  • 201
  • 1
  • 6
  • Have a try with gdaladdo and tell if it works without issues or not. – user30184 Aug 25 '18 at 17:07
  • @user30184 I tried but it seems not very smooth. I'd like to have smoothness that QGIS layer setting "oversampling" offers. – sandthorn Aug 25 '18 at 18:54
  • Can you show screenshots for demonstrating the issue? – user30184 Aug 25 '18 at 19:43
  • @Luke Also changed the subject to express more into the subject. – sandthorn Aug 26 '18 at 09:01
  • have you tried -r cubic or -r cubicspline instead of -r linear ? It should have smoother outputs. But maybe you should do a resampling at a finer resolution (gdalwarp) if you expect something smooth when you zoom in – radouxju Sep 05 '18 at 12:50
  • @radouxju Yes, I have had tried also cubicspline, the result is still not compared to layer resampling rendering mode. I mind only when zooming out that is why I thought .ORV might help. I guess .OVR helps *only* in the aspect of *storage speed*, so you need less and less bytes to access at more and more zoom-out scale. With less information, when you need another rendering layer to beautify that information, there should become the inevitability of turning on of layer resampling. It's just sad but true. – sandthorn Sep 06 '18 at 06:57

0 Answers0