Thanks to @abarciauskas-bgse for deep-diving into this issue.
When doing zonal statistics, users might not want to get the stats from resampled data but clip the data to the closest rounding window (full pixel) and then use the coverage option within the statistics method to adjust the values.
With this PR we're introduction an option in rio_tiler.reader.part to adjust the bounds to the dataset transform. This option might be used from feature() orpart()` reader's method such as
with Reader("cog.tif") as src:
data = src.feature(
shape,
shape_crs=WGS84_CRS,
align_bounds_with_dataset=True,
)
coverage_array = data.get_coverage_array(
shape,
shape_crs=WGS84_CRS,
)
stats = data.statistics(coverage=coverage_array)
Thanks to @abarciauskas-bgse for deep-diving into this issue.
When doing zonal statistics, users might not want to get the stats from resampled data but
clip
the data to the closest rounding window (full pixel) and then use thecoverage
option within the statistics method to adjust the values.With this PR we're introduction an option in
rio_tiler.reader.part
to adjust the bounds to the dataset transform. This option might be used fromfeature() or
part()` reader's method such as