Skip to content

Commit dca3a67

Browse files
committed
Align ows:Title, Identifier and Abstract in WMTS GetCapabilities
1 parent 7d479f3 commit dca3a67

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

titiler/stacapi/factory.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,17 @@ def get_layer_from_collections( # noqa: C901
586586
tilematrixsets = render.pop("tilematrixsets", None)
587587
output_format = render.pop("format", None)
588588
aggregation = render.pop("aggregation", None)
589+
title = render.pop("title", None)
589590

590591
_ = render.pop("minmax_zoom", None) # Not Used
591592
_ = render.pop("title", None) # Not Used
592593

593594
# see https://github.com/developmentseed/eoAPI-vito/issues/9#issuecomment-2034025021
594-
render_title = f"{collection.id}_{name}"
595+
render_id = f"{collection.id}_{name}"
595596
layer = {
596-
"id": render_title,
597+
"id": render_id,
597598
"collection": collection.id,
599+
"title": title,
598600
"bbox": [-180, -90, 180, 90],
599601
"style": "default",
600602
"render": render,
@@ -707,9 +709,10 @@ def get_layer_from_collections( # noqa: C901
707709
)
708710
layer["query_string"] = str(qs)
709711

710-
layers[render_title] = LayerDict(
712+
layers[render_id] = LayerDict(
711713
id=layer["id"],
712714
collection=layer["collection"],
715+
title=layer.get("title"),
713716
bbox=layer["bbox"],
714717
format=layer.get("format"),
715718
style=layer["style"],

titiler/stacapi/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class LayerDict(TypedDict, total=False):
114114

115115
id: str
116116
collection: str
117+
title: Optional[str]
117118
bbox: List[float]
118119
format: Optional[str]
119120
style: str

titiler/stacapi/templates/wmts-getcapabilities_1.0.0.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@
5757
<Contents>
5858
{% for layer in layers %}
5959
<Layer>
60-
<ows:Title>{{ layer.title or layer.id }}</ows:Title>
60+
<ows:Title>{{ layer.id }}</ows:Title>
61+
<ows:Abstract>{{ layer.title }}</ows:Abstract>
6162
<ows:WGS84BoundingBox>
6263
<ows:LowerCorner>{{ layer.bbox[0] }} {{ layer.bbox[1] }}</ows:LowerCorner>
6364
<ows:UpperCorner>{{ layer.bbox[2] }} {{ layer.bbox[3] }}</ows:UpperCorner>
6465
</ows:WGS84BoundingBox>
65-
<ows:Identifier>{{ layer.id or layer.title }}</ows:Identifier>
66+
<ows:Identifier>{{ layer.id }}</ows:Identifier>
6667
<Style isDefault="true">
6768
<ows:Title>default</ows:Title>
6869
<ows:Identifier>default</ows:Identifier>

0 commit comments

Comments
 (0)