45
45
from titiler .core .utils import render_image
46
46
from titiler .mosaic .factory import PixelSelectionParams
47
47
from titiler .stacapi .backend import STACAPIBackend
48
- from titiler .stacapi .dependencies import APIParams , STACApiParams , STACSearchParams
48
+ from titiler .stacapi .dependencies import (
49
+ APIParams ,
50
+ STACApiParams ,
51
+ STACQueryParams ,
52
+ STACSearchParams ,
53
+ )
49
54
from titiler .stacapi .models import FeatureInfo , LayerDict
50
55
from titiler .stacapi .pystac import Client
51
56
from titiler .stacapi .settings import CacheSettings , RetrySettings
@@ -723,12 +728,12 @@ class OGCWMTSFactory(BaseTilerFactory):
723
728
724
729
path_dependency : Callable [..., APIParams ] = STACApiParams
725
730
726
- search_dependency : Callable [..., Dict ] = STACSearchParams
727
-
728
731
# In this factory, `reader` should be a Mosaic Backend
729
732
# https://developmentseed.org/cogeo-mosaic/advanced/backends/
730
733
reader : Type [BaseBackend ] = STACAPIBackend
731
734
735
+ query_dependency : Callable [..., Any ] = STACQueryParams
736
+
732
737
# Because the endpoints should work with STAC Items,
733
738
# the `layer_dependency` define which query parameters are mandatory/optional to `display` images
734
739
# Defaults to `titiler.core.dependencies.AssetsBidxExprParams`, `assets=` or `expression=` is required
@@ -806,7 +811,6 @@ def get_tile( # noqa: C901
806
811
# STAC Query parameter provided by the the render extension and QueryParameters
807
812
###########################################################
808
813
query_params = copy (layer .get ("render" )) or {}
809
- query_params ["collections" ] = [layer ["collection" ]]
810
814
811
815
if req_time :
812
816
start_datetime = python_datetime .datetime .strptime (
@@ -825,9 +829,10 @@ def get_tile( # noqa: C901
825
829
query_params ["expression" ] = req ["expression" ]
826
830
827
831
search_query = get_dependency_params (
828
- dependency = self .search_dependency ,
832
+ dependency = self .query_dependency ,
829
833
query_params = query_params ,
830
834
)
835
+ search_query ["collections" ] = [layer ["collection" ]]
831
836
832
837
layer_params = get_dependency_params (
833
838
dependency = self .layer_dependency ,
0 commit comments