Skip to content

Commit 6ad7f38

Browse files
allow 3d bboxes (#809)
1 parent e667b4c commit 6ad7f38

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGES.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## [Unreleased]
44

5+
## [5.1.1] - 2025-03-17
6+
7+
### Fixed
8+
9+
- allow bbox with 6 coordinates (3D) in `GET` requests
10+
511
## [5.1.0] - 2025-03-07
612

713
### Added
@@ -597,7 +603,8 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha
597603

598604
* First PyPi release!
599605

600-
[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.0..main>
606+
[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.1..main>
607+
[5.1.1]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.0..5.1.1>
601608
[5.1.0]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.3..5.1.0>
602609
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.2..5.0.3>
603610
[5.0.2]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.1..5.0.2>

stac_fastapi/api/tests/test_models.py

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def test_create_get_request_model():
4040
assert d.microsecond == 10
4141
assert not model.end_date
4242

43+
model = request_model(bbox="0,0,0,1,1,1")
44+
assert model.bbox == (0.0, 0.0, 0.0, 1.0, 1.0, 1.0)
45+
46+
with pytest.raises(AssertionError):
47+
request_model(bbox="0,0,0,1,1")
48+
4349
model = request_model(
4450
datetime="2020-01-01T00:00:00.00001Z/2020-01-02T00:00:00.00001Z",
4551
)

stac_fastapi/types/stac_fastapi/types/search.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def str2bbox(x: str) -> Optional[BBox]:
3535
"""Convert string to BBox based on , delimiter."""
3636
if x:
3737
t = tuple(float(v) for v in str2list(x))
38-
assert len(t) == 4, f"BBox '{x}' must have 4 values."
38+
assert len(t) in [4, 6], f"BBox '{x}' must have 4 or 6 values."
3939
return t
4040

4141
return None

0 commit comments

Comments
 (0)