Skip to content

Commit

Permalink
add /layers prefix for OGC GetTile
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jun 10, 2024
1 parent 6791a52 commit dd935d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
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
4 changes: 2 additions & 2 deletions titiler/stacapi/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ def web_map_tile_service( # noqa: C901
)

@self.router.get(
"/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}",
"/layers/{LAYER}/{STYLE}/{TIME}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.{FORMAT}",
**img_endpoint_params,
)
def WMTS_getTile(
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def WMTS_getTile(
reader_params=Depends(self.reader_dependency),
env=Depends(self.environment_dependency),
):
"""Create map tile."""
"""OGC WMTS GetTile (REST encoding)"""
search_query = {"collections": [collectionId], "datetime": timeId}

tms = self.supported_tms.get(tileMatrixSetId)
Expand Down
18 changes: 13 additions & 5 deletions titiler/stacapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Link(BaseModel):
str,
Field(
description="Supplies the URI to a remote resource (or resource fragment).",
example="http://data.example.com/buildings/123",
json_schema_extra={"example": "http://data.example.com/buildings/123"},
),
]
rel: Annotated[
Expand All @@ -40,7 +40,9 @@ class Link(BaseModel):
Optional[MediaType],
Field(
description="A hint indicating what the media type of the result of dereferencing the link should be.",
example="application/geo+json",
json_schema_extra={
"example": "application/geo+json",
},
),
] = None
templated: Annotated[
Expand All @@ -51,21 +53,27 @@ class Link(BaseModel):
Optional[str],
Field(
description="A base path to retrieve semantic information about the variables used in URL template.",
example="/ogcapi/vars/",
json_schema_extra={
"example": "/ogcapi/vars/",
},
),
] = None
hreflang: Annotated[
Optional[str],
Field(
description="A hint indicating what the language of the result of dereferencing the link should be.",
example="en",
json_schema_extra={
"example": "en",
},
),
] = None
title: Annotated[
Optional[str],
Field(
description="Used to label the destination of a link such that it can be used as a human-readable identifier.",
example="Trierer Strasse 70, 53115 Bonn",
json_schema_extra={
"example": "Trierer Strasse 70, 53115 Bonn",
},
),
] = None
length: Optional[int] = None
Expand Down

0 comments on commit dd935d7

Please sign in to comment.