Skip to content

Commit 7696e58

Browse files
author
thomas loubrieu
committed
Merge branch 'main' into for_other_os_schema
2 parents 9268b46 + 4139cb4 commit 7696e58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2742
-201
lines changed

.github/workflows/cicd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ jobs:
6868

6969
strategy:
7070
matrix:
71-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
71+
python-version: [ "3.11", "3.12", "3.13", "3.14"]
7272
backend: [ "elasticsearch8", "opensearch"]
7373

7474
name: Python ${{ matrix.python-version }} testing with ${{ matrix.backend }}
7575

7676
steps:
7777
- name: Check out repository code
78-
uses: actions/checkout@v5
78+
uses: actions/checkout@v6
7979

8080
- name: Setup Python
8181
uses: actions/setup-python@v6

.github/workflows/deploy_mkdocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818

1919
steps:
2020
- name: Checkout main
21-
uses: actions/checkout@v5
21+
uses: actions/checkout@v6
2222

23-
- name: Set up Python 3.9
23+
- name: Set up Python 3.11
2424
uses: actions/setup-python@v6
2525
with:
26-
python-version: 3.9
26+
python-version: 3.11
2727

2828
- name: Install dependencies
2929
run: |

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515

16-
- name: Set up Python 3.10
16+
- name: Set up Python 3.11
1717
uses: actions/setup-python@v6
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.11"
2020

2121
- name: Install build dependencies
2222
run: |
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Checkout repository
83-
uses: actions/checkout@v5
83+
uses: actions/checkout@v6
8484

8585
- name: Set up QEMU
8686
uses: docker/setup-qemu-action@v3

CHANGELOG.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,69 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Added
1111

