Skip to content

Commit 685612c

Browse files
Merge pull request #41 from developmentseed/feature/next-titiler-version
Update for titiler 1.0
2 parents 9f4850c + 3cc42d5 commit 685612c

30 files changed

Lines changed: 2191 additions & 2556 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ on:
1919
# Run tests on pull requests.
2020
pull_request:
2121
env:
22-
LATEST_PY_VERSION: '3.13'
22+
LATEST_PY_VERSION: '3.14'
2323

2424

2525
jobs:
2626
tests:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
python-version: ['3.11', '3.12', '3.13']
30+
python-version: ['3.11', '3.12', '3.13', '3.14']
3131

3232
steps:
3333
- uses: actions/checkout@v5
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
version: "0.9.*"
7373
enable-cache: true
74-
python-version: ${{ matrix.python-version }}
74+
python-version: ${{ env.LATEST_PY_VERSION }}
7575

7676
- name: Install dependencies
7777
run: |

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
## [Unreleased]
44

5+
* update titiler requirements to `>=1.0,<1.1`
6+
57
## [0.4.0] - 2025-11-06
68

79
* switch to `uv` for development
810
* switch to `hatch` for python package build-system
9-
* remove `titiler` metapackage **breaking change**
1011
* add support for python version 3.13
1112
* bump minimum python version to 3.11
1213
* update docker image to python:3.13

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.13
1+
ARG PYTHON_VERSION=3.14
22

33
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ python -m pip install -U pip
3838
python -m pip install titiler.stacapi
3939
```
4040

41-
or from sources and run for development:
41+
To install from sources and run for development:
42+
43+
We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.
44+
45+
See https://docs.astral.sh/uv/getting-started/installation/ for installation
4246

4347
```bash
4448
git clone https://github.com/developmentseed/titiler-stacapi.git
4549
cd titiler-stacapi
46-
python -m pip install -e .
50+
51+
uv sync
4752
```
4853

4954
## Launch
@@ -52,12 +57,8 @@ You'll need to have `TITILER_STACAPI_STAC_API_URL` variables set in your environ
5257

5358
```
5459
export TITILER_STACAPI_STAC_API_URL=https://api.stac
55-
```
56-
57-
```
58-
python -m pip install uvicorn
5960
60-
uvicorn titiler.stacapi.main:app --port 8000
61+
uv run --extra server uvicorn titiler.stacapi.main:app --port 8000
6162
```
6263

6364
### Using Docker

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is a checklist for releasing a new version of **titiler-stacapi**.
99
3. Run [`bump-my-version`](https://callowayproject.github.io/bump-my-version/) to update all titiler's module versions:
1010

1111
```
12-
bump-my-version bump minor --new-version 0.20.0
12+
uv --with bump-my-version --isolated bump-my-version bump minor --new-version 0.20.0
1313
```
1414
1515
4. Push your release branch, create a PR, and get approval

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
services:
22
api:
3-
# At the time of writing, rasterio wheels are not available for arm64 arch
4-
# so we force the image to be built with linux/amd64
5-
platform: linux/amd64
63
build:
74
context: .
85
ports:

docs/src/custom/application_with_auth.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ requirements: titiler.stacapi
88
```python
99
"""TiTiler+stacapi FastAPI application."""
1010

11+
from dataclasses import dataclass, field
1112

1213
from fastapi import Depends, FastAPI
1314
from fastapi.security import APIKeyHeader
@@ -16,6 +17,7 @@ from starlette.requests import Request
1617
from typing_extensions import Annotated
1718

1819
import morecantile
20+
from titiler.core.dependencies import DefaultDependency
1921
from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers
2022
from titiler.core.middleware import CacheControlMiddleware
2123
from titiler.mosaic.errors import MOSAIC_STATUS_CODES
@@ -31,15 +33,22 @@ stacapi_config = STACAPISettings()
3133
header_scheme = APIKeyHeader(name="Authorization", description="STAC API Authorization")
3234

3335

