Skip to content

Commit

Permalink
Merge pull request #1 from developmentseed/ab/initial-changes-for-mspc
Browse files Browse the repository at this point in the history
Ab/initial changes for mspc
  • Loading branch information
abarciauskas-bgse authored May 24, 2024
2 parents 6ac6de4 + 8640e48 commit 3b80678
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 1,770 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,31 @@ on:
workflow_dispatch:
push:
branches:
- main
- develop
- main
- develop
tags:
- '*'
- "*"
paths:
# Only run test and docker publish if some code have changed
- 'pyproject.toml'
- 'titiler/**'
- '.pre-commit-config.yaml'
- '.github/workflows/ci.yml'
- "pyproject.toml"
- "titiler/**"
- ".pre-commit-config.yaml"
- ".github/workflows/ci.yml"

# Run tests on pull requests.
pull_request:
branches:
- main
env:
LATEST_PY_VERSION: '3.12'

LATEST_PY_VERSION: "3.12"

jobs:
tests:
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main' || github.event_name != 'pull_request'
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -59,13 +61,12 @@ jobs:
name: ${{ matrix.python-version }}
fail_ci_if_error: false


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 @@ -98,7 +99,7 @@ jobs:
file: dockerfiles/Dockerfile
push: true
tags: |
ghcr.io/developmentseed/titiler-stacapi:latest
ghcr.io/developmentseed/titiler-stacapi-mspc:latest
# Push `{VERSION}` when pushing a new tag
- name: Build and push tag
Expand All @@ -110,4 +111,4 @@ jobs:
file: dockerfiles/Dockerfile
push: true
tags: |
ghcr.io/developmentseed/titiler-stacapi:${{ steps.tag.outputs.version }}
ghcr.io/developmentseed/titiler-stacapi-mspc:${{ steps.tag.outputs.version }}
42 changes: 19 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# titiler-stacapi
# titiler-stacapi-mspc

<p align="center">
<img width="800" src="https://github.com/developmentseed/titiler-stacapi/assets/10407788/bb54162e-9a47-4a67-99e5-6dc91098e048">
<p align="center">Connect titiler to STAC APIs</p>
<p align="center">Connect titiler to MS Planetary Computer STAC API</p>
</p>

<p align="center">
<a href="https://github.com/developmentseed/titiler-stacapi/actions?query=workflow%3ACI" target="_blank">
<img src="https://github.com/developmentseed/titiler-stacapi/workflows/CI/badge.svg" alt="Test">
<a href="https://github.com/developmentseed/titiler-stacapi-mspc/actions?query=workflow%3ACI" target="_blank">
<img src="https://github.com/developmentseed/titiler-stacapi-mspc/workflows/CI/badge.svg" alt="Test">
</a>
<a href="https://codecov.io/gh/developmentseed/titiler-stacapi" target="_blank">
<img src="https://codecov.io/gh/developmentseed/titiler-stacapi/branch/main/graph/badge.svg" alt="Coverage">
<a href="https://codecov.io/gh/developmentseed/titiler-stacapi-mspc" target="_blank">
<img src="https://codecov.io/gh/developmentseed/titiler-stacapi-mspc/branch/main/graph/badge.svg" alt="Coverage">
</a>
<a href="https://github.com/developmentseed/titiler-stacapi/blob/main/LICENSE" target="_blank">
<img src="https://img.shields.io/github/license/developmentseed/titiler-stacapi.svg" alt="License">
<a href="https://github.com/developmentseed/titiler-stacapi-mspc/blob/main/LICENSE" target="_blank">
<img src="https://img.shields.io/github/license/developmentseed/titiler-stacapi-mspc.svg" alt="License">
</a>
</p>

---

**Documentation**: <a href="https://developmentseed.org/titiler-stacapi/" target="_blank">https://developmentseed.org/titiler-stacapi/</a>
**Documentation**: <a href="https://developmentseed.org/titiler-stacapi-mspc/" target="_blank">https://developmentseed.org/titiler-stacapi-mspc/</a>

**Source Code**: <a href="https://github.com/developmentseed/titiler-stacapi" target="_blank">https://github.com/developmentseed/titiler-stacapi</a>
**Source Code**: <a href="https://github.com/developmentseed/titiler-stacapi-mspc" target="_blank">https://github.com/developmentseed/titiler-stacapi-mspc</a>

---

Expand All @@ -30,18 +30,14 @@
Install from sources and run for development:

```
$ git clone https://github.com/developmentseed/titiler-stacapi.git
$ cd titiler-stacapi
$ git clone https://github.com/developmentseed/titiler-stacapi-mspc.git
$ cd titiler-stacapi-mspc
$ python -m pip install -e .
```

## Launch

You'll need to have `TITILER_STACAPI_STAC_API_URL` variables set in your environment pointing to your STAC API service.

```
export TITILER_STACAPI_STAC_API_URL=https://api.stac
```
By default the `stac_api_url` is https://planetarycomputer.microsoft.com/api/stac/v1, but you can override it by setting the environment variable `TITILER_STACAPI_STAC_API_URL`.

