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

Conflict between arguments co_opts and compress/tiled of Raster.save #651

Open
adehecq opened this issue Feb 12, 2025 · 0 comments
Open
Labels
invalid This doesn't seem right

Comments

@adehecq
Copy link
Member

adehecq commented Feb 12, 2025

In Raster.save, there are two options to handle compression and tiling of the output file, either through the arguments compress and tiled, or through co_opts.
Because the first ones have default values, if one tries to set them through co_opts, one gets a rasterio that is not so helpful.
I think we should detect this conflict beforehand and raise a warning instead.

Here is a MWE:

import geoutils as gu
img = gu.Raster(gu.examples.get_path("everest_landsat_b4"))
img.save("tmp.tif", co_opts={"tiled":"yes"})

-> raises a "TypeError: rasterio.open() got multiple values for keyword argument 'tiled'"

@adehecq adehecq added the invalid This doesn't seem right label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant