Skip to content

Commit 77c8673

Browse files
committed
Revert "Fix for when x and y are not the first 2 dimensions. Assert x,y order. #690"
This reverts commit e3c93fa.
1 parent e3c93fa commit 77c8673

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

openeo/metadata.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,7 @@ def temporal_dimension(self) -> TemporalDimension:
304304

305305
@property
306306
def spatial_dimensions(self) -> List[SpatialDimension]:
307-
lst = [d for d in self._dimensions if isinstance(d, SpatialDimension)]
308-
if lst:
309-
assert len(lst) == 2
310-
assert lst[0].name == "x"
311-
assert lst[1].name == "y"
312-
return lst
307+
return [d for d in self._dimensions if isinstance(d, SpatialDimension)]
313308

314309
def has_geometry_dimension(self):
315310
return any(isinstance(d, GeometryDimension) for d in self._dimensions)
@@ -447,13 +442,11 @@ def resample_spatial(
447442
raise MetadataException(f"Expected two spatial resolutions but found {spatial_indixes=}")
448443
for i in spatial_indixes:
449444
dim: SpatialDimension = dimensions[i]
450-
assert dim.name in ["x", "y"]
451-
resolution_i = 0 if dim.name == "x" else 1
452445
dimensions[i] = SpatialDimension(
453446
name=dim.name,
454447
extent=dim.extent,
455448
crs=projection or dim.crs,
456-
step=resolution[resolution_i] if resolution[resolution_i] else dim.step,
449+
step=resolution[i] if resolution[i] else dim.step,
457450
)
458451

459452
return self._clone_and_update(dimensions=dimensions)

openeo/utils/normalize.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ def normalize_resample_resolution(
55
resolution: Union[int, float, Tuple[float, float], Tuple[int, int]]
66
) -> Tuple[Union[int, float], Union[int, float]]:
77
"""Normalize a resolution value, as used in the `resample_spatial` process to a two-element tuple."""
8-
# This is a stricter version than clean_number_pair()
98
if isinstance(resolution, (int, float)):
109
return (resolution, resolution)
1110
elif (

0 commit comments

Comments
 (0)