```
python -m pip install uvicorn
Expand All @@ -52,8 +48,8 @@ uvicorn titiler.stacapi.main:app --port 8000
### Using Docker

```
$ git clone https://github.com/developmentseed/titiler-stacapi.git
$ cd titiler-stacapi
$ git clone https://github.com/developmentseed/titiler-stacapi-mspc.git
$ cd titiler-stacapi-mspc
$ docker-compose up --build api
```

Expand All @@ -65,16 +61,16 @@ It runs `titiler.stacapi` using Gunicorn web server.

## Contribution & Development

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

## License

See [LICENSE](https://github.com//developmentseed/titiler-stacapi/blob/main/LICENSE)
See [LICENSE](https://github.com//developmentseed/titiler-stacapi-mspc/blob/main/LICENSE)

## Authors

See [contributors](https://github.com/developmentseed/titiler-stacapi/graphs/contributors) for a listing of individual contributors.
See [contributors](https://github.com/developmentseed/titiler-stacapi-mspc/graphs/contributors) for a listing of individual contributors.

## Changes

See [CHANGES.md](https://github.com/developmentseed/titiler-stacapi/blob/main/CHANGES.md).
See [CHANGELOG.md](https://github.com/developmentseed/titiler-stacapi-mspc/blob/main/CHANGELOG.md).
22 changes: 9 additions & 13 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
site_name: TiTiler.STACApi
site_description: Connect titiler to STAC APIs.

docs_dir: 'src'
site_dir: 'build'
docs_dir: "src"
site_dir: "build"

repo_name: developmentseed/titiler-stacapi
repo_url: https://github.com/developmentseed/titiler-stacapi
repo_name: developmentseed/titiler-stacapi-mspc
repo_url: https://github.com/developmentseed/titiler-stacapi-mspc
edit_uri: blob/main/docs/
site_url: https://developmentseed.org/titiler-stacapi/
site_url: https://developmentseed.org/titiler-stacapi-mspc/

extra:
social:
Expand All @@ -17,13 +17,10 @@ extra:
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
- Customization:
- Authentication: custom/application_with_auth.md
- endpoints/index.md
- Collections: endpoints/collections_endpoints.md
- Items: endpoints/items_endpoints.md
- TileMatrixSet: endpoints/tms_endpoints.md
- Technical Considerations: technical-considerations.md
- Development - Contributing: contributing.md
- Release notes: release-notes.md
Expand All @@ -37,7 +34,6 @@ theme:
features:
- navigation.indexes


# https://github.com/kylebarron/cogeo-mosaic/blob/mkdocs/mkdocs.yml#L50-L75
markdown_extensions:
- admonition
Expand Down
88 changes: 0 additions & 88 deletions docs/src/custom/application_with_auth.md

This file was deleted.

26 changes: 0 additions & 26 deletions docs/src/endpoints/collections_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
| ------ | ---------------------------------------------------------------------------------|-----------------------------------------|--------------
| `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
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | Return a Mapbox TileJSON document
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/collections/{collection_id}/{TileMatrixSetId}/map` | HTML | simple map viewer

### Tiles
Expand Down Expand Up @@ -106,29 +105,4 @@ Example:
- `https://myendpoint/collections/my-collection/WebMercatorQuad/tilejson.json?assets=B01&tile_format=png`
- `https://myendpoint/collections/my-collection/WorldCRS84Quad/tilejson.json?assets=B01&tile_scale=2`


### WMTS

`:endpoint:/collections/{collection_id}/{TileMatrixSetId}/WMTSCapabilities.xml`

- PathParams:
- **collection_id**: STAC Collection Identifier.
- **TileMatrixSetId**: TileMatrixSet name (e.g `WebMercatorQuad`).

- QueryParams:
- **tile_format**: Output image format, default is set to PNG.
- **tile_scale**: Tile size scale, default is set to 1 (256x256). OPTIONAL
- **minzoom**: Overwrite default minzoom. OPTIONAL
- **maxzoom**: Overwrite default maxzoom. OPTIONAL

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

Example:

- `https://myendpoint/collections/my-collection/WebMercatorQuad/WMTSCapabilities.xml?assets=B01`
- `https://myendpoint/collections/my-collection/WebMercatorQuad/WMTSCapabilities.xml?assets=B01&tile_format=png`
- `https://myendpoint/collections/my-collection/WorldCRS84Quad/WMTSCapabilities.xml?assets=B01&tile_scale=2`


[tilejson_model]: https://github.com/developmentseed/titiler/blob/2335048a407f17127099cbbc6c14e1328852d619/src/titiler/core/titiler/core/models/mapbox.py#L16-L38
4 changes: 1 addition & 3 deletions docs/src/endpoints/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---

title: Endpoints

---

<p align="center">
<img alt="titiler-pgstac OpenAPI documentation" src="https://github.com/developmentseed/titiler-stacapi/assets/10407788/a4a7619f-8929-41d8-9a0e-26419013b5a8"/>
<img alt="titiler-stacapi OpenAPI documentation" src="https://github.com/developmentseed/titiler-stacapi/assets/10407788/a4a7619f-8929-41d8-9a0e-26419013b5a8"/>
</p>

By default the main application (`titiler.pgstac.main.app`) provides three sets of endpoints:
Expand Down
Loading

0 comments on commit 3b80678

Please sign in to comment.