3

I am attempting to include GDAL's merge but having difficulty with the "Additional creation options" field. I would like to include both COMPRESS=LZW and TILED=YES however I cannot seem to find the formatting that satisfies. I have tried things like:

  • COMPRESS=LZW TILED=YES
  • COMPRESS=LZW, TILED=YES
  • 'COMPRESS'=LZW, 'TILED'=YES
  • {'COMPRESS':LZW, 'TILED':YES}

and I receive the following sort of errors:

Warning 6 Warning 6: 'LZW, TILED=YES' is an unexpected value for COMPRESS creation option of type string-select.
Warning 5: COMPRESS=LZW, TILED=YES value not recognised, ignoring.

It seems to be parsing my inputs in the strangest ways. Admittedly, I have not kept an exhaustive list of my various inputs.

drop down arrow at the end of field

This drop down arrow appears to do nothing, as well.

In the GUI to run the algorithm the feature is well structured, as is the command line, but in this case I must bring merge into a model and cannot find the appropriate directions.

I have looked here and decided to try the dictionary format. This made it seem like a simple string would work, so I added the comma separator. This documentation made it seem as though no comma should be necessary (see fig 9.15). The GDAL.org entry did not really clear things up with -co <NAME=VALUE> not really revealing how to include more than one (again, through the model specifically, the command line format is known).

It seems as though "Additional creation options" is only meant to take a single option, and should not be pluralized. More likely, I just don't know how to formulate it. Please help.

4
  • 2
    Can you try typing in the "Additional command-line parameters [optional]": -co COMPRESS=LZW -co TILED=YES. Remove the stuff in your "Additional creation options [optional]".
    – Binx
    Mar 21, 2022 at 22:34
  • 1
    Please include errors (or warnings in this case) as formatted text in your question, rather than pictures. It makes it much easier to debug and will also help others find your question when searching for the error message.
    – Matt
    Mar 21, 2022 at 23:37
  • 1
    @Zman3 this works, as we would expect. Should I (or you) just put this as the answer to the question and basically leave this as a model builder issue? Perhaps the input field being different from the others is the sign that there's just a small bug somewhere?
    – Pictory
    Mar 22, 2022 at 12:28
  • 1
    @Matt done, thank you!
    – Pictory
    Mar 22, 2022 at 12:29

1 Answer 1

1

There are two different ways you can reach your desired output.

The first (specifically asked by the OP), is to use the additional creation options. The correct syntax is to separate the entries with the pipe "|" character (shift + \). Please reference this post.

COMPRESS=LZW|TILED=YES

The second, using the additional command-line parameters. I have seen this section used most since it ties into how users would enter the parameters into a shell or python script.

-co COMPRESS=LZW -co TILED=YES

Note: Some options will require the -co, while others require a different prefix and others non at all. Check out the gdal documentation.

enter image description here

7
  • 1
    This solves the task for the user but does not explain what format to use in the "Additional creation options" field :( Mar 26, 2022 at 21:29
  • 2
    Your answer is great! But OP asked for the dialog field one row higher, the "Additional creation options". It's fine if they are satisfied with modifying the "Additional command-line parameters" but if you know how to specify multiple options in that, it would be fantastic if you could also add it. Mar 28, 2022 at 10:13
  • 2
    @bugmenot123, I apologize; I am unaware how to correctly format the "additional creations options". I do not have the option to enter in 'text' in that field. It only displays as a drop down menu. Here is one post I found, but I am unable to test it since I only have a drop down menu. Might have a different QGIS version...?
    – Binx
    Mar 28, 2022 at 16:16
  • 1
    @Binks That post does in fact lead to the correct answer. The field within the model builder setup "Additional creation options" will accept multiple parameters by using the pipe "|" character. "COMPRESS=LZW,|TILED=YES" (no quotes) produces this output: "gdal_merge.bat -n 0.0 -ot Int16 -of GTiff -co COMPRESS=LZW -co TILED=YES"
    – Pictory
    Mar 30, 2022 at 17:00
  • 1
    @Binks Shoot, that comma is a typo, but I cannot edit my comment.
    – Pictory
    Mar 30, 2022 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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