I am novice in using QGIS and other GIS software and am trying to create mosaics of NOAA raster nautical charts. Using pulldown menus, I entered raster>misc>merge and chose two NOAA charts and then specified a output file. The resulting command is shown below.

When I submit the command I then get the following error. Doing a web search, I found someone describing a similar problem with the solution being to specify the output file as GTiff. When I specified the name testmosaic.GTiff, the command actually appeared as testmosaic.GTiff.tif.

Two questions:

  1. If saving the file as GTiff is the solution to my original error, how do I specify that format? I don't see how I can specify that in the menu screen.
  2. Is there some better way to get the results I want and avoid the error


gdal_merge.bat -co COMPRESS=PACKBITS -of GMT -o "C:/Users/hamp/Documents/BC & AK/NOAA RNC ALaska/large area charts/testmosaic.tif" "C:\\Users\\hamp\\Documents\\BC & AK\\NOAA RNC ALaska\\large area charts\\Grouped Files\\17400_1.KAP" "C:\\Users\\hamp\\Documents\\BC & AK\\NOAA RNC ALaska\\large area charts\\Grouped Files\\17420_1.KAP"


 Format driver GMT does not support creation and piecewise writing.
 Please select a format that does, such as GTiff (the default) or HFA (Erdas Imagine).
  • is this on QGIS 2 or 3? – ndawson May 25 '18 at 0:11
  • The unwanted -of GMT has been a bug in QGIS 2 for some time now. Hopefully this is fixed in QGIS 3. – AndreJ May 26 '18 at 8:55

Changeing the file ending does not work in this case (also, .GTiff doesn´t exist, .tif is what it's supposed to be), you will need to change the output type via options.

You can either

  • choose the output file type in the Merge... window when selecting the output file name

  • or alter the command itself using the editor button next to it; the -of GMT is the key here (-of is the flag for 'output file type'), replace that with -of GTiff.

(On QGIS 2.18. I noticed that with some tools, the file type flags were not set correctly when using the GUI, thus altering the command would be the safest option)

Leave the rest and see if that works.

  • mean little off-topic note: the more you work with tools like these, the more you will regret having spaces and special characters in your file system names...,) – geozelot May 24 '18 at 23:35
  • Thanks. Your suggestion helped greatly. However, the merged raster was gray-scale which differed from the components that were in color. I saw an earlier question an answer regarding this matter and was able to "solve" the problem -- but is a time consuming solution. Using QGIS I used rastor>conversion>PCT to RCB... to convert the color scheme. After doing this for each input raster, I then did the step as you suggested and got the desired result. – Hamp May 25 '18 at 2:20
  • Followup: I then tried doing the color-conversion step batch, within the conversion step selecting the subdirectory containinng nothing but the input rasters having .kap suffixes. However, when I submitted the command I got the error "no input file to process". – Hamp May 25 '18 at 2:26
  • Sorry that this is broken up. Is there some way of doing a large number off color conversions in a more straighforward manner? Thanks – Hamp May 25 '18 at 2:27
  • Perhaps by using gdal_merge.py or gdavrtmerge directly. There is something about BSB palettes in gdal.org/frmt_various.html#BSB. That is your source format, isn't it? – user30184 May 25 '18 at 6:29

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.