Skip to content

Commit

Permalink
refactor(Cli): reduce impact of "web-optimized" parameter
Browse files Browse the repository at this point in the history
Try to prepare for removal of `web_optimized` argument from Python API
  • Loading branch information
alexismanin committed Jan 25, 2024
1 parent 02aea1c commit ccc3f31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rio_cogeo/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import json
import os
import typing
from typing import Optional

import click
import morecantile
import numpy
from morecantile import TileMatrixSet
from rasterio.rio import options
Expand Down Expand Up @@ -269,10 +271,12 @@ def create(
}
)

tilematrixset: Optional[TileMatrixSet]
if tms:
with open(tms, "r") as f:
tilematrixset = TileMatrixSet(**json.load(f))

elif web_optimized:
tilematrixset = morecantile.tms.get("WebMercatorQuad")
else:
tilematrixset = None

Expand All @@ -286,7 +290,6 @@ def create(
add_mask=add_mask,
overview_level=overview_level,
overview_resampling=overview_resampling,
web_optimized=web_optimized,
zoom_level_strategy=zoom_level_strategy,
zoom_level=zoom_level,
aligned_levels=aligned_levels,
Expand Down

0 comments on commit ccc3f31

Please sign in to comment.