Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	titiler/stacapi/factory.py
  • Loading branch information
jverrydt committed Jun 12, 2024
2 parents 47917b2 + 090bf07 commit e73d8e2
Show file tree
Hide file tree
Showing 18 changed files with 1,211 additions and 57 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,50 @@ jobs:
name: ${{ matrix.python-version }}
fail_ci_if_error: false

publish:
needs: [tests]
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_PY_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel twine build
python -m pip install .
- name: Set tag version
id: tag
run: |
echo "version=${GITHUB_REF#refs/*/}"
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set module version
id: module
run: |
echo version=$(python -c'import titiler.stacapi; print(titiler.stacapi.__version__)') >> $GITHUB_OUTPUT
- name: Build and publish
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
rm -rf dist
python -m build
twine upload dist/*
publish-docker:
needs: [tests]
# runs on push to main, on tag creation, and on release
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -110,4 +147,4 @@ jobs:
file: dockerfiles/Dockerfile
push: true
tags: |
ghcr.io/developmentseed/titiler-stacapi:${{ steps.tag.outputs.version }}
ghcr.io/developmentseed/titiler-stacapi:${{ steps.tag.outputs.version }}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


## [Unreleased]

## [0.1.0] - 2024-06-11

* initial release

[Unreleased]: <https://github.com/developmentseed/titiler-stacapi/compare/0.1.0..main>
[0.1.0]: <https://github.com/developmentseed/titiler-stacapi/tree/0.1.0>
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ uvicorn titiler.stacapi.main:app --port 8000
```
$ git clone https://github.com/developmentseed/titiler-stacapi.git
$ cd titiler-stacapi
$ export TITILER_STACAPI_STAC_API_URL=https://api.stac
$ docker-compose up --build api
```

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

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

### WMTS and the Render extension

`titiler-stacapi` makes extensive use of the [**Render**](https://github.com/stac-extensions/render) extension, specifically at the `Collection` level.
By using the render's metadata, the `/wmts` endpoint (from the `OGCWMTSFactory` factory) can populate a set of `layers` returned by the `GetCapabilities` service.


## Contribution & Development

See [CONTRIBUTING.md](https://github.com//developmentseed/titiler-stacapi/blob/main/CONTRIBUTING.md)
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ services:
# setting the configuration option CPL_VSIL_CURL_CACHE_SIZE (in bytes).
- CPL_VSIL_CURL_CACHE_SIZE=200000000
# TiTiler Config
# - RIO_TILER_MAX_THREADS=
- MOSAIC_CONCURRENCY=5
# AWS S3 endpoint config
# - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
# - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
# TiTiler STAC API Config
- TITILER_STACAPI_API_DEBUG=TRUE
- TITILER_STACAPI_STAC_API_URL=
- TITILER_STACAPI_STAC_API_URL=${TITILER_STACAPI_STAC_API_URL}
command:
# You can also overwrite the CMD option and use simple `uvicorn` ASGI server
bash -c "uvicorn titiler.stacapi.main:app --port 8081 --host 0.0.0.0"
8 changes: 4 additions & 4 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ nav:
- Home: index.md
- Endpoints:
- endpoints/index.md
- OGC WMTS: endpoints/ogc_wmts_endpoints.md
- Collections: endpoints/collections_endpoints.md
- Items: endpoints/items_endpoints.md
- TileMatrixSet: endpoints/tms_endpoints.md
- OGC Web Map Tile Service: endpoints/ogc_wmts_endpoints.md
- STAC Collections: endpoints/collections_endpoints.md
- STAC Items: endpoints/items_endpoints.md
- OGC TileMatrix Schemes: endpoints/tms_endpoints.md
- Customization:
- Authentication: custom/application_with_auth.md
- Technical Considerations: technical-considerations.md
Expand Down
10 changes: 5 additions & 5 deletions docs/src/endpoints/ogc_wmts_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
### OGC WMTS endpoints


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

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

Expand Down Expand Up @@ -45,7 +45,7 @@ Example:

### GetTile - REST

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

- PathParams:
- **Layer** (str): Layer identifier
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test = [
"pytest-cov",
"pytest-asyncio",
"httpx",
"owslib",
]

[project.urls]
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
def app(monkeypatch):
"""App fixture."""
monkeypatch.setenv("TITILER_STACAPI_STAC_API_URL", "http://something.stac")
monkeypatch.setenv("TITILER_STACAPI_API_DEBUG", "TRUE")
monkeypatch.setenv("TITILER_STACAPI_CACHE_DISABLE", "TRUE")

from titiler.stacapi.main import app

Expand Down
Binary file added tests/fixtures/1040010082988200-visual.tif
Binary file not shown.
Loading

0 comments on commit e73d8e2

Please sign in to comment.