Skip to content

Commit 53711ec

Browse files
Allow intersects search to use GeometryCollection (#548)
* Include GeometryCollection as a valid input type ; queries can now be made with a GeometryCollection type to the 'intersects' query without raising a 400 error; has not been tested to show that the intersection is correct * Fix format problems to satisfy black * Add tests * Whoops, formatting * Update changelog * update changelog --------- Co-authored-by: vincentsarago <[email protected]>
1 parent 6e74b21 commit 53711ec

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Improve bbox and datetime typing ([#490](https://github.com/stac-utils/stac-fastapi/pull/490)
1313
* Add `items` link to inferred link relations ([#634](https://github.com/stac-utils/stac-fastapi/issues/634))
1414
* Make sure FastAPI uses Pydantic validation and serialization by not wrapping endpoint output with a Response object ([#650](https://github.com/stac-utils/stac-fastapi/pull/650))
15+
* Allow `GeometryCollections` for `intersects` parameter in POST search queries ([#548](https://github.com/stac-utils/stac-fastapi/pull/548))
1516

1617
### Removed
1718

stac_fastapi/types/stac_fastapi/types/search.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import attr
1414
from geojson_pydantic.geometries import (
15+
GeometryCollection,
1516
LineString,
1617
MultiLineString,
1718
MultiPoint,
@@ -127,7 +128,15 @@ class BaseSearchPostRequest(BaseModel):
127128
ids: Optional[List[str]]
128129
bbox: Optional[BBox]
129130
intersects: Optional[
130-
Union[Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon]
131+
Union[
132+
Point,
133+
MultiPoint,
134+
LineString,
135+
MultiLineString,
136+
Polygon,
137+
MultiPolygon,
138+
GeometryCollection,
139+
]
131140
]
132141
datetime: Optional[DateTimeType]
133142
limit: Optional[Limit] = Field(default=10)

0 commit comments

Comments
 (0)