Skip to content

Commit

Permalink
Merge pull request #191 from opendatacube/fix_boundary_scalar
Browse files Browse the repository at this point in the history
Ensure correct roi precision with numpy 2
  • Loading branch information
Ariana-B authored Dec 4, 2024
2 parents 210ae22 + 5da3ea1 commit 796a99c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions odc/geo/roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ def roi_boundary(roi: NormalizedROI, pts_per_side: int = 2) -> np.ndarray:
roi needs to be in the normalised form, i.e. no open-ended start/stop,
:returns:
``Nx2 <float32>`` array of ``X,Y`` points on the perimeter of the envelope defined by ``roi``
``Nx2 <float64>`` array of ``X,Y`` points on the perimeter of the envelope defined by ``roi``
.. seealso:: :py:func:`~odc.geo.roi.roi_normalise`
"""
yy, xx = roi
xx = np.linspace(xx.start, xx.stop, pts_per_side, dtype="float32")
yy = np.linspace(yy.start, yy.stop, pts_per_side, dtype="float32")
xx = np.linspace(xx.start, xx.stop, pts_per_side, dtype="float64")
yy = np.linspace(yy.start, yy.stop, pts_per_side, dtype="float64")

return polygon_path(xx, yy, closed=False).T

Expand Down

0 comments on commit 796a99c

Please sign in to comment.