7
7
#
8
8
# Copyright (c) 2024 Tom Kralidis
9
9
# Copyright (c) 2022 John A Stevenson and Colin Blackburn
10
+ # Copyright (c) 2025 Joana Simoes
10
11
#
11
12
# Permission is hereby granted, free of charge, to any person
12
13
# obtaining a copy of this software and associated documentation
39
40
from pygeoapi .api import FORMAT_TYPES , F_HTML
40
41
from pygeoapi .api .tiles import (
41
42
get_collection_tiles , tilematrixset ,
42
- tilematrixsets , get_collection_tiles_metadata
43
+ tilematrixsets , get_collection_tiles_metadata ,
44
+ get_collection_tiles_data
43
45
)
44
46
from pygeoapi .models .provider .base import TileMatrixSetEnum
45
47
@@ -65,6 +67,24 @@ def test_get_collection_tiles(config, api_):
65
67
assert len (content ['tilesets' ]) > 0
66
68
67
69
70
+ def test_get_collection_tiles_data (config , api_ ):
71
+ req = mock_api_request ({'f' : 'mvt' })
72
+ rsp_headers , code , response = get_collection_tiles_data (
73
+ api_ , req , 'naturalearth/lakes' ,
74
+ matrix_id = 'WebMercatorQuad' , z_idx = 0 , x_idx = 0 , y_idx = 0 )
75
+ assert code == HTTPStatus .OK
76
+
77
+ rsp_headers , code , response = get_collection_tiles_data (
78
+ api_ , req , 'naturalearth/lakes' ,
79
+ matrix_id = 'WebMercatorQuad' , z_idx = 5 , x_idx = 15 , y_idx = 16 )
80
+ assert code == HTTPStatus .NO_CONTENT
81
+
82
+ rsp_headers , code , response = get_collection_tiles_data (
83
+ api_ , req , 'naturalearth/lakes' ,
84
+ matrix_id = 'WebMercatorQuad' , z_idx = 0 , x_idx = 1 , y_idx = 1 )
85
+ assert code == HTTPStatus .NOT_FOUND
86
+
87
+
68
88
def test_tilematrixsets (config , api_ ):
69
89
req = mock_api_request ()
70
90
rsp_headers , code , response = tilematrixsets (api_ , req )
0 commit comments