Skip to content

Commit 6c5e2f8

Browse files
Merge pull request #273 from stac-utils/feat/update-titiler-2.0
feat: update for titiler 2.0
2 parents 97861a4 + bcd683a commit 6c5e2f8

21 files changed

Lines changed: 1690 additions & 499 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: Install dependencies
4141
run: |
42-
uv sync --extra psycopg
42+
uv sync
4343
4444
- name: Run pre-commit
4545
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
@@ -63,7 +63,7 @@ jobs:
6363
needs: [tests]
6464
runs-on: ubuntu-latest
6565
env:
66-
PGSTAC_VERSION: '0.9.10'
66+
PGSTAC_VERSION: '0.9.11'
6767
steps:
6868
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6969

@@ -76,7 +76,7 @@ jobs:
7676

7777
- name: Install dependencies
7878
run: |
79-
uv sync --frozen --group benchmark --extra psycopg
79+
uv sync --frozen --group benchmark
8080
uv pip install pypgstac==${{ env.PGSTAC_VERSION }}
8181
8282
- name: Launch services

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Unreleased
44

5+
## 3.0.0 (TBD)
6+
7+
* change: update titiler requirement to `>=2.0,<2.1`
8+
* change: asset notation (support for `assets={asset_name}|{option}={value}`)
9+
* remove: `asset_bidx` and `asset_expression` options in favor of the new asset notation
10+
* remove: `tile-scale` path parameter in favor of `tilesize` query parameter in tiles endpoints
11+
* remove: support for `vrt://{asset_name}` assets
12+
513
## 2.1.0 (2026-03-05)
614

715
* disable tests for pre-0.9 pgstac versions

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ See https://docs.astral.sh/uv/getting-started/installation/ for installation
1212
git clone https://github.com/stac-utils/titiler-pgstac.git
1313
cd titiler-pgstac
1414

15-
uv sync --extra psycopg
15+
uv sync
1616
```
1717

1818
You can then run the tests with the following command:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ services:
7474

7575
database:
7676
container_name: stac-db
77-
image: ghcr.io/stac-utils/pgstac:v${PGSTAC_VERSION-0.9.8}
77+
image: ghcr.io/stac-utils/pgstac:v${PGSTAC_VERSION-0.9.11}
7878
environment:
7979
- POSTGRES_USER=username
8080
- POSTGRES_PASSWORD=password

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ nav:
4949
- Migration Guides:
5050
- v0.8 -> v1.0: migrations/v1_migration.md
5151
- v1.9 -> v2.0: migrations/v2_migration.md
52+
- v2.0 -> v3.0: migrations/v3_migration.md
5253
- Development - Contributing: contributing.md
5354
- Release notes: release-notes.md
5455
- Performance Benchmarks: benchmark.html

docs/src/endpoints/collections_endpoints.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| ------ | ---------------------------------------------------------------------------------|-----------------------------------------|--------------
77
| `GET` | `/collections/{collection_id}/tiles` | JSON | List of OGC Tilesets available
88
| `GET` | `/collections/{collection_id}/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
9-
| `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
9+
| `GET` | `/collections/{collection_id}/tiles/{TileMatrixSetId}/{z}/{x}/{y}[.{format}]` | image/bin | Create a web map tile image for a collection and a tile index
1010
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/map.html` | HTML | Simple map viewer
1111
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | Return a Mapbox TileJSON document
1212
| `POST` | `/collections/{collection_id}/statistics` | GeoJSON ([Statistics][statitics_model]) | Return statistics for geojson features
@@ -19,24 +19,34 @@
1919
| `GET` | `/collections/{collection_id}/info` | JSON ([Info][info_model]) | Return **Search** query infos from `collection_id`
2020
| `GET` | `/collections/{collection_id}/WMTSCapabilities.xml` | XML | Return OGC WMTS Get Capabilities
2121

