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 turning overview creation off in odc.geo.cog.save_cog_with_dask #152

Open
robbibt opened this issue May 16, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@robbibt
Copy link
Contributor

robbibt commented May 16, 2024

The odc.geo.cog.write_cog function supports deactivating overview creation via the overview_levels=[] param. It would be great to also have this available in the Dask-enabled odc.geo.cog.save_cog_with_dask function too to support use cases where we need to simply quickly write GeoTIFF files and don't want to waste time on overview generation.

@robbibt robbibt added the enhancement New feature or request label May 16, 2024
@Kirill888
Copy link
Member

notes for dev:

in this function:

def _make_empty_cog(
shape: Tuple[int, ...],
dtype: Any,
gbox: Optional[GeoBox] = None,
*,
nodata: MaybeNodata = None,
gdal_metadata: Optional[str] = None,
compression: Union[str, Unset] = Unset(),
compressionargs: Any = None,
predictor: Union[int, bool, Unset] = Unset(),
blocksize: Union[int, List[Union[int, Tuple[int, int]]]] = 2048,
bigtiff: bool = True,
**kw,
) -> Tuple[CogMeta, memoryview]:

need to force nlevels=0 here based on some extra option passed in here:

im_shape, _, nlevels = compute_cog_spec(im_shape, tsz)

the rest should just work after that.

called from

meta, hdr0 = _make_empty_cog(
xx.shape,
xx.dtype,
xx_odc.geobox,
predictor=predictor,
compression=compression,
compressionargs=compressionargs,
blocksize=blocksize,
bigtiff=bigtiff,
nodata=xx_odc.nodata,
gdal_metadata=gdal_metadata,
**kw,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants