Skip to content

Commit

Permalink
Thread through
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed Jan 7, 2025
1 parent 74d9010 commit 56c4a01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion xpublish_wms/wms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 13 additions & 2 deletions xpublish_wms/wms/get_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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)


Expand Down

0 comments on commit 56c4a01

Please sign in to comment.