8
8
9
9
def test_tilejson (app ):
10
10
"""Test TileJSON endpoint."""
11
- response = app .get ("/collections/public.landsat_wrs/tilejson.json" )
11
+ response = app .get (
12
+ "/collections/public.landsat_wrs/tiles/WebMercatorQuad/tilejson.json"
13
+ )
12
14
assert response .status_code == 200
13
15
14
16
resp_json = response .json ()
@@ -22,7 +24,9 @@ def test_tilejson(app):
22
24
resp_json ["bounds" ], [- 180.0 , - 82.6401 , 180.0 , 82.6401 ], decimal = 4
23
25
)
24
26
25
- response = app .get ("/collections/public.landsat_wrs/WGS1984Quad/tilejson.json" )
27
+ response = app .get (
28
+ "/collections/public.landsat_wrs/tiles/WGS1984Quad/tilejson.json"
29
+ )
26
30
assert response .status_code == 200
27
31
28
32
resp_json = response .json ()
@@ -38,7 +42,7 @@ def test_tilejson(app):
38
42
)
39
43
40
44
response = app .get (
41
- "/collections/public.landsat_wrs/tilejson.json?minzoom=1&maxzoom=2"
45
+ "/collections/public.landsat_wrs/tiles/WebMercatorQuad/ tilejson.json?minzoom=1&maxzoom=2"
42
46
)
43
47
assert response .status_code == 200
44
48
@@ -48,7 +52,7 @@ def test_tilejson(app):
48
52
assert resp_json ["maxzoom" ] == 2
49
53
50
54
response = app .get (
51
- "/collections/public.landsat_wrs/tilejson.json?minzoom=1&maxzoom=2&limit=1000"
55
+ "/collections/public.landsat_wrs/tiles/WebMercatorQuad/ tilejson.json?minzoom=1&maxzoom=2&limit=1000"
52
56
)
53
57
assert response .status_code == 200
54
58
@@ -59,7 +63,9 @@ def test_tilejson(app):
59
63
assert "?limit=1000" in resp_json ["tiles" ][0 ]
60
64
61
65
# Make sure that a non-4326 collection still returns the bounds in 4326
62
- response = app .get ("/collections/public.minnesota/tilejson.json" )
66
+ response = app .get (
67
+ "/collections/public.minnesota/tiles/WebMercatorQuad/tilejson.json"
68
+ )
63
69
assert response .status_code == 200
64
70
65
71
resp_json = response .json ()
@@ -77,13 +83,15 @@ def test_tile(app):
77
83
mvt_settings .set_mvt_layername = False
78
84
79
85
name = "landsat_wrs"
80
- response = app .get (f"/collections/public.{ name } /tiles/0/0/0" )
86
+ response = app .get (f"/collections/public.{ name } /tiles/WebMercatorQuad/ 0/0/0" )
81
87
assert response .status_code == 200
82
88
decoded = mapbox_vector_tile .decode (response .content )
83
89
assert "default" in decoded .keys ()
84
90
assert len (decoded ["default" ]["features" ]) == 10000
85
91
86
- response = app .get (f"/collections/public.{ name } /tiles/0/0/0?limit=1000" )
92
+ response = app .get (
93
+ f"/collections/public.{ name } /tiles/WebMercatorQuad/0/0/0?limit=1000"
94
+ )
87
95
assert response .status_code == 200
88
96
decoded = mapbox_vector_tile .decode (response .content )
89
97
assert len (decoded ["default" ]["features" ]) == 1000
@@ -92,21 +100,25 @@ def test_tile(app):
92
100
)
93
101
94
102
response = app .get (
95
- f"/collections/public.{ name } /tiles/0/0/0?limit=1&properties=pr,row,path"
103
+ f"/collections/public.{ name } /tiles/WebMercatorQuad/ 0/0/0?limit=1&properties=pr,row,path"
96
104
)
97
105
assert response .status_code == 200
98
106
decoded = mapbox_vector_tile .decode (response .content )
99
107
assert sorted (["pr" , "row" , "path" ]) == sorted (
100
108
decoded ["default" ]["features" ][0 ]["properties" ]
101
109
)
102
110
103
- response = app .get (f"/collections/public.{ name } /tiles/0/0/0?geom-column=geom" )
111
+ response = app .get (
112
+ f"/collections/public.{ name } /tiles/WebMercatorQuad/0/0/0?geom-column=geom"
113
+ )
104
114
assert response .status_code == 200
105
115
decoded = mapbox_vector_tile .decode (response .content )
106
116
assert len (decoded ["default" ]["features" ]) == 10000
107
117
108
118
# invalid geometry column name
109
- response = app .get (f"/collections/public.{ name } /tiles/0/0/0?geom-column=the_geom" )
119
+ response = app .get (
120
+ f"/collections/public.{ name } /tiles/WebMercatorQuad/0/0/0?geom-column=the_geom"
121
+ )
110
122
assert response .status_code == 404
111
123
112
124
mvt_settings .set_mvt_layername = init_value
@@ -118,7 +130,7 @@ def test_tile_custom_name(app):
118
130
mvt_settings .set_mvt_layername = True
119
131
120
132
name = "landsat_wrs"
121
- response = app .get (f"/collections/public.{ name } /tiles/0/0/0" )
133
+ response = app .get (f"/collections/public.{ name } /tiles/WebMercatorQuad/ 0/0/0" )
122
134
assert response .status_code == 200
123
135
decoded = mapbox_vector_tile .decode (response .content )
124
136
assert name in decoded .keys ()
@@ -178,7 +190,9 @@ def test_tile_tms_custom_name(app):
178
190
179
191
def test_stylejson (app ):
180
192
"""Test StyleJSON endpoint."""
181
- response = app .get ("/collections/public.landsat_wrs/style.json" )
193
+ response = app .get (
194
+ "/collections/public.landsat_wrs/tiles/WebMercatorQuad/style.json"
195
+ )
182
196
assert response .status_code == 200
183
197
184
198
resp_json = response .json ()
@@ -197,7 +211,7 @@ def test_stylejson(app):
197
211
np .around (source ["bounds" ], 4 ), [- 180.0 , - 82.6401 , 180.0 , 82.6401 ]
198
212
)
199
213
200
- response = app .get ("/collections/public.landsat_wrs/WGS1984Quad/style.json" )
214
+ response = app .get ("/collections/public.landsat_wrs/tiles/ WGS1984Quad/style.json" )
201
215
assert response .status_code == 200
202
216
203
217
resp_json = response .json ()
@@ -217,7 +231,9 @@ def test_stylejson(app):
217
231
np .around (source ["bounds" ], 4 ), [- 180.0 , - 82.6401 , 180.0 , 82.6401 ]
218
232
)
219
233
220
- response = app .get ("/collections/public.landsat_wrs/style.json?minzoom=1&maxzoom=2" )
234
+ response = app .get (
235
+ "/collections/public.landsat_wrs/tiles/WebMercatorQuad/style.json?minzoom=1&maxzoom=2"
236
+ )
221
237
assert response .status_code == 200
222
238
223
239
resp_json = response .json ()
@@ -227,5 +243,7 @@ def test_stylejson(app):
227
243
assert "minzoom" not in source ["tiles" ][0 ]
228
244
assert "maxzoom" not in source ["tiles" ][0 ]
229
245
230
- response = app .get ("/collections/public.landsat/style.json?geom-column=centroid" )
246
+ response = app .get (
247
+ "/collections/public.landsat/tiles/WebMercatorQuad/style.json?geom-column=centroid"
248
+ )
231
249
assert response .status_code == 200
0 commit comments