Skip to content

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

Open
@adehecq

Description

@adehecq

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'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions