Skip to content
Merged
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

## Unreleased

### Misc

* rename `/map` endpoint to `/map.html` **breaking change**

### titiler.application

* fix Landing page links when app is behind proxy
16 changes: 8 additions & 8 deletions docs/src/advanced/endpoints_factories.md
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ Factory meant to create endpoints for single dataset using [*rio-tiler*'s `Reade
- **render_func**: Image rendering method. Defaults to `titiler.core.utils.render_image`.
- **add_preview**: . Add `/preview` endpoint to the router. Defaults to `True`.
- **add_part**: . Add `/bbox` and `/feature` endpoints to the router. Defaults to `True`.
- **add_viewer**: . Add `/map` endpoints to the router. Defaults to `True`.
- **add_viewer**: . Add `/map.html` endpoints to the router. Defaults to `True`.

#### Endpoints

@@ -88,7 +88,7 @@ app.include_router(cog.router)
| `GET` | `/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/{tileMatrixSetId}/map` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/map.html` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][point_model]) | return pixel values from a dataset
@@ -135,7 +135,7 @@ app.include_router(stac.router)
| `GET` | `/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from assets
| `GET` | `/{tileMatrixSetId}/map` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/map.html` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][multipoint_model]) | return pixel values from assets
@@ -191,7 +191,7 @@ app.include_router(landsat.router)
| `GET` | `/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/{tileMatrixSetId}/map` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/map.html` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][point_model]) | return pixel value from a dataset
@@ -311,7 +311,7 @@ Endpoints factory for mosaics, built on top of [MosaicJSON](https://github.com/d
- **supported_tms**: List of available TileMatrixSets. Defaults to `morecantile.tms`.
- **templates**: *Jinja2* templates to use in endpoints. Defaults to `titiler.core.factory.DEFAULT_TEMPLATES`.
- **optional_headers**: List of OptionalHeader which endpoints could add (if implemented). Defaults to `[]`.
- **add_viewer**: . Add `/map` endpoints to the router. Defaults to `True`.
- **add_viewer**: . Add `/map.html` endpoints to the router. Defaults to `True`.

#### Endpoints

@@ -324,7 +324,7 @@ Endpoints factory for mosaics, built on top of [MosaicJSON](https://github.com/d
| `GET` | `/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a MosaicJSON
| `GET` | `/{tileMatrixSetId}/map` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/map.html` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][mosaic_point]) | return pixel value from a MosaicJSON dataset
@@ -356,7 +356,7 @@ class: `titiler.xarray.factory.TilerFactory`
- **supported_tms**: List of available TileMatrixSets. Defaults to `morecantile.tms`.
- **templates**: *Jinja2* templates to use in endpoints. Defaults to `titiler.core.factory.DEFAULT_TEMPLATES`.
- **add_part**: . Add `/bbox` and `/feature` endpoints to the router. Defaults to `True`.
- **add_viewer**: . Add `/map` endpoints to the router. Defaults to `True`.
- **add_viewer**: . Add `/map.html` endpoints to the router. Defaults to `True`.


```python
@@ -388,7 +388,7 @@ app.include_router(md.router)
| `GET` | `/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/{tileMatrixSetId}/map` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/map.html` | HTML | return a simple map viewer **Optional**
| `GET` | `/{tileMatrixSetId}/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][point_model]) | return pixel values from a dataset
10 changes: 5 additions & 5 deletions docs/src/endpoints/cog.md
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ The `/cog` routes are based on `titiler.core.factory.TilerFactory` but with `cog
| `GET` | `/cog/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/cog/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/cog/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/cog/{tileMatrixSetId}/map` | HTML | simple map viewer
| `GET` | `/cog/{tileMatrixSetId}/map.html` | HTML | simple map viewer
| `GET` | `/cog/{tileMatrixSetId}/tilejson.json` | JSON | return a Mapbox TileJSON document
| `GET` | `/cog/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/cog/point/{lon},{lat}` | JSON | return pixel values from a dataset
@@ -242,7 +242,7 @@ Example:

### Map

`:endpoint:/cog/{tileMatrixSetId}/map` Simple viewer
`:endpoint:/cog/{tileMatrixSetId}/map.html` Simple viewer

- PathParams:
- **tileMatrixSetId** (str): TileMatrixSet name (e.g `WebMercatorQuad`)
@@ -271,9 +271,9 @@ Example:

Example:

- `https://myendpoint/cog/WebMercatorQuad/map?url=https://somewhere.com/mycog.tif`
- `https://myendpoint/cog/WebMercatorQuad/map?url=https://somewhere.com/mycog.tif&tile_format=png`
- `https://myendpoint/cog/WorldCRS84Quad/map?url=https://somewhere.com/mycog.tif&tile_scale=2&bidx=1,2,3`
- `https://myendpoint/cog/WebMercatorQuad/map.html?url=https://somewhere.com/mycog.tif`
- `https://myendpoint/cog/WebMercatorQuad/map.html?url=https://somewhere.com/mycog.tif&tile_format=png`
- `https://myendpoint/cog/WorldCRS84Quad/map.html?url=https://somewhere.com/mycog.tif&tile_scale=2&bidx=1,2,3`


### Bounds
2 changes: 1 addition & 1 deletion docs/src/endpoints/mosaic.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ Read Mosaic Info/Metadata and create Web map Tiles from a multiple COG. The `mos
| `GET` | `/mosaicjson/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/mosaicjson/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/mosaicjson/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from mosaic assets
| `GET` | `/mosaicjson/{tileMatrixSetId}/map` | HTML | simple map viewer
| `GET` | `/mosaicjson/{tileMatrixSetId}/map.html` | HTML | simple map viewer
| `GET` | `/mosaicjson/{tileMatrixSetId}/tilejson.json` | JSON | return a Mapbox TileJSON document
| `GET` | `/mosaicjson/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/mosaicjson/point/{lon},{lat}` | JSON | return pixel value from a mosaic assets
4 changes: 2 additions & 2 deletions docs/src/endpoints/stac.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ The `/stac` routes are based on `titiler.core.factory.MultiBaseTilerFactory` but
| `GET` | `/stac/tiles` | JSON | List of OGC Tilesets available
| `GET` | `/stac/tiles/{tileMatrixSetId}` | JSON | OGC Tileset metadata
| `GET` | `/stac/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from assets
| `GET` | `/stac/{tileMatrixSetId}/map` | HTML | simple map viewer
| `GET` | `/stac/{tileMatrixSetId}/map.html` | HTML | simple map viewer
| `GET` | `/stac/{tileMatrixSetId}/tilejson.json` | JSON | return a Mapbox TileJSON document
| `GET` | `/stac/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/stac/point/{lon},{lat}` | JSON | return pixel value from assets
@@ -264,7 +264,7 @@ Example:

### Map

`:endpoint:/stac/{tileMatrixSetId}/map` Simple viewer
`:endpoint:/stac/{tileMatrixSetId}/map.html` Simple viewer

- PathParams:
- **tileMatrixSetId** (str): TileMatrixSet name (e.g `WebMercatorQuad`)
6 changes: 3 additions & 3 deletions src/titiler/core/titiler/core/factory.py
Original file line number Diff line number Diff line change
@@ -241,7 +241,7 @@ class TilerFactory(BaseFactory):
templates (Jinja2Templates): Jinja2 templates.
add_preview (bool): add `/preview` endpoints. Defaults to True.
add_part (bool): add `/bbox` and `/feature` endpoints. Defaults to True.
add_viewer (bool): add `/map` endpoints. Defaults to True.
add_viewer (bool): add `/map.html` endpoints. Defaults to True.

"""

@@ -925,9 +925,9 @@ def tilejson(
}

def map_viewer(self): # noqa: C901
"""Register /map endpoint."""
"""Register /map.html endpoint."""

@self.router.get("/{tileMatrixSetId}/map", response_class=HTMLResponse)
@self.router.get("/{tileMatrixSetId}/map.html", response_class=HTMLResponse)
def map_viewer(
request: Request,
tileMatrixSetId: Annotated[
4 changes: 2 additions & 2 deletions src/titiler/mosaic/titiler/mosaic/factory.py
Original file line number Diff line number Diff line change
@@ -715,9 +715,9 @@ def tilejson(
}

def map_viewer(self): # noqa: C901
"""Register /map endpoint."""
"""Register /map.html endpoint."""

@self.router.get("/{tileMatrixSetId}/map", response_class=HTMLResponse)
@self.router.get("/{tileMatrixSetId}/map.html", response_class=HTMLResponse)
def map_viewer(
request: Request,
tileMatrixSetId: Annotated[