34-
def STACApiParamsAuth(
35-
request: Request,
36-
token: Annotated[str, Depends(header_scheme)],
37-
) -> APIParams:
38-
"""Return STAC API Parameters."""
39-
return APIParams(
40-
api_url=request.app.state.stac_url,
41-
headers={"Authorization": token},
42-
)
36+
@dataclass(init=False)
37+
class BackendParams(DefaultDependency):
38+
"""backend parameters."""
39+
40+
api_params: APIParams = field(init=False)
41+
42+
def __init__(self, request: Request, token: Annotated[str, Depends(header_scheme)]):
43+
"""Initialize BackendParams
44+
45+
Note: Because we don't want `api_params` to appear in the documentation we use a dataclass with a custom `__init__` method.
46+
FastAPI will use the `__init__` method but will exclude Request in the documentation making `api_params` an invisible dependency.
47+
"""
48+
self.api_params = APIParams(
49+
url=request.app.state.stac_url,
50+
headers={"Authorization": token},
51+
)
4352

4453

4554
app = FastAPI(
@@ -69,20 +78,17 @@ if settings.cors_origins:
6978

7079
app.add_middleware(CacheControlMiddleware, cachecontrol=settings.cachecontrol)
7180

72-
webmerc = morecantile.tms.get("WebMercatorQuad")
73-
webmerc.id = "EPSG:3857"
74-
supported_tms = morecantile.TileMatrixSets({"EPSG:3857": webmerc})
81+
webmerc = morecantile.tms.get("WebMercatorQuad").model_dump()
82+
webmerc["id"] = "EPSG3857"
83+
supported_tms = morecantile.TileMatrixSets({"EPSG3857": morecantile.TileMatrixSet.model_validate(webmerc)})
7584

7685
###############################################################################
7786
# OGC WMTS Endpoints
7887
wmts = OGCWMTSFactory(
79-
path_dependency=STACApiParamsAuth,
88+
backend_dependency=BackendParams,
8089
supported_tms=supported_tms,
8190
)
8291

83-
app.include_router(
84-
wmts.router,
85-
tags=["Web Map Tile Service"],
86-
)
92+
app.include_router(wmts.router, tags=["Web Map Tile Service"])
8793

8894
```

docs/src/endpoints/collections_endpoints.md

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44

55
| Method | URL | Output | Description
66
| ------ | ---------------------------------------------------------------------------------|-----------------------------------------|--------------
7-
| `GET` | `/collections/{collection_id}/tiles/{TileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | Create a web map tile image for a collection and a tile index
8-
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | Return a Mapbox TileJSON document
9-
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
10-
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/map` | HTML | simple map viewer
7+
| `GET` | `/collections/{collection_id}/info` | JSON | return mosaic's basic info
8+
| `GET` | `/collections/{collection_id}/info.geojson` | GeoJSON | return mosaic's basic info as a GeoJSON feature
9+
| `GET` | `/collections/{collection_id}/tiles` | JSON | List of OGC Tilesets available
10+
| `GET` | `/collections/{collection_id}/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
11+
| `GET` | `/collections/{collection_id}/tiles/{TileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | Create a web map tile image for a collection and a tile index
12+
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | Return a Mapbox TileJSON document
13+
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/map.html` | HTML | simple map viewer
14+
| `GET` | `/collections/{collection_id}/point/{lon},{lat}` | JSON | return pixel value from a mosaic assets
15+
| `GET` | `/collections/{collection_id}/bbox/{minx},{miny},{maxx},{maxy}/assets` | JSON | return list of assets intersecting a bounding box
16+
| `GET` | `/collections/{collection_id}/point/{lon},{lat}/assets` | JSON | return list of assets intersecting a point
17+
| `GET` | `/collections/{collection_id}/tiles/{tileMatrixSetId}/{z}/{x}/{y}/assets` | JSON | return list of assets intersecting a XYZ tile
1118

1219
### Tiles
1320

@@ -46,6 +53,9 @@
4653
- **ids** (str): Comma (',') delimited list of IDS.
4754
- **bbox** (str): Comma (',') delimited BoundingBox (not used in the search query, but usefull to limit the bbox of the mosaic).
4855
- **datetime** (str): Datetime filter for the Search Query following `RFC 3339` format (https://github.com/radiantearth/stac-api-spec/blob/v1.0.0/implementation.md#datetime-parameter-handling)
56+
- **filter** (str): A CQL2 filter expression for filtering items.
57+
- **filter-lang** (str): CQL2 Language (cql2-text, cql2-json). Defaults to cql2-text.
58+
- **sortby** (str): An array of property names, prefixed by either '+' for ascending or '-' for descending. If no prefix is provided, '+' is assumed.
4959
- **limit** (int): The maximum number of results to return (page size). Defaults to 10.
5060
- **max_items** (int): The maximum number of items to used in a mosaic. Defaults to 100.
5161

@@ -94,6 +104,9 @@ Example:
94104
- **ids** (str): Comma (',') delimited list of IDS.
95105
- **bbox** (str): Comma (',') delimited BoundingBox (not used in the search query, but usefull to limit the bbox of the mosaic).
96106
- **datetime** (str): Datetime filter for the Search Query following `RFC 3339` format (https://github.com/radiantearth/stac-api-spec/blob/v1.0.0/implementation.md#datetime-parameter-handling)
107+
- **filter** (str): A CQL2 filter expression for filtering items.
108+
- **filter-lang** (str): CQL2 Language (cql2-text, cql2-json). Defaults to cql2-text.
109+
- **sortby** (str): An array of property names, prefixed by either '+' for ascending or '-' for descending. If no prefix is provided, '+' is assumed.
97110
- **limit** (int): The maximum number of results to return (page size). Defaults to 10.
98111
- **max_items** (int): The maximum number of items to used in a mosaic. Defaults to 100.
99112

@@ -106,29 +119,4 @@ Example:
106119
- `https://myendpoint/collections/my-collection/WebMercatorQuad/tilejson.json?assets=B01&tile_format=png`
107120
- `https://myendpoint/collections/my-collection/WorldCRS84Quad/tilejson.json?assets=B01&tile_scale=2`
108121

109-
110-
### WMTS
111-
112-
`:endpoint:/collections/{collection_id}/{TileMatrixSetId}/WMTSCapabilities.xml`
113-
114-
- PathParams:
115-
- **collection_id**: STAC Collection Identifier.
116-
- **TileMatrixSetId**: TileMatrixSet name (e.g `WebMercatorQuad`).
117-
118-
- QueryParams:
119-
- **tile_format**: Output image format, default is set to PNG.
120-
- **tile_scale**: Tile size scale, default is set to 1 (256x256). OPTIONAL
121-
- **minzoom**: Overwrite default minzoom. OPTIONAL
122-
- **maxzoom**: Overwrite default maxzoom. OPTIONAL
123-
124-
!!! important
125-
additional query-parameters will be forwarded to the `tile` URL. If no `defaults` mosaic metadata, **assets** OR **expression** will be required
126-
127-
Example:
128-
129-
- `https://myendpoint/collections/my-collection/WebMercatorQuad/WMTSCapabilities.xml?assets=B01`
130-
- `https://myendpoint/collections/my-collection/WebMercatorQuad/WMTSCapabilities.xml?assets=B01&tile_format=png`
131-
- `https://myendpoint/collections/my-collection/WorldCRS84Quad/WMTSCapabilities.xml?assets=B01&tile_scale=2`
132-
133-
134-
[tilejson_model]: https://github.com/developmentseed/titiler/blob/2335048a407f17127099cbbc6c14e1328852d619/src/titiler/core/titiler/core/models/mapbox.py#L16-L38
122+
[tilejson_model]: https://github.com/developmentseed/titiler/blob/2335048a407f17127099cbbc6c14e1328852d619/src/titiler/core/titiler/core/models/mapbox.py#L16-L38

docs/src/endpoints/items_endpoints.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ The `Item` endpoints are created using TiTiler's [MultiBaseTilerFactory](https:/
44

55
| Method | URL | Output | Description
66
| ------ | -------------------------------------------------------------------- |------------------------------------------------- |--------------
7-
| `GET` | `/collections/{collection_id}/items/{item_id}/bounds` | JSON ([Bounds][bounds_model]) | return dataset's bounds
8-
| `GET` | `/collections/{collection_id}/items/{item_id}/assets` | JSON | return the list of available assets
97
| `GET` | `/collections/{collection_id}/items/{item_id}/info` | JSON ([Info][multiinfo_model]) | return assets basic info
108
| `GET` | `/collections/{collection_id}/items/{item_id}/info.geojson` | GeoJSON ([InfoGeoJSON][multiinfo_geojson_model]) | return assets basic info as a GeoJSON feature
9+
| `GET` | `/collections/{collection_id}/items/{item_id}/assets` | JSON | return the list of available assets
1110
| `GET` | `/collections/{collection_id}/items/{item_id}/asset_statistics` | JSON ([Statistics][multistats_model]) | return per asset statistics
1211
| `GET` | `/collections/{collection_id}/items/{item_id}/statistics` | JSON ([Statistics][stats_model]) | return assets statistics (merged)
1312
| `POST` | `/collections/{collection_id}/items/{item_id}/statistics` | GeoJSON ([Statistics][multistats_geojson_model]) | return assets statistics for a GeoJSON (merged)
13+
| `GET` | `/collections/{collection_id}/items/{item_id}/tiles` | JSON | List of OGC Tilesets available
14+
| `GET` | `/collections/{collection_id}/items/{item_id}/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
1415
| `GET` | `/collections/{collection_id}/items/{item_id}/tiles[/{TileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from assets
1516
| `GET` | `/collections/{collection_id}/items/{item_id}[/{TileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
16-
| `GET` | `/collections/{collection_id}/items/{item_id}[/{TileMatrixSetId}]/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
17-
| `GET` | `/collections/{collection_id}/items/{item_id}[/{TileMatrixSetId}]/map` | HTML | simple map viewer
17+
| `GET` | `/collections/{collection_id}/items/{item_id}[/{TileMatrixSetId}]/map.html` | HTML | simple map viewer
1818
| `GET` | `/collections/{collection_id}/items/{item_id}/point/{lon},{lat}` | JSON ([Point][multipoint_model]) | return pixel values from assets
1919
| `GET` | `/collections/{collection_id}/items/{item_id}/preview[.{format}]` | image/bin | create a preview image from assets
2020
| `GET` | `/collections/{collection_id}/items/{item_id}/bbox/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format}` | image/bin | create an image from part of assets
@@ -265,18 +265,6 @@ Example:
265265
- `https://myendpoint/collections/mycollection/items/oneitem/tilejson.json?assets=B01&tile_format=png`
266266
- `https://myendpoint/collections/mycollection/items/oneitem/WorldCRS84Quad/tilejson.json?tile_scale=2&expression=B01/B02&asset_as_band=True`
267267

268-
### Bounds
269-
270-
`:endpoint:/collections/{collection_id}/items/{item_id}/bounds` - Return the bounds of the STAC item.
271-
272-
- PathParams:
273-
- **collection_id** (str): STAC Collection Identifier.
274-
- **item_id** (str): STAC Item Identifier.
275-
276-
Example:
277-
278-
- `https://myendpoint/collections/mycollection/items/oneitem/bounds`
279-
280268

281269
### Info
282270

docs/src/endpoints/ogc_wmts_endpoints.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Example:
4848
`:endpoint:/layers/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}`
4949

5050
- PathParams:
51-
- **Layer** (str): Layer identifier
51+
- **Layer** (str): Layer identifier (collection_id)
5252
- **Style** (str): Style identifier
5353
- **Time** (str): TIME Dimension
5454
- **TileMatrixSet** (str): TileMatrixSet identifier
@@ -59,4 +59,4 @@ Example:
5959

6060
Example:
6161

62-
- `https://myendpoint/MyLayer/default/2023-01-01/WebMercatorQuad/0/0/0.png
62+
- `https://myendpoint/layers/my-collection/default/2023-01-01/WebMercatorQuad/0/0/0.png`

0 commit comments

Comments
 (0)