0

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


Command:

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"


Error:

 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).
underdark
  • 84,148
  • 21
  • 231
  • 413
Hamp
  • 71
  • 1
  • 7

1 Answers1

2

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.

geozelot
  • 30,050
  • 4
  • 32
  • 56
  • 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 02: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 02: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 02:27
  • Perhaps by using gdal_merge.py or gdavrtmerge directly. There is something about BSB palettes in http://www.gdal.org/frmt_various.html#BSB. That is your source format, isn't it? – user30184 May 25 '18 at 06:29
  • @Hamp I have not worked with .kap/BSB myself, so I can't really help. maybe what @user30184 said. I would probably go for a Virtual Rasters mosaic (see e.g. here), but not sure if that would work. if I get it right, the .kap/BSB format is not fully supported in GDAL yet (for licence reasons?). maybe worth writing another question concerning this if you can't get it to work. – geozelot May 25 '18 at 10:16