12+
- Added catalogs route support to enable federated hierarchical catalog browsing and navigation in the STAC API. [#547](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/547)
13+
1214
### Changed
1315

1416
### Fixed
1517

18+
- Fix unawaited coroutine in `stac_fastapi.core.core`. [#551](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/551)
19+
1620
### Removed
1721

1822
### Updated
1923

24+
## [v6.7.6] - 2025-12-04
25+
26+
### Fixed
27+
28+
- Fix incorrect min/max date formatting in `apply_datetime_filter` for `POST` requests. [#539](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/539)
29+
- Fixed datetime filtering for .0Z milliseconds to preserve precision in apply_filter_datetime, ensuring only items exactly within the specified range are returned. [#535](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/535)
30+
- Normalize datetime in POST /search requests to match GET /search behavior. [#543](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/543)
31+
- Fix optional Redis support in core.py. [#549](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/549)
32+
33+
## [v6.7.5] - 2025-11-25
34+
35+
### Added
36+
37+
- Added retry with back-off logic for Redis related functions. [#528](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/528)
38+
- Added nanosecond precision datetime filtering that ensures nanosecond precision support in filtering by datetime. This is configured via the `USE_DATETIME_NANOS` environment variable, while maintaining microseconds compatibility for datetime precision. [#529](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/529)
39+
40+
### Fixed
41+
42+
- Add Redis to be installed in dev environment for local testing [#536](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/536)
43+
- Fix Redis optional dependencies in opensearch and elasticsearch packages [#541](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/541)
44+
45+
### Updated
46+
47+
- Upgrade stac-fastapi parent libraries to v6.1.1 [#541](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/541)
48+
49+
### Removed
50+
51+
- Removed support for Python 3.9, 3.10 as they are no longer supported by stac-fastapi parent libraries [#541](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/541)
52+
53+
## [v6.7.4] - 2025-11-13
54+
55+
### Added
56+
57+
- Environment variable `EXCLUDED_FROM_ITEMS` to exclude specific fields from items endpoint response. Supports comma-separated list of fully qualified field names (e.g., `properties.auth:schemes,properties.storage:schemes`) [#518](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/518)
58+
59+
## [v6.7.3] - 2025-11-07
60+
61+
### Added
62+
63+
- Added validator for `REDIS_MAX_CONNECTIONS` to handle empty or null-like values ("", "null", None) and return None instead. [#519](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/519)
64+
65+
### Removed
66+
67+
- Removed `/collections-search` endpoint from default landing page. It now only shows when `ENABLE_COLLECTIONS_SEARCH_ROUTE` is set to `True`. [#524](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/524)
68+
69+
## [v6.7.2] - 2025-11-04
70+
71+
### Fixed
72+
73+
- Fixed "list index out of range" error when using BETWEEN operator in CQL2-text filters. [#521](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/521)
74+
2075
## [v6.7.1] - 2025-10-31
2176

2277
### Fixed
@@ -615,7 +670,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
615670
- Use genexp in execute_search and get_all_collections to return results.
616671
- Added db_to_stac serializer to item_collection method in core.py.
617672

618-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.1...main
673+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.6...main
674+
[v6.7.6]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.5...v6.7.6
675+
[v6.7.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.4...v6.7.5
676+
[v6.7.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.3...v6.7.4
677+
[v6.7.3]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.2...v6.7.3
678+
[v6.7.2]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.1...v6.7.2
619679
[v6.7.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.0...v6.7.1
620680
[v6.7.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.6.0...v6.7.0
621681
[v6.6.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.1...v6.6.0

README.md

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# stac-fastapi-elasticsearch-opensearch
2-
31
<!-- markdownlint-disable MD033 MD041 -->
42

53

@@ -30,6 +28,7 @@ The following organizations have contributed time and/or funding to support the
3028

3129
## Latest News
3230

31+
- **11/07/2025:** 🌍 The SFEOS STAC Viewer is now available at: https://healy-hyperspatial.github.io/sfeos-web. Use this site to examine your data and test your STAC API!
3332
- **10/24/2025:** Added `previous_token` pagination using Redis for efficient navigation. This feature allows users to navigate backwards through large result sets by storing pagination state in Redis. To use this feature, ensure Redis is configured (see [Redis for navigation](#redis-for-navigation)) and set `REDIS_ENABLE=true` in your environment.
3433
- **10/23/2025:** The `EXCLUDED_FROM_QUERYABLES` environment variable was added to exclude fields from the `queryables` endpoint. See [docs](#excluding-fields-from-queryables).
3534
- **10/15/2025:** 🚀 SFEOS Tools v0.1.0 Released! - The new `sfeos-tools` CLI is now available on [PyPI](https://pypi.org/project/sfeos-tools/)
@@ -93,7 +92,9 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
9392
- [Technologies](#technologies)
9493
- [Table of Contents](#table-of-contents)
9594
- [Collection Search Extensions](#collection-search-extensions)
95+
- [Catalogs Route](#catalogs-route)
9696
- [Documentation & Resources](#documentation--resources)
97+
- [SFEOS STAC Viewer](#sfeos-stac-viewer)
9798
- [Package Structure](#package-structure)
9899
- [Examples](#examples)
99100
- [Performance](#performance)
@@ -137,12 +138,39 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
137138
- [Gitter Chat](https://app.gitter.im/#/room/#stac-fastapi-elasticsearch_community:gitter.im) - For real-time discussions
138139
- [GitHub Discussions](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/discussions) - For longer-form questions and answers
139140

141+
## SFEOS STAC Viewer
142+
143+
The SFEOS STAC viewer is a web-based application for examining and testing STAC APIs. It provides an interactive interface to explore geospatial data catalogs, visualize spatial extents, and test API endpoints.
144+
145+
### Access
146+
147+
The viewer is available at: https://healy-hyperspatial.github.io/sfeos-web/
148+
149+
### Features
150+
151+
- Browse collections and items interactively
152+
- Interactive map visualization of spatial extents
153+
- Test API endpoints directly from the interface
154+
- Search and filter capabilities for exploring data
155+
156+
### Usage
157+
158+
Navigate to the URL above and connect to your SFEOS API instance by providing the base URL of your STAC API. This is done with the `API SERVER` button on the right side of the page.
159+
160+
You can also override the default STAC API URL by appending the `stacApiUrl` parameter to the application URL. For example:
161+
162+
https://healy-hyperspatial.github.io/sfeos-web?stacApiUrl=http://localhost:8080
163+
164+
**Note**: The parameter name `stacApiUrl` is case-sensitive. This allows you to connect to different STAC API servers without modifying the web app configuration.
165+
140166
## Collection Search Extensions
141167

142168
SFEOS provides enhanced collection search capabilities through two primary routes:
143169
- **GET/POST `/collections`**: The standard STAC endpoint with extended query parameters
144170
- **GET/POST `/collections-search`**: A custom endpoint that supports the same parameters, created to avoid conflicts with the STAC Transactions extension if enabled (which uses POST `/collections` for collection creation)
145171

172+
The `/collections-search` endpoint follows the [STAC API Collection Search Endpoint](https://github.com/Healy-Hyperspatial/stac-api-extensions-collection-search-endpoint) specification, which provides a dedicated, conflict-free mechanism for advanced collection searching.
173+
146174
These endpoints support advanced collection discovery features including:
147175

148176
- **Sorting**: Sort collections by sortable fields using the `sortby` parameter
@@ -202,6 +230,96 @@ These extensions make it easier to build user interfaces that display and naviga
202230
> **Important**: Adding keyword fields to make text fields sortable can significantly increase the index size, especially for large text fields. Consider the storage implications when deciding which fields to make sortable.
203231
204232

233+
## Catalogs Route
234+
235+
SFEOS supports federated hierarchical catalog browsing through the `/catalogs` endpoint, enabling users to navigate through STAC catalog structures in a tree-like fashion. This extension allows for organized discovery and browsing of collections and sub-catalogs.
236+
237+
This implementation follows the [STAC API Catalogs Extension](https://github.com/Healy-Hyperspatial/stac-api-extensions-catalogs) specification, which enables a Federated STAC API architecture with a "Hub and Spoke" structure.
238+
239+
### Features
240+
241+
- **Hierarchical Navigation**: Browse catalogs and sub-catalogs in a parent-child relationship structure
242+
- **Collection Discovery**: Access collections within specific catalog contexts
243+
- **STAC API Compliance**: Follows STAC specification for catalog objects and linking
244+
- **Flexible Querying**: Support for standard STAC API query parameters when browsing collections within catalogs
245+
246+
### Endpoints
247+
248+
- **GET `/catalogs`**: Retrieve the root catalog and its child catalogs
249+
- **POST `/catalogs`**: Create a new catalog (requires appropriate permissions)
250+
- **GET `/catalogs/{catalog_id}`**: Retrieve a specific catalog and its children
251+
- **DELETE `/catalogs/{catalog_id}`**: Delete a catalog (optionally cascade delete all collections)
252+
- **GET `/catalogs/{catalog_id}/collections`**: Retrieve collections within a specific catalog
253+
- **POST `/catalogs/{catalog_id}/collections`**: Create a new collection within a specific catalog
254+
- **GET `/catalogs/{catalog_id}/collections/{collection_id}`**: Retrieve a specific collection within a catalog
255+
- **GET `/catalogs/{catalog_id}/collections/{collection_id}/items`**: Retrieve items within a collection in a catalog context
256+
- **GET `/catalogs/{catalog_id}/collections/{collection_id}/items/{item_id}`**: Retrieve a specific item within a catalog context
257+
258+
### Usage Examples
259+
260+
```bash
261+
# Get root catalog
262+
curl "http://localhost:8081/catalogs"
263+
264+
# Get specific catalog
265+
curl "http://localhost:8081/catalogs/earth-observation"
266+
267+
# Get collections in a catalog
268+
curl "http://localhost:8081/catalogs/earth-observation/collections"
269+
270+
# Create a new collection within a catalog
271+
curl -X POST "http://localhost:8081/catalogs/earth-observation/collections" \
272+
-H "Content-Type: application/json" \
273+
-d '{
274+
"id": "landsat-9",
275+
"type": "Collection",
276+
"stac_version": "1.0.0",
277+
"description": "Landsat 9 satellite imagery collection",
278+
"title": "Landsat 9",
279+
"license": "MIT",
280+
"extent": {
281+
"spatial": {"bbox": [[-180, -90, 180, 90]]},
282+
"temporal": {"interval": [["2021-09-27T00:00:00Z", null]]}
283+
}
284+
}'
285+
286+
# Get specific collection within a catalog
287+
curl "http://localhost:8081/catalogs/earth-observation/collections/sentinel-2"
288+
289+
# Get items in a collection within a catalog
290+
curl "http://localhost:8081/catalogs/earth-observation/collections/sentinel-2/items"
291+
292+
# Get specific item within a catalog
293+
curl "http://localhost:8081/catalogs/earth-observation/collections/sentinel-2/items/S2A_20231015_123456"
294+
295+
# Delete a catalog (collections remain intact)
296+
curl -X DELETE "http://localhost:8081/catalogs/earth-observation"
297+
298+
# Delete a catalog and all its collections (cascade delete)
299+
curl -X DELETE "http://localhost:8081/catalogs/earth-observation?cascade=true"
300+
```
301+
302+
### Delete Catalog Parameters
303+
304+
The DELETE endpoint supports the following query parameter:
305+
306+
- **`cascade`** (boolean, default: `false`):
307+
- If `false`: Only deletes the catalog. Collections linked to the catalog remain in the database but lose their catalog link.
308+
- If `true`: Deletes the catalog AND all collections linked to it. Use with caution as this is a destructive operation.
309+
310+
### Response Structure
311+
312+
Catalog responses include:
313+
- **Catalog metadata**: ID, title, description, and other catalog properties
314+
- **Child catalogs**: Links to sub-catalogs for hierarchical navigation
315+
- **Collections**: Links to collections contained within the catalog
316+
- **STAC links**: Properly formatted STAC API links for navigation
317+
318+
This feature enables building user interfaces that provide organized, hierarchical browsing of STAC collections, making it easier for users to discover and navigate through large collections organized by theme, provider, or any other categorization scheme.
319+
320+
> **Configuration**: The catalogs route can be enabled or disabled by setting the `ENABLE_CATALOGS_ROUTE` environment variable to `true` or `false`. By default, this endpoint is **disabled**.
321+
322+
205323
## Package Structure
206324

207325
This project is organized into several packages, each with a specific purpose:
@@ -335,13 +453,17 @@ You can customize additional settings in your `.env` file:
335453
| `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering) on the core `/collections` endpoint. | `true` | Optional |
336454
| `ENABLE_COLLECTIONS_SEARCH_ROUTE` | Enable the custom `/collections-search` endpoint (both GET and POST methods). When disabled, the custom endpoint will not be available, but collection search extensions will still be available on the core `/collections` endpoint if `ENABLE_COLLECTIONS_SEARCH` is true. | `false` | Optional |
337455
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. This is useful for deployments where mutating the catalog via the API should be prevented. If set to `true`, the POST `/collections` route for search will be unavailable in the API. | `true` | Optional |
456+
| `ENABLE_CATALOGS_ROUTE` | Enable the `/catalogs` endpoint for federated hierarchical catalog browsing and navigation. When enabled, provides access to federated STAC API architecture with hub-and-spoke pattern. | `false` | Optional |
338457
| `STAC_GLOBAL_COLLECTION_MAX_LIMIT` | Configures the maximum number of STAC collections that can be returned in a single search request. | N/A | Optional |
339458
| `STAC_DEFAULT_COLLECTION_LIMIT` | Configures the default number of STAC collections returned when no limit parameter is specified in the request. | `300` | Optional |
340459
| `STAC_GLOBAL_ITEM_MAX_LIMIT` | Configures the maximum number of STAC items that can be returned in a single search request. | N/A | Optional |
341460
| `STAC_DEFAULT_ITEM_LIMIT` | Configures the default number of STAC items returned when no limit parameter is specified in the request. | `10` | Optional |
342461
| `STAC_INDEX_ASSETS` | Controls if Assets are indexed when added to Elasticsearch/Opensearch. This allows asset fields to be included in search queries. | `false` | Optional |
343462
| `USE_DATETIME` | Configures the datetime search behavior in SFEOS. When enabled, searches both datetime field and falls back to start_datetime/end_datetime range for items with null datetime. When disabled, searches only by start_datetime/end_datetime range. | `true` | Optional |
463+
| `USE_DATETIME_NANOS` | Enables nanosecond precision handling for `datetime` field searches as per the `date_nanos` type. When `False`, it uses 3 millisecond precision as per the type `date`. | `true` | Optional |
344464
| `EXCLUDED_FROM_QUERYABLES` | Comma-separated list of fully qualified field names to exclude from the queryables endpoint and filtering. Use full paths like `properties.auth:schemes,properties.storage:schemes`. Excluded fields and their nested children will not be exposed in queryables. | None | Optional |
465+
| `EXCLUDED_FROM_ITEMS` | Specifies fields to exclude from STAC item responses. Supports comma-separated field names and dot notation for nested fields (e.g., `private_data,properties.confidential,assets.internal`). | `None` | Optional |
466+
345467

346468
> [!NOTE]
347469
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, `ES_VERIFY_CERTS` and `ES_TIMEOUT` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch.

assets/sfeos.png

-1.17 MB
Loading

compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ services:
2323
- BACKEND=elasticsearch
2424
- DATABASE_REFRESH=true
2525
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true
26+
- ENABLE_CATALOGS_ROUTE=true
2627
- REDIS_ENABLE=true
2728
- REDIS_HOST=redis
2829
- REDIS_PORT=6379
@@ -62,6 +63,7 @@ services:
6263
- BACKEND=opensearch
6364
- STAC_FASTAPI_RATE_LIMIT=200/minute
6465
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true
66+
- ENABLE_CATALOGS_ROUTE=true
6567
- REDIS_ENABLE=true
6668
- REDIS_HOST=redis
6769
- REDIS_PORT=6379

dockerfiles/Dockerfile.deploy.es

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim
1+
FROM python:3.11-slim
22

33
RUN apt-get update && \
44
apt-get -y upgrade && \

dockerfiles/Dockerfile.deploy.os

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim
1+
FROM python:3.11-slim
22

33
RUN apt-get update && \
44
apt-get -y upgrade && \

dockerfiles/Dockerfile.dev.es

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim
1+
FROM python:3.11-slim
22

33

44
# update apt pkgs, and install build-essential for ciso8601

0 commit comments

Comments
 (0)