Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] style api error due to multi-dates #911

Closed
pindge opened this issue Nov 30, 2022 · 0 comments · Fixed by #912
Closed

[doc] style api error due to multi-dates #911

pindge opened this issue Nov 30, 2022 · 0 comments · Fixed by #912
Assignees

Comments

@pindge
Copy link
Contributor

pindge commented Nov 30, 2022

need instruction in doc for handling below errors

---------------------------------------------------------------------------
WMSException                              Traceback (most recent call last)
/tmp/ipykernel_172/839274786.py in <module>
     20 from datacube_ows.styles.api import StandaloneStyle, apply_ows_style_cfg, xarray_image_as_png
     21 
---> 22 xr_image = apply_ows_style_cfg(rgb_cfg, data)
     23 png_image = xarray_image_as_png(xr_image)
     24 with open("example1.png", "wb") as fp:

/env/lib/python3.8/site-packages/datacube_ows/styles/api/base.py in apply_ows_style_cfg(cfg, data, loop_over, valid_data_mask)
     96             8 bit signed integer data named red, green, blue and alpha, representing an 24bit RGBA image.
     97     """
---> 98     return apply_ows_style(
     99         StandaloneStyle(cfg),
    100         data,

/env/lib/python3.8/site-packages/datacube_ows/styles/api/base.py in apply_ows_style(style, data, loop_over, valid_data_mask)
     50     """
     51     if loop_over is None:
---> 52         return style.transform_data(
     53                 data,
     54                 style.to_mask(

/env/lib/python3.8/site-packages/datacube_ows/styles/base.py in transform_data(self, data, mask)
    360         """
    361         input_date_count = self.count_dates(data)
--> 362         mdh = self.get_multi_date_handler(input_date_count)
    363         if mdh is None:
    364             img_data = self.transform_single_date_data(data)

/env/lib/python3.8/site-packages/datacube_ows/styles/base.py in get_multi_date_handler(self, count_or_sized_or_ds)
    442         if count in [0, 1]:
    443             return None
--> 444         raise WMSException(f"Style {self.name} does not support requests with {count} dates")
    445 
    446     @classmethod

WMSException: Style stand_alone does not support requests with 2 dates
@pindge pindge self-assigned this Nov 30, 2022
@pindge pindge linked a pull request Dec 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant