Skip to content

Ab/initial changes for mspc #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2da874d
Modify readme
abarciauskas-bgse May 22, 2024
5b86d9e
Remove alternate URL and add planetary computer signing
abarciauskas-bgse May 22, 2024
e0e4a1e
Remove WMTS
abarciauskas-bgse May 22, 2024
56d2b0d
Remove application with auth from docs nav
abarciauskas-bgse May 22, 2024
bf1a1aa
Revert changes to collections endpoints.md
abarciauskas-bgse May 22, 2024
0672c74
Revert changes to collections endpoints.md
abarciauskas-bgse May 22, 2024
31fd37a
Revert changes to items endpoints.md
abarciauskas-bgse May 22, 2024
cbeb23a
remove wmts from collections_endpoints.md
abarciauskas-bgse May 22, 2024
96af83e
Remove WMTS from items_endpoints.md
abarciauskas-bgse May 22, 2024
456683f
Revert change to alternate url
abarciauskas-bgse May 22, 2024
001059c
Revert change to alternate url
abarciauskas-bgse May 22, 2024
b53de47
Merge branch 'ab/initial-changes-for-mspc' of github.com:developments…
abarciauskas-bgse May 22, 2024
2913b23
Revert change to items_endpoints.md
abarciauskas-bgse May 23, 2024
343dd03
Reame stac_reader, add blob regex to settings, rewrite signing logic
abarciauskas-bgse May 23, 2024
726ef87
Add tests
abarciauskas-bgse May 23, 2024
6b4c619
Add netcdf fixture json
abarciauskas-bgse May 23, 2024
3c0157c
Fix import and add include_asset_types to test
abarciauskas-bgse May 23, 2024
6f25ae3
Linting
abarciauskas-bgse May 23, 2024
67e5df3
Add doc string
abarciauskas-bgse May 23, 2024
379ae6b
Use modifier in ItemSearch and not explicit signed_url
abarciauskas-bgse May 23, 2024
b0c1901
Remove blob regex
abarciauskas-bgse May 24, 2024
bbb3396
Fix unused import and linting
abarciauskas-bgse May 24, 2024
6ec6ad4
Remove unused models
abarciauskas-bgse May 24, 2024
79bcd7b
Revert change to settings
abarciauskas-bgse May 24, 2024
2757a65
Remove unused fixture
abarciauskas-bgse May 24, 2024
ab31e93
Change repo name
abarciauskas-bgse May 24, 2024
8640e48
Fix links in readme
abarciauskas-bgse May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading