-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump version: 0.17.0 → 0.17.1 * add colormap endpoints * fix orientation * update height/width descriptions * remove hex options and handle different cmap types * update from main * fix typo * support discrete cmap * handle sequence cmap * add tests * update docs * colormaps -> colorMaps * update changelog
- Loading branch information
1 parent
66f06ef
commit 9df1731
Showing
14 changed files
with
815 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
199 changes: 160 additions & 39 deletions
199
docs/src/advanced/tiler_factories.md → docs/src/advanced/endpoints_factories.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
In addition to the `/cog`, `/stac` and `/mosaicjson` endpoints, the `titiler.application` package FastAPI application commes with additional metadata endpoints. | ||
|
||
# Algorithms | ||
|
||
## API | ||
|
||
| Method | URL | Output | Description | ||
| ------ | ---------------------------- |---------------- |-------------- | ||
| `GET` | `/algorithms` | JSON | retrieve the list of available Algorithms | ||
| `GET` | `/algorithms/{algorithmId}` | JSON | retrieve the metadata of the specified algorithm. | ||
|
||
## Description | ||
|
||
|
||
### List Algorithm | ||
|
||
`:endpoint:/algorithm` - Get the list of supported TileMatrixSet | ||
|
||
```bash | ||
$ curl https://myendpoint/algorithms | jq | ||
|
||
{ | ||
"hillshade": { | ||
"title": "Hillshade", | ||
"description": "Create hillshade from DEM dataset.", | ||
"inputs": { | ||
"nbands": 1 | ||
}, | ||
"outputs": { | ||
"nbands": 1, | ||
"dtype": "uint8", | ||
"min": null, | ||
"max": null | ||
}, | ||
"parameters": { | ||
"azimuth": { | ||
"default": 90, | ||
"maximum": 360, | ||
"minimum": 0, | ||
"title": "Azimuth", | ||
"type": "integer" | ||
}, | ||
"angle_altitude": { | ||
"default": 90.0, | ||
"maximum": 90.0, | ||
"minimum": -90.0, | ||
"title": "Angle Altitude", | ||
"type": "number" | ||
}, | ||
"buffer": { | ||
"default": 3, | ||
"maximum": 99, | ||
"minimum": 0, | ||
"title": "Buffer", | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
... | ||
} | ||
``` | ||
|
||
### Get Algorithm info | ||
|
||
`:endpoint:/algorithms/{algorithmId}` - Get the algorithm metadata | ||
|
||
- PathParams: | ||
- **algorithmId**: algorithm name | ||
|
||
```bash | ||
$ curl http://127.0.0.1:8000/algorithms/contours | jq | ||
|
||
{ | ||
"title": "Contours", | ||
"description": "Create contours from DEM dataset.", | ||
"inputs": { | ||
"nbands": 1 | ||
}, | ||
"outputs": { | ||
"nbands": 3, | ||
"dtype": "uint8", | ||
"min": null, | ||
"max": null | ||
}, | ||
"parameters": { | ||
"increment": { | ||
"default": 35, | ||
"maximum": 999, | ||
"minimum": 0, | ||
"title": "Increment", | ||
"type": "integer" | ||
}, | ||
"thickness": { | ||
"default": 1, | ||
"maximum": 10, | ||
"minimum": 0, | ||
"title": "Thickness", | ||
"type": "integer" | ||
}, | ||
"minz": { | ||
"default": -12000, | ||
"maximum": 99999, | ||
"minimum": -99999, | ||
"title": "Minz", | ||
"type": "integer" | ||
}, | ||
"maxz": { | ||
"default": 8000, | ||
"maximum": 99999, | ||
"minimum": -99999, | ||
"title": "Maxz", | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
In addition to the `/cog`, `/stac` and `/mosaicjson` endpoints, the `titiler.application` package FastAPI application commes with additional metadata endpoints. | ||
|
||
# Algorithms | ||
|
||
## API | ||
|
||
| Method | URL | Output | Description | ||
| ------ | ---------------------------- |--------|-------------- | ||
| `GET` | `/colorMaps` | JSON | retrieve the list of available colorMaps | ||
| `GET` | `/colorMaps/{colorMapId}` | JSON | retrieve the metadata or image of the specified colorMap. | ||
|
||
## Description | ||
|
||
|
||
### List colormaps | ||
|
||
`:endpoint:/colorMaps` - Get the list of supported ColorMaps | ||
|
||
```bash | ||
$ curl https://myendpoint/colorMaps | jq | ||
|
||
{ | ||
"colorMaps": [ | ||
"dense_r", | ||
"delta", | ||
... | ||
], | ||
"links": [ | ||
{ | ||
"href": "http://myendpoint/colorMaps", | ||
"rel": "self", | ||
"type": "application/json", | ||
"title": "List of available colormaps" | ||
}, | ||
{ | ||
"href": "http://myendpoint/colorMaps/{colorMapId}", | ||
"rel": "data", | ||
"type": "application/json", | ||
"templated": true, | ||
"title": "Retrieve colormap metadata" | ||
}, | ||
{ | ||
"href": "http://myendpoint/colorMaps/{colorMapId}?format=png", | ||
"rel": "data", | ||
"type": "image/png", | ||
"templated": true, | ||
"title": "Retrieve colormap as image" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Get ColorMap metadata or as image | ||
|
||
`:endpoint:/colorMaps/{colorMapId}` - Get the ColorMap metadata or image | ||
|
||
- PathParams: | ||
- **colorMapId**: colormap name | ||
|
||
- QueryParams: | ||
- **format** (str): output image format (PNG/JPEG...). Defaults to JSON output. | ||
- **orientation** (["vertical", "horizontal"]): image orientation. Defaults to `horizontal`. | ||
- **height** (int): output image height. Default to 20px for horizontal or 256px for vertical. | ||
- **width** (int): output image width. Defaults to 256px for horizontal or 20px for vertical. | ||
|
||
```bash | ||
$ curl http://myendpoint/colorMaps/viridis | jq | ||
|
||
{ | ||
"0": [ | ||
68, | ||
1, | ||
84, | ||
255 | ||
], | ||
... | ||
"255": [ | ||
253, | ||
231, | ||
36, | ||
255 | ||
] | ||
} | ||
``` | ||
|
||
``` | ||
curl http://myendpoint/colorMaps/viridis?format=png | ||
``` | ||
|
||
``` | ||
curl http://myendpoint/colorMaps/viridis?format=png&orientation=vertical | ||
``` | ||
|
||
``` | ||
curl http://myendpoint/colorMaps/viridis?format=png&orientation=vertical&width=100&height=1000 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.