Skip to content

Commit e73d8e2

Browse files
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # titiler/stacapi/factory.py
2 parents 47917b2 + 090bf07 commit e73d8e2

File tree

18 files changed

+1211
-57
lines changed

18 files changed

+1211
-57
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,50 @@ jobs:
5959
name: ${{ matrix.python-version }}
6060
fail_ci_if_error: false
6161

62+
publish:
63+
needs: [tests]
64+
runs-on: ubuntu-latest
65+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Set up Python
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: ${{ env.LATEST_PY_VERSION }}
72+
73+
- name: Install dependencies
74+
run: |
75+
python -m pip install --upgrade pip
76+
python -m pip install wheel twine build
77+
python -m pip install .
78+
79+
- name: Set tag version
80+
id: tag
81+
run: |
82+
echo "version=${GITHUB_REF#refs/*/}"
83+
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
84+
85+
- name: Set module version
86+
id: module
87+
run: |
88+
echo version=$(python -c'import titiler.stacapi; print(titiler.stacapi.__version__)') >> $GITHUB_OUTPUT
89+
90+
- name: Build and publish
91+
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
92+
env:
93+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
94+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
95+
run: |
96+
rm -rf dist
97+
python -m build
98+
twine upload dist/*
6299
63100
publish-docker:
64101
needs: [tests]
65102
# runs on push to main, on tag creation, and on release
66103
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
67104
runs-on: ubuntu-latest
68-
105+
69106
steps:
70107
- name: Checkout
71108
uses: actions/checkout@v4
@@ -110,4 +147,4 @@ jobs:
110147
file: dockerfiles/Dockerfile
111148
push: true
112149
tags: |
113-
ghcr.io/developmentseed/titiler-stacapi:${{ steps.tag.outputs.version }}
150+
ghcr.io/developmentseed/titiler-stacapi:${{ steps.tag.outputs.version }}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
## [Unreleased]
4+
5+
## [0.1.0] - 2024-06-11
6+
7+
* initial release
8+
9+
[Unreleased]: <https://github.com/developmentseed/titiler-stacapi/compare/0.1.0..main>
10+
[0.1.0]: <https://github.com/developmentseed/titiler-stacapi/tree/0.1.0>

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ uvicorn titiler.stacapi.main:app --port 8000
5454
```
5555
$ git clone https://github.com/developmentseed/titiler-stacapi.git
5656
$ cd titiler-stacapi
57+
$ export TITILER_STACAPI_STAC_API_URL=https://api.stac
5758
$ docker-compose up --build api
5859
```
5960

@@ -63,6 +64,12 @@ It runs `titiler.stacapi` using Gunicorn web server.
6364

6465
![](https://github.com/developmentseed/titiler-stacapi/assets/10407788/2e53bfe3-402a-4c57-bf61-c055e32f1362)
6566

67+
### WMTS and the Render extension
68+
69+
`titiler-stacapi` makes extensive use of the [**Render**](https://github.com/stac-extensions/render) extension, specifically at the `Collection` level.
70+
By using the render's metadata, the `/wmts` endpoint (from the `OGCWMTSFactory` factory) can populate a set of `layers` returned by the `GetCapabilities` service.
71+
72+
6673
## Contribution & Development
6774

6875
See [CONTRIBUTING.md](https://github.com//developmentseed/titiler-stacapi/blob/main/CONTRIBUTING.md)

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ services:
3737
# setting the configuration option CPL_VSIL_CURL_CACHE_SIZE (in bytes).
3838
- CPL_VSIL_CURL_CACHE_SIZE=200000000
3939
# TiTiler Config
40+
# - RIO_TILER_MAX_THREADS=
4041
- MOSAIC_CONCURRENCY=5
4142
# AWS S3 endpoint config
4243
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
4344
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
4445
# TiTiler STAC API Config
4546
- TITILER_STACAPI_API_DEBUG=TRUE
46-
- TITILER_STACAPI_STAC_API_URL=
47+
- TITILER_STACAPI_STAC_API_URL=${TITILER_STACAPI_STAC_API_URL}
48+
command:
49+
# You can also overwrite the CMD option and use simple `uvicorn` ASGI server
50+
bash -c "uvicorn titiler.stacapi.main:app --port 8081 --host 0.0.0.0"

docs/mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ nav:
1818
- Home: index.md
1919
- Endpoints:
2020
- endpoints/index.md
21-
- OGC WMTS: endpoints/ogc_wmts_endpoints.md
22-
- Collections: endpoints/collections_endpoints.md
23-
- Items: endpoints/items_endpoints.md
24-
- TileMatrixSet: endpoints/tms_endpoints.md
21+
- OGC Web Map Tile Service: endpoints/ogc_wmts_endpoints.md
22+
- STAC Collections: endpoints/collections_endpoints.md
23+
- STAC Items: endpoints/items_endpoints.md
24+
- OGC TileMatrix Schemes: endpoints/tms_endpoints.md
2525
- Customization:
2626
- Authentication: custom/application_with_auth.md
2727
- Technical Considerations: technical-considerations.md

docs/src/endpoints/ogc_wmts_endpoints.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
### OGC WMTS endpoints
33

44

5-
| Method | URL | Output | Description
6-
| ------ | ------------------------------------------------------------------------------------|------------------------------|--------------
7-
| `GET` | `/wmts` | XML or image/bin or GeoJSON | OGC Web map tile service (KVP encoding)
8-
| `GET` | `/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}` | image/bin | return a web map tile image
5+
| Method | URL | Output | Description
6+
| ------ | -------------------------------------------------------------------------------------------|------------------------------|--------------
7+
| `GET` | `/wmts` | XML or image/bin or GeoJSON | OGC Web map tile service (KVP encoding)
8+
| `GET` | `/layers/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}` | image/bin | OGC GetTile (REST encoding)
99

1010
### WMTS (GetCapabilities / GetTile / GetFeatureInfo) - KVP Encoding
1111

@@ -45,7 +45,7 @@ Example:
4545

4646
### GetTile - REST
4747

48-
`:endpoint:/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}`
48+
`:endpoint:/layers/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}`
4949

5050
- PathParams:
5151
- **Layer** (str): Layer identifier

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test = [
4141
"pytest-cov",
4242
"pytest-asyncio",
4343
"httpx",
44+
"owslib",
4445
]
4546

4647
[project.urls]

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
def app(monkeypatch):
1414
"""App fixture."""
1515
monkeypatch.setenv("TITILER_STACAPI_STAC_API_URL", "http://something.stac")
16+
monkeypatch.setenv("TITILER_STACAPI_API_DEBUG", "TRUE")
17+
monkeypatch.setenv("TITILER_STACAPI_CACHE_DISABLE", "TRUE")
1618

1719
from titiler.stacapi.main import app
1820

489 KB
Binary file not shown.

0 commit comments

Comments
 (0)