Forum

Author Topic: RuntimeError: Unsupported format: .tif when exporting RasterTransformValue  (Read 114 times)

ppant

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Trying to export the vegetation index band
from python script and ran into this issue  RuntimeError: Unsupported format: .tif

Code: [Select]

vegetation_image = 'D:/orthomosaic_rdvi.tif'
chunk.raster_transform.formula = ["(B10-B6)/sqrt(B10+B6)"]
chunk.raster_transform.calibrateRange()
chunk.raster_transform.enabled = True
chunk.exportRaster(vegetation_image, image_format= Metashape.ImageFormatTIFF, raster_transform=Metashape.RasterTransformValue,
                                save_alpha=False)


Thanks
« Last Edit: June 10, 2021, 07:05:18 PM by ppant »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Hello ppant,

I've just copied your code to the Console pane for the random multispectral project (had to perform chunk variable initialization, though), and it worked as expected without the reported error.

I have used 1.7.3 release version. Please check, if you observe the error on your side in the latest release version. I can also suggest to check, if the problem persists after Metashape re-start.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ppant

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Alexey,
Oho, I am using the metashape version 1.6.6 build 11715. Is that a bug there on 1.6.6 ? Not sure. As I am running several scripts with 1.6.6. it is not easy for me to update our system directly to 1.7.3. without knowing all things are working. Alexy is it possible to get the demo license. 
Thanks 
« Last Edit: June 11, 2021, 12:11:03 AM by ppant »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Hello ppant,

The same code worked fine in 1.6.6 version as well.

Do you observe the same behavior on any project or if the issue is specific to the certain project only? Do you observe the same problem after re-starting Metashape instance and using only the lines that you have provided for any multispectral project?
Best regards,
Alexey Pasumansky,
Agisoft LLC

ppant

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Alexy
I observed the problem in all data.  Basically, I only posted the section of code to export the band image. Before exporting the vegetation band image I am exporting the orthomosaic, laz file that is working fine.
But when I add this section of code to export the vegetation band it just gave me an error unsupported tif format. Not sure what is causing that

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Hello ppant,

The specified message "Unsupported format: .tif" could be related to export points or export tiled model operations only, so I suggest to check, that in those operations correct file extension is used. As it seems, that the error appears in another block of code.
Best regards,
Alexey Pasumansky,
Agisoft LLC