Forum

Author Topic: How to solve Export Raster file size exceeded  (Read 2974 times)

benton

  • Newbie
  • *
  • Posts: 29
    • View Profile
How to solve Export Raster file size exceeded
« on: February 10, 2020, 06:09:47 AM »
Hello,

Version 1.6.x

I have a script that worked in 1.5 but is throwing an error in 1.6

The working 1.5 script looked like this;

Code: [Select]
v_blockw = 10000
v_blockh = 10000

...

chunk.exportOrthomosaic(output_path +'/ORTHO_TILE/'+ project_name + "_Ortho_EPSG" + v_to_epsg + "_ver_" + version + ".tif", image_format=Metashape.ImageFormatTIFF, projection=v_projection, blockw=v_blockw, blockh=v_blockh)

and the 1.6 script;

Code: [Select]
v_blockw = 10000
v_blockh = 10000

...

chunk.exportRaster(output_path +'/ORTHO_TILE/'+ project_name + "_Ortho_EPSG" + v_to_epsg + "_ver_" + version + ".tif", image_format=Metashape.ImageFormatTIFF, projection=v_projection, block_width=v_blockw, block_height=v_blockh, source_data=Metashape.OrthomosaicData)

Throws the following error
Code: [Select]
ExportRaster: image_format = TIFF, path = h:\SILREC_201912\mtn0618-ii/ORTHO_TILE/mtn0618-ii_Ortho_EPSG28350_ver_i.tif, projection = GDA94 / MGA zone 50
generating 40857 x 40495 raster in 1 x 1 tiles
libtiff error: Maximum TIFF file size exceeded
Traceback (most recent call last):
  File "U:\SCRIPTS\METASHAPE\metashape_A6D_Camera_Feedback_1.6-ver2.py", line 224, in <module>
    chunk.exportRaster(output_path +'/ORTHO_TILE/'+ project_name + "_Ortho_EPSG" + v_to_epsg + "_ver_" + version + ".tif", image_format=Metashape.ImageFormatTIFF, projection=v_projection, block_width=v_blockw, block_height=v_blockh, source_data=Metashape.OrthomosaicData)
RuntimeError: TIFFWriteTile: unexpected error: d:\folder_name/OrhtoName_Ortho_EPSG28350_ver_i.tif

The error indicates that the tiff image is too big 40857 x 40495, but I assume I have directed the script to output 10000 x 10000 tiles.

Can anyone see what the error could be?

Regards
Ben

« Last Edit: February 10, 2020, 08:01:20 AM by benton »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14844
    • View Profile
Re: How to solve Export Raster file size exceeded
« Reply #1 on: February 10, 2020, 01:30:22 PM »
Hello Ben,

I think you should add split_in_blocks = True argument.
Best regards,
Alexey Pasumansky,
Agisoft LLC

benton

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: How to solve Export Raster file size exceeded
« Reply #2 on: February 11, 2020, 01:42:35 AM »
Thank You
Regards Ben