Skip to content

Commit

Permalink
refactor reader
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Nov 27, 2023
1 parent dc7e87d commit d1a0629
Show file tree
Hide file tree
Showing 8 changed files with 354 additions and 345 deletions.
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

0 comments on commit d1a0629

Please sign in to comment.