Skip to content

Commit

Permalink
Pass X and Y Scale factors through to rasterio.warp.project. (#1450)
Browse files Browse the repository at this point in the history
* Pass X and Y Scale factors through to rasterio.warp.project. Update whats_new

* Update PR number in whats_new.rst

* Remove unused import.

* Cleanup.

* Cleanup.

* Should probably just add it to the dictionary tbh.

* Respond to Kirill's comments.
  • Loading branch information
SpacemanPaul committed May 31, 2023
1 parent 032265a commit 691e689
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datacube/storage/_read.py
Expand Up @@ -129,6 +129,7 @@ def read_time_slice(rdr,

is_nn = is_resampling_nn(resampling)
scale = pick_read_scale(rr.scale, rdr)
scale_x, scale_y = [pick_read_scale(s) for s in rr.scale2]

paste_ok, _ = can_paste(rr, ttol=0.9 if is_nn else 0.01)

Expand Down Expand Up @@ -188,7 +189,8 @@ def norm_read_args(roi, shape, extra_dim_index):
src_nodata=rdr.nodata, dst_nodata=dst_nodata)
else:
rio_reproject(pix, dst, src_gbox, dst_gbox, resampling,
src_nodata=rdr.nodata, dst_nodata=dst_nodata)
src_nodata=rdr.nodata, dst_nodata=dst_nodata,
XSCALE=scale_x, YSCALE=scale_y)

return rr.roi_dst

Expand Down
3 changes: 3 additions & 0 deletions docs/about/whats_new.rst
Expand Up @@ -15,6 +15,9 @@ v1.8.next
- ``datacube dataset`` cli commands print error message if missing argument (:pull:`1437`)
- Add pre-commit hook to verify license headers (:pull:`1438`)
- Support open-ended date ranges in `datacube dataset search`, `dc.load`, and `dc.find_datasets` (:pull:`1439`, :pull:`1443`)
- Pass Y and Y Scale factors through to rasterio.warp.reproject, to eliminate projection bug affecting
non-square Areas Of Interest (See `Issue #1448`_) (:pull:`1450`)
.. _`Issue #1448`: https://github.com/opendatacube/datacube-core/issues/1448


v1.8.12 (7th March 2023)
Expand Down

0 comments on commit 691e689

Please sign in to comment.