Skip to content

Commit aa7c63c

Browse files
_job_splitting: raise error for antimeridian crossing bounding box #883
1 parent 77cf317 commit aa7c63c

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

openeo/extra/job_management/_job_splitting.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ def _parse_input_geometry(
6060
"""
6161
if isinstance(geometry, dict):
6262
bbox = BBoxDict.from_dict(geometry)
63+
if bbox["west"] >= bbox["east"] or bbox["south"] >= bbox["north"]:
64+
raise JobSplittingFailure(
65+
"Invalid bounding box: west must be less than east and south must be less than north. "
66+
"Antimeridian-crossing bounding boxes are not supported."
67+
)
6368
raw_crs = bbox.get("crs")
6469
source_epsg = normalize_crs(raw_crs) if raw_crs is not None else None
6570
return bbox.as_polygon(), source_epsg

tests/extra/job_management/test_job_splitting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,9 @@ def test_invalid_aoi_type_raises(self):
309309
"""split_area rejects AOI types that are not dict, Polygon, or MultiPolygon."""
310310
with pytest.raises(JobSplittingFailure, match="Expected a bounding-box dict"):
311311
split_area("not_a_geometry", projection="EPSG:4326", tile_size=1.0)
312+
313+
def test_antimeridian_crossing_bbox_raises(self):
314+
"""A bounding box where west >= east (antimeridian crossing) is rejected."""
315+
aoi = {"west": 170.0, "south": -10.0, "east": -170.0, "north": 10.0, "crs": "EPSG:4326"}
316+
with pytest.raises(JobSplittingFailure, match="Antimeridian-crossing bounding boxes are not supported"):
317+
split_area(aoi, projection="EPSG:4326", tile_size=1.0)

0 commit comments

Comments
 (0)