Forum

Author Topic: How to export BigTIFF orthomosaic from v1.6 Python API?  (Read 5635 times)

dyoung

  • Newbie
  • *
  • Posts: 32
    • View Profile
How to export BigTIFF orthomosaic from v1.6 Python API?
« on: January 04, 2020, 05:48:09 PM »
Hello -- version 1.6 dropped exportOrthomosaic() and now uses exportRaster() with source_data=Metashape.OrthomosaicData. However, exportRaster() does not have a tiff_big parameter like exportOrthomosaic() did. How do I export a BigTIFF using this function? I have tried the following, but it does not work.

Metashape.ImageCompression.tiff_big = True
doc.chunk.exportRaster(path="path/to/file.tif", source_data=Metashape.OrthomosaicData)


I need to use a BigTIFF because with normal TIFF settings, I get: libtiff error: Maximum TIFF file size exceeded

Thank in advance for any help!
Derek

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: How to export BigTIFF orthomosaic from v1.6 Python API?
« Reply #1 on: January 04, 2020, 06:54:32 PM »
Hello Derek,

Please see the example below (for version 1.6.0):

Code: [Select]
compression = Metashape.ImageCompression()
compression.tiff_big = True
chunk.exportRaster(path = "path/to/file.tif", source_data=Metashape.OrthomosaicData, compression = compression)
Best regards,
Alexey Pasumansky,
Agisoft LLC

dyoung

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: How to export BigTIFF orthomosaic from v1.6 Python API?
« Reply #2 on: January 04, 2020, 08:06:23 PM »
Ah that makes sense! That worked with a slight modification of the last parameter:

image_compression = compression

Thanks!
« Last Edit: January 04, 2020, 08:08:39 PM by dyoung »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: How to export BigTIFF orthomosaic from v1.6 Python API?
« Reply #3 on: January 04, 2020, 08:15:29 PM »
Yes, it should be image_compression, sorry for the confusion.
Best regards,
Alexey Pasumansky,
Agisoft LLC

sven_a

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: How to export BigTIFF orthomosaic from v1.6 Python API?
« Reply #4 on: January 07, 2020, 06:52:31 PM »
Thank I had a similar question. Big tiff is now working.
How can I export data with TiffCompressionLZW?

Thanks! :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: How to export BigTIFF orthomosaic from v1.6 Python API?
« Reply #5 on: January 08, 2020, 02:39:48 PM »
Hello Sven,

You should use the corresponding parameter of ImageCompression class:
Code: [Select]
compression = Metashape.ImageCompression()
compression.tiff_compression = Metashape.ImageCompression.TiffCompressionLZW
chunk.exportRaster(path = "path/to/file.tif", source_data=Metashape.OrthomosaicData, image_compression = compression)
Best regards,
Alexey Pasumansky,
Agisoft LLC