Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for BIGTIFF/other custom GDAL options #2

Closed
brownag opened this issue Jul 16, 2022 · 3 comments
Closed

Support for BIGTIFF/other custom GDAL options #2

brownag opened this issue Jul 16, 2022 · 3 comments

Comments

@brownag
Copy link

brownag commented Jul 16, 2022

Thanks for the excellent package! I've been putting it to good use lately.

I noticed that if a download results in a combined GeoTIFF >4GB (after 'deflate' compression), writing to the file with rasterio will result in this GDAL error:

ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.

From reading https://gdal.org/drivers/raster/gtiff.html#creation-options, I see GDAL defaults to BIGTIFF=IF_NEEDED, which incidentally never results in BIGTIFF format file when a compression method is being used.

Since geedim specifies "deflate" compression and other GDAL dataset write options, but not BIGTIFF, lengthy downloads will fail part way through if/when the file reaches ~4GB. I think there probably would be little risk to just setting BIGTIFF='YES' in profile from _prepare_for_download() but perhaps IF_SAFER would be better. It is my understanding that some non-GDAL software still does not support libtiff > 4 / BIGTIFF.

More generally, if the user could decide which (if any) compression method they want to use, or have access to set/modify other GDAL options, then setting BIGTIFF for some data sets/extents would be up to the user

@dugalh
Copy link
Collaborator

dugalh commented Jul 17, 2022

Hi, thank you for raising this, and for the detective work. I'll address the BIGTIFF issue in the next release. geedim knows the raw size of the raster, so can set BIGTIFF='YES' when it is > 4GB. I think that is probably safest.

I would like to keep the API/CLI as simple as possible. Is there a specific need for user access to the compression type / other GDAL options?

@brownag
Copy link
Author

brownag commented Jul 17, 2022

Great thanks!

Is there a specific need for user access to the compression type / other GDAL options?

No, not at this time for me. And deflate works fine for my purposes.

@dugalh
Copy link
Collaborator

dugalh commented Jul 19, 2022

Resolved with v1.3.0.

@dugalh dugalh closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants