Skip to content

test_shape is broken since OTB 8.2

It looks like since OTB issue orfeotoolbox/otb#2288 (closed) has been fixed, this has broken the pyotb. (see discussion in !49 (merged) )

How to reproduce

Use OTB after orfeotoolbox/otb!932 (merged)

Code

import pyotb

img_pth = "/vsicurl/https://gitlab.orfeo-toolbox.org/orfeotoolbox/" \
          "otb/-/raw/develop/Data/Input/SP67_FR_subset_1.tif?inline=false"
bm = pyotb.BandMath({"il": [img_pth], "exp": "im1b1"})
bm.write("/tmp/toto.tif")  # Comment this line --> Works
print(bm.shape)

Output

itk::ERROR: BandMath(0x12d7870): Call Execute() or ExecuteAndWriteOutput() before trying to reach output image information

Note

It works perfectly with otbApplication The bug comes from OTB. See orfeotoolbox/otb#2322 (closed)

Edited by Rémi Cresson