From 56c4a0142c6f354508758e1d6585736ae22d2324 Mon Sep 17 00:00:00 2001 From: Matthew Iannucci Date: Tue, 7 Jan 2025 12:10:21 -0500 Subject: [PATCH] Thread through --- xpublish_wms/wms/__init__.py | 8 +++++++- xpublish_wms/wms/get_metadata.py | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/xpublish_wms/wms/__init__.py b/xpublish_wms/wms/__init__.py index f80ab71..5cfd247 100644 --- a/xpublish_wms/wms/__init__.py +++ b/xpublish_wms/wms/__init__.py @@ -53,7 +53,13 @@ def wms_handler( if isinstance(query, WMSGetCapabilitiesQuery): return get_capabilities(dataset, request, query) elif isinstance(query, WMSGetMetadataQuery): - return get_metadata(dataset, cache, query, query_params) + return get_metadata( + dataset, + cache, + query, + query_params, + array_get_map_render_threshold_bytes=array_get_map_render_threshold_bytes, + ) elif isinstance(query, WMSGetMapQuery): getmap_service = GetMap( cache=cache, diff --git a/xpublish_wms/wms/get_metadata.py b/xpublish_wms/wms/get_metadata.py index 050bc4a..ad2941d 100644 --- a/xpublish_wms/wms/get_metadata.py +++ b/xpublish_wms/wms/get_metadata.py @@ -17,6 +17,7 @@ def get_metadata( cache: cachey.Cache, query: WMSGetMetadataQuery, query_params: dict, + array_get_map_render_threshold_bytes: int, ) -> Response: """ Return the WMS metadata for the dataset @@ -45,7 +46,13 @@ def get_metadata( da = ds[layer_name] payload = get_timesteps(da, query) elif metadata_type == "minmax": - payload = get_minmax(ds, cache, query, query_params) + payload = get_minmax( + ds, + cache, + query, + query_params, + array_get_map_render_threshold_bytes, + ) else: raise HTTPException( status_code=400, @@ -90,6 +97,7 @@ def get_minmax( cache: cachey.Cache, query: WMSGetMetadataQuery, query_params: dict, + array_get_map_render_threshold_bytes: int, ) -> dict: """ Returns the min and max range of values for a given layer in a given area @@ -112,7 +120,10 @@ def get_minmax( colorscalerange="nan,nan", ) - getmap = GetMap(cache=cache) + getmap = GetMap( + cache=cache, + array_render_threshold_bytes=array_get_map_render_threshold_bytes, + ) return getmap.get_minmax(ds, getmap_query, query_params, entire_layer)