Skip to content

Commit e0cd789

Browse files
Merge pull request #45 from developmentseed/fix/Render-parameter-handling
fix: render parameter handling and query-parameter override
2 parents a8bfd36 + 515857a commit e0cd789

4 files changed

Lines changed: 372 additions & 212 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
## [1.1.2] - 2026-02-12
6+
7+
* fix: render's parameter handling and query-parameter override
8+
59
## [1.1.1] - 2026-02-09
610

711
* fix: `APIParams` type to make URL a required key

tests/test_wmts.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,47 @@ def test_wmts_gettile_param_override(client, item_search, rio, app):
337337
assert response.status_code == 500
338338
assert "Could not find any valid assets" in response.json()["detail"]
339339

340+
response = app.get(
341+
"/wmts",
342+
params={
343+
"SERVICE": "WMTS",
344+
"VERSION": "1.0.0",
345+
"REQUEST": "getTile",
346+
"LAYER": "MAXAR_BayofBengal_Cyclone_Mocha_May_23_visual",
347+
"STYLE": "default",
348+
"FORMAT": "image/png",
349+
"TILEMATRIXSET": "WebMercatorQuad",
350+
"TILEMATRIX": 14,
351+
"TILEROW": 7188,
352+
"TILECOL": 12375,
353+
"TIME": "2023-01-05",
354+
"assets": "yo",
355+
},
356+
)
357+
assert response.status_code == 404
358+
assert "yo is not valid." in response.json()["detail"]
359+
360+
response = app.get(
361+
"/wmts",
362+
params=(
363+
("SERVICE", "WMTS"),
364+
("VERSION", "1.0.0"),
365+
("REQUEST", "getTile"),
366+
("LAYER", "MAXAR_BayofBengal_Cyclone_Mocha_May_23_visual"),
367+
("STYLE", "default"),
368+
("FORMAT", "image/png"),
369+
("TILEMATRIXSET", "WebMercatorQuad"),
370+
("TILEMATRIX", 14),
371+
("TILEROW", 7188),
372+
("TILECOL", 12375),
373+
("TIME", "2023-01-05"),
374+
("assets", "visual"),
375+
("assets", "yo"),
376+
),
377+
)
378+
assert response.status_code == 404
379+
assert "yo is not valid." in response.json()["detail"]
380+
340381
response = app.get(
341382
"/wmts",
342383
params={
@@ -357,6 +398,46 @@ def test_wmts_gettile_param_override(client, item_search, rio, app):
357398
assert response.status_code == 400
358399
assert "Could not parse the colormap value" in response.json()["detail"]
359400

401+
response = app.get(
402+
"/wmts",
403+
params=(
404+
("SERVICE", "WMTS"),
405+
("VERSION", "1.0.0"),
406+
("REQUEST", "getTile"),
407+
("LAYER", "MAXAR_BayofBengal_Cyclone_Mocha_May_23_visualr"),
408+
("STYLE", "default"),
409+
("FORMAT", "image/png"),
410+
("TILEMATRIXSET", "WebMercatorQuad"),
411+
("TILEMATRIX", 14),
412+
("TILEROW", 7188),
413+
("TILECOL", 12375),
414+
("TIME", "2023-01-05"),
415+
("rescale", "0,100"),
416+
),
417+
)
418+
assert response.status_code == 200
419+
420+
response = app.get(
421+
"/wmts",
422+
params=(
423+
("SERVICE", "WMTS"),
424+
("VERSION", "1.0.0"),
425+
("REQUEST", "getTile"),
426+
("LAYER", "MAXAR_BayofBengal_Cyclone_Mocha_May_23_visualr"),
427+
("STYLE", "default"),
428+
("FORMAT", "image/png"),
429+
("TILEMATRIXSET", "WebMercatorQuad"),
430+
("TILEMATRIX", 14),
431+
("TILEROW", 7188),
432+
("TILECOL", 12375),
433+
("TIME", "2023-01-05"),
434+
("rescale", "0,1000"),
435+
("rescale", "0,500"),
436+
("rescale", "0,100"),
437+
),
438+
)
439+
assert response.status_code == 200
440+
360441

361442
@patch("rio_tiler.io.rasterio.rasterio")
362443
@patch("titiler.stacapi.backend.ItemSearch")

0 commit comments

Comments
 (0)