Error in extended filename documentation?


it says:
the following syntax should be used:

is the “&” really required? For selecting bands, I can do either:
$ otbcli_Convert -in "/media/alobo/FREECOM HDD/Iomega_HDD/OTBetal/OTBExamples/QB_1_ortho.tif?&bands=1:2" -out /tmp/example2.tif
$ otbcli_Convert -in "/media/alobo/FREECOM HDD/Iomega_HDD/OTBetal/OTBExamples/QB_1_ortho.tif?bands=1:2" -out /tmp/example2.tif

In some cases, using “&” results in error:

        $ 2019-07-03 09:07:20 (INFO): Default RAM limit for OTB is 128 MB
        2019-07-03 09:07:20 (INFO): GDAL maximum cache size is 798 MB
        2019-07-03 09:07:20 (INFO): OTB will use at most 8 threads
        2019-07-03 09:07:20 (INFO): No kwl metadata found in file /media/alobo/DecepNTFS2/Decepcion/LaminasTacos/Hyperimages/TACLP/FX10FX17/imaFX17b_modifiedv2.tif
        2019-07-03 09:07:20 (INFO): No kwl metadata found in file test.tif
        2019-07-03 09:07:20 (FATAL): itk::ERROR: GridBasedImageResampling(0x1ce2b90): Number of components of the grid is not 2, this is probably not an image of 2D resampling grid.

$ otbcli_GridBasedImageResampling ./FX10FX17/imaFX17b_modifiedv2.tif -io.out .FX10FX17/imaFX17b_modifiedv2FR2.tif -out.sizex 1024 -out.sizey 1160 -grid.type def -interpolator bco -interpolator.bco.radius 2 test.tif?bands=1:2


No there is no mistake in the documentation. You can put a & or not before the first argument it should not change a thing in your processing. But… In the first example you gave you put quote around the input filename, not in the second… If you do not put quote the “&” might be interpreted by the shell you are using, leading to not taking your option into account (leading in your example to an image with more than two bands…).
Can you confirm this error? Maybe with a simpler application like ReadImageInfo.

I see my 3rd example is missing the actual line with the command that was been run.
To put it more simple:

$ otbcli_Convert -in "QB_1_ortho.tif?bands=1:2" -out example2.tif works

$ otbcli_Convert -in "QB_1_ortho.tif?&bands=1:2" -out example2.tif works

$ otbcli_Convert -in QB_1_ortho.tif?bands=1:2 -out example2.tif  works

$ otbcli_Convert -in QB_1_ortho.tif?&bands=1:2 -out example2.tif does not work

[1] 8800
bash: -out: command not found
alobo@Delia:/media/alobo/LaCieNTFS2T/OTBtests$ 2019-07-08 11:12:00 (INFO): No kwl metadata found in file QB_1_ortho.tif
ERROR: Missing mandatory parameter -out.

Maybe there is no mistake in the documentation, but it is certainly insufficient.


Which documentation are you using for extended filename ? The Cookbook ? Because I think the documentation is clear there, the examples (at the end) use the quotes and there is a sentence in bold saying:

Note that you’ll probably need to “quote” the filename, especially if calling applications from the bash command line.

The page is appears clear to me but I have an “advanced user” point of view, and extended filenames can appear tricky to new users. I don’t know what we could add to the doc (I don’t see the point of documenting the fact that the first $ can be skipped), but any suggestions are welcome !


At least in my case the confusion came from inconsistencies. In the general instruction we have:

Then, in the particular options, there is no “?” :

Reader options


Then the “?” appears again in the examples. And, in real life, you can omit the “&” and the command actually
works even without the quotes. But if you follow the first instruction and use “?&” then you need quotes.

Well, I think is hell of confusing.