Skip to content

Commit

Permalink
FMerge branch 'metadata' of github.com:xpublish-community/xpublish-wm…
Browse files Browse the repository at this point in the history
…s into metadata
  • Loading branch information
mpiannucci committed Jun 16, 2023
2 parents 66ec4f2 + 8d8d911 commit 449bd00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion xpublish_wms/wms/get_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cf_xarray # noqa
import xarray as xr
from fastapi import Request, Response

from xpublish_wms.utils import ds_bbox, format_timestamp

# WMS Styles declaration
Expand All @@ -24,7 +25,10 @@ def create_text_element(root, name: str, text: str) -> ET.Element:


def create_capability_element(
root, name: str, url: str, formats: List[str],
root,
name: str,
url: str,
formats: List[str],
) -> ET.Element:
cap = ET.SubElement(root, name)
# TODO: Add more image formats
Expand Down
15 changes: 12 additions & 3 deletions xpublish_wms/wms/get_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ def select_custom_dim(self, da: xr.DataArray) -> xr.DataArray:
return da

def render(
self, da: xr.DataArray, buffer: io.BytesIO, minmax_only: bool,
self,
da: xr.DataArray,
buffer: io.BytesIO,
minmax_only: bool,
) -> Union[bool, dict]:
"""
Render the data array into an image buffer
Expand All @@ -249,7 +252,10 @@ def render(
return False

def render_regular_grid(
self, da: xr.DataArray, buffer: io.BytesIO, minmax_only: bool,
self,
da: xr.DataArray,
buffer: io.BytesIO,
minmax_only: bool,
) -> Union[bool, dict]:
"""
Render the data array into an image buffer when the dataset is using a
Expand Down Expand Up @@ -305,7 +311,10 @@ def render_regular_grid(
return True

def render_sgrid(
self, da: xr.DataArray, buffer: io.BytesIO, minmax_only: bool,
self,
da: xr.DataArray,
buffer: io.BytesIO,
minmax_only: bool,
) -> Union[bool, dict]:
"""
Render the data array into an image buffer when the dataset is using a
Expand Down

0 comments on commit 449bd00

Please sign in to comment.