Skip to content

Commit

Permalink
Update xpublish_edr/geometry/area.py
Browse files Browse the repository at this point in the history
Co-authored-by: Deepak Cherian <[email protected]>
  • Loading branch information
mpiannucci and dcherian authored Nov 15, 2024
1 parent 526472b commit 76df163
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xpublish_edr/geometry/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ def _select_area_regular_xy_grid(
"""
# To minimize performance impact, we first subset the dataset to the bounding box of the polygon
(minx, miny, maxx, maxy) = polygon.bounds
if ds.cf.indexes["X"].is_monotonic_increasing:
indexes = ds.cf.indexes
if indexes["X"].is_monotonic_increasing:
x_sel = slice(minx, maxx)
else:
x_sel = slice(maxx, minx)
if ds.cf.indexes["Y"].is_monotonic_increasing:
if indexes["Y"].is_monotonic_increasing:
y_sel = slice(miny, maxy)
else:
y_sel = slice(maxy, miny)
Expand Down

0 comments on commit 76df163

Please sign in to comment.