22+
### Assets With Options
23+
24+
`assets=` query parameter can be used to specify which assets to use for a given request, but also to specify options for each asset using the following syntax: `assets={asset_name}|OPTION1=VALUE1|OPTION2=VALUE2`.
25+
26+
For example: `assets=visual|bidx=1,2|expression=(b2-b1)/(b2+b1)` will select the band 1 and 2 of within the `visual` asset and apply a normalized difference indexes expression.
27+
28+
ref:
29+
30+
- https://cogeotiff.github.io/rio-tiler/latest/migrations/v9_migration/#stacreader-asset-options-syntax
31+
- https://developmentseed.org/titiler/migrations/v2_migration/#7-removed-asset_indexes-and-asset_expression-options
32+
2233
### Tiles
2334

24-
`:endpoint:/collections/{collection_id}/tiles/{TileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]`
35+
`:endpoint:/collections/{collection_id}/tiles/{TileMatrixSetId}/{z}/{x}/{y}[.{format}]`
2536

2637
- PathParams:
2738
- **collection_id**: STAC Collection Identifier.
2839
- **TileMatrixSetId**: TileMatrixSet name.
2940
- **z**: Tile's zoom level.
3041
- **x**: Tile's column.
3142
- **y**: Tile's row.
32-
- **scale**: Tile size scale, default is set to 1 (256x256). OPTIONAL
3343
- **format**: Output image format, default is set to None and will be either JPEG or PNG depending on masked value. OPTIONAL
3444

3545
- QueryParams:
36-
- **assets** (array[str]): asset names.
37-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
38-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
39-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
46+
- **assets** (array[str]): asset names. **Required**
47+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
48+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
49+
- **tilesize** (int): overwrite TMS tileWidth x tileHeight with fixed tilesize.
4050
- **nodata**: Overwrite internal Nodata value. OPTIONAL
4151
- **unscale** (bool): Apply dataset internal Scale/Offset.
4252
- **resampling** (str): RasterIO resampling algorithm. Defaults to `nearest`.
@@ -62,9 +72,6 @@
6272
- **query** (str): Filters items based on property values.
6373
- **sortby** (str): Comma "," delimited property names, prefixed by either '+' for ascending or '-' for descending. If no prefix is provided, '+' is assumed.
6474

65-
!!! important
66-
**assets** OR **expression** is required
67-
6875
Example:
6976

7077
- `https://myendpoint/collections/my-collection/tiles/WebMercatorQuad/1/2/3?assets=B01`
@@ -81,13 +88,13 @@ Example:
8188
- **TileMatrixSetId**: TileMatrixSet name.
8289

8390
- QueryParams:
91+
- **assets** (array[str]): asset names. **Required**
92+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
93+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
8494
- **tile_format**: Output image format, default is set to None and will be either JPEG or PNG depending on masked value.
85-
- **tile_scale**: Tile size scale, default is set to 1 (256x256). OPTIONAL
95+
- **tilesize** (int): overwrite TMS tileWidth x tileHeight with fixed tilesize. Defaults to **512**.
8696
- **minzoom**: Overwrite default minzoom. OPTIONAL
8797
- **maxzoom**: Overwrite default maxzoom. OPTIONAL
88-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
89-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
90-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
9198
- **nodata** (str, int, float): Overwrite internal Nodata value.
9299
- **unscale** (bool): Apply dataset internal Scale/Offset.
93100
- **resampling** (str): RasterIO resampling algorithm. Defaults to `nearest`.
@@ -113,9 +120,6 @@ Example:
113120
- **query** (str): Filters items based on property values.
114121
- **sortby** (str): Comma "," delimited property names, prefixed by either '+' for ascending or '-' for descending. If no prefix is provided, '+' is assumed.
115122

116-
!!! important
117-
**assets** OR **expression** is required
118-
119123
Example:
120124

121125
- `https://myendpoint/collections/my-collection/WebMercatorQuad/tilejson.json?assets=B01`
@@ -132,7 +136,7 @@ Example:
132136

133137
- QueryParams:
134138
- **tile_format**: Output image format, default is set to PNG.
135-
- **tile_scale**: Tile size scale, default is set to 1 (256x256). OPTIONAL
139+
- **tilesize** (int): overwrite TMS tileWidth x tileHeight with fixed tilesize.
136140
- **minzoom**: Overwrite default minzoom. OPTIONAL
137141
- **maxzoom**: Overwrite default maxzoom. OPTIONAL
138142
- **ids** (str): Array of Item ids to show.
@@ -143,7 +147,7 @@ Example:
143147

