0

I have three TIFFs are below which is belongs to Alaska HI Chart:

First https://drive.google.com/file/d/1KllacOdKNw866doqjMcounsvofpXBgFh/view?usp=sharing

Second https://drive.google.com/file/d/1_Oi8QwIONZ-CXzYRS0Ic-VQPTFAN4u42/view?usp=sharing

third https://drive.google.com/file/d/1BB_DCW59ecSvFESajWoXm5W6Xt0DRbmo/view?usp=sharing

Command:

gdalwarp -dstnodata 0.0 -r lanczos -of GTiff -dstalpha -overwrite --optfile test.txt "C:/Users/Nivesh.shastri/Documents/test3alaskahi/delete/merge.tif"

test.txt contains path of TIFF files. After completion of command, generated merge.tif is blank and same with QGIS.

Also getting warning like: band 5: Band 4 was already identified as alpha band, and band 5 is now marked as alpha too

My primary goal is to merge all TIFF into one TIFF then Translate it to MBTiles using -projwin parameter.

1 Answer 1

2

In gdalwarp -dstalphais used for adding an alpha band https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-dstalpha

-dstalpha

Create an output alpha band to identify nodata (unset/transparent) pixels.

Because your source images already have an alpha band there is no need for -dstalpha. This command runs without errors.

gdalwarp -dstnodata 0.0 -r lanczos -of GTiff test1_translate.tif test2_translate.tif test3_translate.tif merge.tif
Creating output file that is 78105P x 29032L.
Using band 4 of destination image as alpha.
Processing test1_translate.tif [1/3] : 0Using band 4 of source image as alpha.
Using internal nodata values (e.g. 0) for image test1_translate.tif.
...10...20...30...40...50...60...70...80...90...100 - done.
Processing test2_translate.tif [2/3] : 0Using band 4 of source image as alpha.
Using internal nodata values (e.g. 0) for image test2_translate.tif.
...10...20...30...40...50...60...70...80...90...100 - done.
Processing test3_translate.tif [3/3] : 0Using band 4 of source image as alpha.
Using internal nodata values (e.g. 0) for image test3_translate.tif.
...10...20...30...40...50...60...70...80...90...100 - done.
14
  • First of all ty for your answer, as per your suggestion I have removed <-dstalpha>, TIFFs has been merge successfully. But while translating <gdal_translate -of MBTiles -projwin -207.4014861258131361 74.1710011162752068 -119.4373264976983933 41.4743045882241574 C:\Users\admin\Downloads\gdal\merge.tif C:\Users\admin\Downloads\gdal\transalte.mbtiles> it stuck at 0% and its been 4 hours but didn't completed yet any suggestions? imgur.com/a/fzF3eTS Aug 5 at 11:46
  • It took 20 minutes for me gdal_translate -of MBTiles -projwin -207.4014861258131361 74.1710011162752068 -119.4373264976983933 41.47430458822 merge.tif merge.mbtiles Input file size is 78105, 29032 0...10...20...30...40...50...60...70...80...90...100 - done. GDAL 3.5.0 on Windows with the binaries from gisinternals.com.
    – user30184
    Aug 5 at 13:43
  • I am getting warning like Invalid value for 'bounds' metadata. Ignoring it and fall back to present tile extent while execute command 'gdaladdo --config COMPRESS_OVERVIEW LZW -r nearest translate.mbtiles' for generated mbtiles using translate. Any suggestion for this? 2 days ago
  • It is just a warning and GDAL tries to use a reasonable fall back . Do you have problems with the result?
    – user30184
    2 days ago
  • yes MBTiles not showing on map, I am using mousebird-consulting-inc.github.io/WhirlyGlobe in IPad. Let me try once again whole process 2 days ago

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.