NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
492 stars 173 forks source link

dem_geoid fails with output files > 4GB #327

Closed adehecq closed 3 years ago

adehecq commented 3 years ago

Describe the bug When running dem_geoid and the output file is larger than 4 GB, the script raises the following warning: Warning: RasterIO trouble: 'XXX.tif, band 1: An error occured while writing a dirty block' and at the end, the following error is printed: Error: GdalIO: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option. (code = 1)

The output file size never exceeds 4 GB and the output file is corrupted. I've tried with the option --no-bigtiff, but it does not fix the issue.

To Reproduce

For example: dem_geoid --geoid EGM2008 --reverse-adjustment dem_GLODEM_HMA_30m_lcc.tif I can send a test DEM if needed, but any DEM > 4 GB should reproduce the same error.

Your Environment (please complete the following information):

Additional comment If fixing the bug, would it be also possible to add an option to choose the output DEM type (e.g. Int16). Currently it is limited to Float32 or 64.

oleg-alexandrov commented 3 years ago

I tried to put a fix for the 4GB issue, will see if it works for Amaury.

adehecq commented 3 years ago

It fixed my issue, thanks!