Skip to content

Commit 3e62ccd

Browse files
committed
- added checks to test the data type of tiles
1 parent 2262696 commit 3e62ccd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

pygeoapi/api/tiles.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,17 @@ def get_collection_tiles(api: API, request: APIRequest,
141141

142142
tiling_schemes = p.get_tiling_schemes()
143143

144+
datatype = 'vector'
145+
146+
if t['format']['mimetype'].startswith('image'):
147+
datatype = 'map'
148+
144149
for matrix in tiling_schemes:
145150
tile_matrix = {
146151
'title': dataset,
147152
'tileMatrixSetURI': matrix.tileMatrixSetURI,
148153
'crs': matrix.crs,
149-
'dataType': 'vector',
154+
'dataType': datatype,
150155
'links': []
151156
}
152157
tile_matrix['links'].append({
@@ -464,12 +469,17 @@ def get_oas_30(cfg: dict, locale: str) -> tuple[list[dict[str, str]], dict[str,
464469
title = l10n.translate(v['title'], locale)
465470
description = l10n.translate(v['description'], locale)
466471

472+
datatype = 'vector'
473+
474+
if tile_extension['format']['mimetype'].startswith('image'):
475+
datatype = 'map'
476+
467477
paths[tiles_path] = {
468478
'get': {
469479
'summary': f'Fetch a {title} tiles description',
470480
'description': description,
471481
'tags': [k],
472-
'operationId': f'describe{k.capitalize()}.collection.vector.getTileSetsList', # noqa
482+
'operationId': f'describe{k.capitalize()}.collection.{datatype}.getTileSetsList', # noqa
473483
'parameters': [
474484
{'$ref': '#/components/parameters/f'},
475485
{'$ref': '#/components/parameters/lang'}
@@ -490,7 +500,7 @@ def get_oas_30(cfg: dict, locale: str) -> tuple[list[dict[str, str]], dict[str,
490500
'summary': f'Get a {title} tile',
491501
'description': description,
492502
'tags': [k],
493-
'operationId': f'get{k.capitalize()}.collection.vector.getTile', # noqa
503+
'operationId': f'get{k.capitalize()}.collection.{datatype}.getTile', # noqa
494504
'parameters': [
495505
{'$ref': f"{OPENAPI_YAML['oapit']}#/components/parameters/tileMatrixSetId"}, # noqa
496506
{'$ref': f"{OPENAPI_YAML['oapit']}#/components/parameters/tileMatrix"}, # noqa

0 commit comments

Comments
 (0)