144148

145149
!!! important
146-
additional query-parameters will be forwarded to the `tile` URL. If no `defaults` mosaic metadata, **assets** OR **expression** will be required
150+
additional query-parameters will be forwarded to the `tile` URL. If no `defaults` mosaic metadata, **assets** will be required.
147151

148152
Example:
149153

@@ -239,10 +243,9 @@ Example:
239243
- **collection_id**: STAC Collection Identifier.
240244

241245
- QueryParams:
242-
- **assets** (array[str]): asset names.
243-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
244-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
245-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
246+
- **assets** (array[str]): asset names. **Required**
247+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
248+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
246249
- **coord_crs** (str): Coordinate Reference System of the input geometry. Default to `epsg:4326`.
247250
- **dst_crs** (str): Output Coordinate Reference System. Default to `coord_crs`.
248251
- **max_size** (int): Max image size from which to calculate statistics.
@@ -274,6 +277,9 @@ Example:
274277
!!! important
275278
if **height** or **width** is provided **max_size** will be ignored.
276279

280+
!!! note
281+
Use `assets=:all:` to use all available assets
282+
277283
Example:
278284

279285
- `https://myendpoint/collections/my-collection/statistics?assets=B01`
@@ -292,10 +298,9 @@ Example:
292298
- **width** (int): Force output image width.
293299

294300
- QueryParams:
295-
- **assets** (array[str]): asset names.
296-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
297-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
298-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
301+
- **assets** (array[str]): asset names. **Required**
302+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
303+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
299304
- **coord_crs** (str): Coordinate Reference System of the input coordinates. Default to `epsg:4326`.
300305
- **dst_crs** (str): Output Coordinate Reference System. Default to `coord_crs`.
301306
- **max_size** (int): Max image size.
@@ -348,10 +353,9 @@ Example:
348353
- **format** (str): Output image format, default is set to None and will be either JPEG or PNG depending on masked value. **Optional**
349354

350355
- QueryParams:
351-
- **assets** (array[str]): asset names.
352-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
353-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
354-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
356+
- **assets** (array[str]): asset names. **Required**
357+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
358+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
355359
- **coord_crs** (str): Coordinate Reference System of the input geometry. Default to `epsg:4326`.
356360
- **dst_crs** (str): Output Coordinate Reference System. Default to `coord_crs`.
357361
- **max_size** (int): Max image size.
@@ -398,10 +402,9 @@ Example:
398402
- **lat**: Latitude (in `coord-crs`, defaults to `WGS84`).
399403

400404
- QueryParams:
401-
- **assets** (array[str]): asset names.
402-
- **expression** (str): rio-tiler's math expression with asset names (e.g `Asset1_b1/Asset2_b1`).
403-
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset, so expression `Asset1/Asset2` can be passed.
404-
- **asset_bidx** (array[str]): Per asset band index (e.g `Asset1|1;2;3`).
405+
- **assets** (array[str]): asset names. **Required**
406+
- **expression** (str): rio-tiler's math expression (e.g `b1/b2`).
407+
- **asset_as_band** (bool): tell rio-tiler that each asset is a 1 band dataset.
405408
- **coord_crs** (str): Coordinate Reference System of the input geometry. Default to `epsg:4326`.
406409
- **nodata** (str, int, float): Overwrite internal Nodata value.
407410
- **unscale** (bool): Apply dataset internal Scale/Offset.
@@ -418,9 +421,6 @@ Example:
418421
- **query** (str): Filters items based on property values.
419422
- **sortby** (str): Comma "," delimited property names, prefixed by either '+' for ascending or '-' for descending. If no prefix is provided, '+' is assumed.
420423

421-
!!! important
422-
**assets** OR **expression** is required
423-
424424
Example:
425425

426426
- `https://myendpoint/collections/my-collection/point/0,0?assets=B01`

0 commit comments

Comments
 (0)