Skip to content

Commit

Permalink
cache raster properties for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkEilander committed Oct 8, 2023
1 parent 06d7fd2 commit 6fc1f28
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 191 deletions.
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ Clip
:template: autosummary/accessor_method.rst
:toctree: _generated

DataArray.raster.clip
DataArray.raster.clip_bbox
DataArray.raster.clip_mask
DataArray.raster.clip_geom
Expand Down
2 changes: 1 addition & 1 deletion hydromt/gis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def affine_to_coords(transform, shape, x_dim="x", y_dim="y"):
if not isinstance(transform, Affine):
transform = Affine(*transform)
height, width = shape
if transform.b == 0:
if transform.b == transform.d == 0:
x_coords, _ = transform * (np.arange(width) + 0.5, np.zeros(width) + 0.5)
_, y_coords = transform * (np.zeros(height) + 0.5, np.arange(height) + 0.5)
coords = {
Expand Down
Loading

0 comments on commit 6fc1f28

Please sign in to comment.