Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin

## [unreleased]

## [1.3.1] - 2026-02-26

* fix: bbox filter when collection's geometry is not in EPSG:4326 CRS

## [1.3.0] - 2025-11-17

* switch to official python docker image from `bitnami`
Expand Down Expand Up @@ -425,7 +429,8 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin

- Initial release

[unreleased]: https://github.com/developmentseed/tipg/compare/1.3.0...HEAD
[unreleased]: https://github.com/developmentseed/tipg/compare/1.3.1...HEAD
[1.3.1]: https://github.com/developmentseed/tipg/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/developmentseed/tipg/compare/1.2.1...1.3.0
[1.2.1]: https://github.com/developmentseed/tipg/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/developmentseed/tipg/compare/1.1.2...1.2.0
Expand Down
14 changes: 12 additions & 2 deletions tests/routes/test_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,20 @@ def test_items_geo_filter_cql2(app):
Items.model_validate(body)


def test_items_geo_filter_cql2_non_4326_crs(app):
def test_items_geo_filte_non_4326_crs(app):
"""Test CQL2 non 4326 geo filter."""
response = app.get(
"/collections/public.minnesota/items?filter-lang=cql2-text&filter=S_INTERSECTS(geom, POLYGON((-95.5389899 47.5578719,-95.5018943 46.4902864,-94.1637708 46.4891952,-94.1277889 47.5804373,-95.5389899 47.5578719)))"
"/collections/public.minnesota/items?filter-lang=cql2-text&filter=S_INTERSECTS(geom, POLYGON((-95.5389899 46.4902864, -94.1637708 46.4902864, -94.1637708 47.5804373, -95.5389899 47.5804373, -95.5389899 46.4902864)))"
)

assert response.status_code == 200
body = response.json()
assert len(body["features"]) == 2
assert body["numberMatched"] == 2
Items.model_validate(body)

response = app.get(
"/collections/public.minnesota/items?bbox=-95.5389899,46.4902864,-94.1637708,47.5804373"
)

assert response.status_code == 200
Expand Down
6 changes: 5 additions & 1 deletion tipg/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,12 @@ def _where( # noqa: C901
wheres.append(
logic.Func(
"ST_Intersects",
logic.S(bbox_to_wkt(bbox)),
logic.V(geometry_column.name),
logic.Func(
"ST_Transform",
logic.S(bbox_to_wkt(bbox)),
logic.Func("ST_SRID", logic.V(geometry_column.name)),
),
)
)

Expand Down
Loading