Skip to content

Commit 3616d2d

Browse files
committed
remove xmin < xmax check
1 parent 4838301 commit 3616d2d

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

Diff for: stac_pydantic/api/search.py

-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ def validate_bbox(cls, v: BBox) -> BBox:
8383
if xmin < -180 or ymin < -90 or xmax > 180 or ymax > 90:
8484
raise ValueError("Bounding box must be within (-180, -90, 180, 90)")
8585

86-
if xmax < xmin:
87-
# xmin > xmax is permitted when crossing the antimeridian
88-
# https://datatracker.ietf.org/doc/html/rfc7946#section-5.2
89-
if not ((xmax < 0) and (xmin > 0)):
90-
raise ValueError(
91-
"Maximum longitude must be greater than minimum longitude"
92-
)
93-
9486
if ymax < ymin:
9587
raise ValueError(
9688
"Maximum longitude must be greater than minimum longitude"

Diff for: tests/api/test_search.py

-16
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def test_search_geometry_bbox():
134134
"bbox",
135135
[
136136
(100.0, 1.0, 105.0, 0.0), # ymin greater than ymax
137-
(100.0, 0.0, 95.0, 1.0), # xmin greater than xmax
138137
(100.0, 0.0, 5.0, 105.0, 1.0, 4.0), # min elev greater than max elev
139138
(-200.0, 0.0, 105.0, 1.0), # xmin is invalid WGS84
140139
(100.0, -100, 105.0, 1.0), # ymin is invalid WGS84
@@ -151,20 +150,5 @@ def test_search_invalid_bbox(bbox):
151150
Search(collections=["foo"], bbox=bbox)
152151

153152

154-
@pytest.mark.parametrize(
155-
"bbox",
156-
[
157-
(
158-
100.0,
159-
0.0,
160-
-95.0,
161-
1.0,
162-
), # xmin greater than xmax allowed when xmin > 0 and xmax < 0
163-
],
164-
)
165-
def test_search_valid_bbox(bbox):
166-
Search(collections=["foo"], bbox=bbox)
167-
168-
169153
def test_search_none_datetime() -> None:
170154
Search(datetime=None)

0 commit comments

Comments
 (0)