Skip to content

Commit

Permalink
fix cogeotiff#288 overviews should be NONE when overview_level=0
Browse files Browse the repository at this point in the history
  • Loading branch information
lagamura committed Jun 1, 2024
1 parent c9ffcae commit ec86157
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rio_cogeo/cogeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ def cog_translate( # noqa: C901
tags.update(
{
"TILING_SCHEME_NAME": tms.id or "CUSTOM",
"TILING_SCHEME_ZOOM_LEVEL": zoom_level
if zoom_level is not None
else default_zoom,
"TILING_SCHEME_ZOOM_LEVEL": (
zoom_level if zoom_level is not None else default_zoom
),
}
)
if aligned_levels:
Expand Down Expand Up @@ -422,7 +422,8 @@ def cog_translate( # noqa: C901
warnings.warn(
"With GDAL COG driver, mask band will be translated to an alpha band."
)

if overview_level == 0:
dst_kwargs["overviews"] = "NONE"
dst_kwargs["overview_resampling"] = overview_resampling
dst_kwargs["warp_resampling"] = resampling
dst_kwargs["blocksize"] = tilesize
Expand Down Expand Up @@ -749,9 +750,9 @@ def cog_info(
Height=src_dst.height,
Tiled=(src_dst.block_shapes[0][1] != src_dst.width),
Dtype=src_dst.dtypes[0],
Interleave=src_dst.interleaving.value
if src_dst.interleaving
else "UNKNOWN",
Interleave=(
src_dst.interleaving.value if src_dst.interleaving else "UNKNOWN"
),
AlphaBand=utils.has_alpha_band(src_dst),
InternalMask=utils.has_mask_band(src_dst),
Nodata=src_dst.nodata,
Expand Down

0 comments on commit ec86157

Please sign in to comment.