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

[sketch] Refactor low level reader functions to avoid using WarpedVRT #656

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ tests/fixtures/mask*
.vscode/settings.json

docs/src/api/*

dev_notebooks/*
12 changes: 2 additions & 10 deletions rio_tiler/io/rasterio.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def feature(
# Get BBOX of the polygon
bbox = featureBounds(shape)

vrt_options = kwargs.pop("vrt_options", {})
reproject_options = kwargs.pop("reproject_options", {})

img = self.part(
bbox,
Expand All @@ -556,7 +556,7 @@ def feature(
max_size=max_size,
width=width,
height=height,
vrt_options=vrt_options,
reproject_options=reproject_options,
buffer=buffer,
**kwargs,
)
Expand Down Expand Up @@ -705,7 +705,6 @@ def tile( # type: ignore
tilesize: int = 256,
indexes: Optional[Indexes] = None,
expression: Optional[str] = None,
force_binary_mask: bool = True,
resampling_method: RIOResampling = "nearest",
unscale: bool = False,
post_process: Optional[
Expand All @@ -721,7 +720,6 @@ def tile( # type: ignore
tilesize (int, optional): Output image size. Defaults to `256`.
indexes (int or sequence of int, optional): Band indexes.
expression (str, optional): rio-tiler expression (e.g. b1/b2+b3).
force_binary_mask (bool, optional): Cast returned mask to binary values (0 or 255). Defaults to `True`.
resampling_method (RIOResampling, optional): RasterIO resampling algorithm. Defaults to `nearest`.
unscale (bool, optional): Apply 'scales' and 'offsets' on output data value. Defaults to `False`.
post_process (callable, optional): Function to apply on output data and mask values.
Expand All @@ -744,7 +742,6 @@ def tile( # type: ignore
max_size=None,
indexes=indexes,
expression=expression,
force_binary_mask=force_binary_mask,
resampling_method=resampling_method,
unscale=unscale,
post_process=post_process,
Expand All @@ -758,7 +755,6 @@ def part( # type: ignore
max_size: Optional[int] = None,
height: Optional[int] = None,
width: Optional[int] = None,
force_binary_mask: bool = True,
resampling_method: RIOResampling = "nearest",
unscale: bool = False,
post_process: Optional[
Expand All @@ -774,7 +770,6 @@ def part( # type: ignore
max_size (int, optional): Limit the size of the longest dimension of the dataset read, respecting bounds X/Y aspect ratio.
height (int, optional): Output height of the array.
width (int, optional): Output width of the array.
force_binary_mask (bool, optional): Cast returned mask to binary values (0 or 255). Defaults to `True`.
resampling_method (RIOResampling, optional): RasterIO resampling algorithm. Defaults to `nearest`.
unscale (bool, optional): Apply 'scales' and 'offsets' on output data value. Defaults to `False`.
post_process (callable, optional): Function to apply on output data and mask values.
Expand All @@ -800,7 +795,6 @@ def part( # type: ignore
width=width,
height=height,
indexes=indexes,
force_binary_mask=force_binary_mask,
resampling_method=resampling_method,
unscale=unscale,
post_process=post_process,
Expand Down Expand Up @@ -864,7 +858,6 @@ def feature( # type: ignore
max_size: Optional[int] = None,
height: Optional[int] = None,
width: Optional[int] = None,
force_binary_mask: bool = True,
resampling_method: RIOResampling = "nearest",
unscale: bool = False,
post_process: Optional[
Expand All @@ -883,7 +876,6 @@ def feature( # type: ignore
max_size=max_size,
height=height,
width=width,
force_binary_mask=force_binary_mask,
resampling_method=resampling_method,
unscale=unscale,
post_process=post_process,
Expand Down
Loading
Loading