You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Related Issue(s):**
- stac-utils#463
**Description:**
This PR introduces spatial search capabilities for collections and a new
CLI tool package for managing SFEOS deployments.
**Key Features:**
1. **Collection Spatial Search**
- Added `bbox` parameter support to `/collections` endpoint for
filtering collections by geographic extent
- Collections are automatically indexed with a `bbox_shape` field
(GeoJSON polygon) derived from their spatial extent
- Supports both 2D and 3D bounding boxes (altitude values are ignored
for spatial queries)
- Efficient geospatial queries using Elasticsearch/OpenSearch geo_shape
type
2. **SFEOS Tools CLI Package**
- New installable Python package
([sfeos_tools/](cci:7://file:///home/computer/Code/stac-fastapi-elasticsearch-opensearch/sfeos_tools:0:0-0:0))
for managing SFEOS deployments
- Initial command: `add-bbox-shape` - migrates legacy collections to
support spatial search
- Flexible connection options via CLI flags or environment variables
- Supports both Elasticsearch and OpenSearch backends
- Install with: `pip install sfeos-tools[elasticsearch]` or `pip install
sfeos-tools[opensearch]`
3. **Migration Support**
- Legacy collections (created before this feature) can be migrated using
the CLI tool or by updating the collection via the API and the
Transactions Extension
- Automatic `bbox_shape` generation for new/updated collections
- Backward compatible - existing collections remain searchable via other
parameters
**Usage Examples:**
```bash
# Search collections by bounding box
GET /collections?bbox=-10,35,40,70
# Migrate legacy collections
sfeos-tools add-bbox-shape --backend elasticsearch --no-ssl
```
**PR Checklist:**
- [x] Code is formatted and linted (run `pre-commit run --all-files`)
- [x] Tests pass (run `make test`)
- [x] Documentation has been updated to reflect changes, if applicable
- [x] Changes are added to the changelog
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
10
10
### Added
11
11
12
+
- Spatial search support for collections via `bbox` parameter on `/collections` endpoint. Collections are now indexed with a `bbox_shape` field (GeoJSON polygon) derived from their spatial extent for efficient geospatial queries when created or updated. [#481](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/481)
13
+
- Introduced SFEOS Tools (`sfeos_tools/`) - An installable Click-based CLI package for managing SFEOS deployments. Initial command `add-bbox-shape` adds the `bbox_shape` field to existing collections for spatial search compatibility. Install with `pip install sfeos-tools[elasticsearch]` or `pip install sfeos-tools[opensearch]`. [#481](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/481)
12
14
- CloudFerro logo to sponsors and supporters list [#485](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/485)
13
15
- Latest news section to README [#485](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/485)
14
16
15
17
### Changed
16
18
17
19
### Fixed
18
20
19
-
[v6.5.1] - 2025-09-30
21
+
## [v6.5.1] - 2025-09-30
20
22
21
23
### Fixed
22
24
23
25
- Issue where token, query param was not being passed to POST collections search logic [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)
24
26
- Issue where datetime param was not being passed from POST collections search logic to Elasticsearch [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)
25
27
- Collections search tests to ensure both GET /collections and GET/POST /collections-search endpoints are tested [#483](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/483)
- 10/04/2025: The [CloudFerro](https://cloudferro.com/) logo has been added to the sponsors and supporters list above. Their sponsorship of the ongoing collections search extension work has been invaluable. This is in addition to the many other important changes and updates their developers have added to the project.
35
+
-**10/12/2025:** Collections search **bbox** functionality added! The collections search extension now supports bbox queries. Collections will need to be updated via the API or with the new **[SFEOS-tools](#sfeos-tools-cli)** CLI package to support geospatial discoverability. Thanks again to **CloudFerro** for their sponsorship of this work!
36
+
-**10/04/2025:** The **[CloudFerro](https://cloudferro.com/)** logo has been added to the sponsors and supporters list above. Their sponsorship of the ongoing collections search extension work has been invaluable. This is in addition to the many other important changes and updates their developers have added to the project.
36
37
37
38
</div>
38
39
@@ -105,6 +106,7 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
105
106
-[Interacting with the API](#interacting-with-the-api)
106
107
-[Configure the API](#configure-the-api)
107
108
-[Collection Pagination](#collection-pagination)
109
+
-[SFEOS Tools CLI](#sfeos-tools-cli)
108
110
-[Ingesting Sample Data CLI Tool](#ingesting-sample-data-cli-tool)
@@ -160,9 +162,21 @@ These endpoints support advanced collection discovery features including:
160
162
- Collections are matched if their temporal extent overlaps with the provided datetime parameter
161
163
- This allows for efficient discovery of collections based on time periods
162
164
165
+
-**Spatial Filtering**: Filter collections by their spatial extent using the `bbox` parameter
166
+
- Example: `/collections?bbox=-10,35,40,70` (finds collections whose spatial extent intersects with this bounding box)
167
+
- Example: `/collections?bbox=-180,-90,180,90` (finds all collections with global coverage)
168
+
- Supports both 2D bounding boxes `[minx, miny, maxx, maxy]` and 3D bounding boxes `[minx, miny, minz, maxx, maxy, maxz]` (altitude values are ignored for spatial queries)
169
+
- Collections are matched if their spatial extent (stored in the `extent.spatial.bbox` field) intersects with the provided bbox parameter
170
+
-**Implementation Note**: When collections are created or updated, a `bbox_shape` field is automatically generated from the collection's spatial extent and indexed as a GeoJSON polygon for efficient geospatial queries
171
+
-**Migrating Legacy Collections**: Collections created before this feature was added will not be discoverable via bbox search until they have the `bbox_shape` field added. You can either:
172
+
- Update each collection via the API (PUT `/collections/{collection_id}` with the existing collection data)
173
+
- Run the migration tool (see [SFEOS Tools CLI](#sfeos-tools-cli) for installation and connection options):
These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
164
178
165
-
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
179
+
> **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, datetime filtering, and spatial filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
166
180
>
167
181
> **Configuration**: The custom `/collections-search` endpoint can be enabled by setting the `ENABLE_COLLECTIONS_SEARCH_ROUTE` environment variable to `true`. By default, this endpoint is **disabled**.
168
182
@@ -470,6 +484,64 @@ The system uses a precise naming convention:
0 commit comments