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

Coastline + Rasterize shows blank plot #726

Closed
ahuang11 opened this issue Jun 4, 2024 · 3 comments · Fixed by #738
Closed

Coastline + Rasterize shows blank plot #726

ahuang11 opened this issue Jun 4, 2024 · 3 comments · Fixed by #738

Comments

@ahuang11
Copy link
Collaborator

ahuang11 commented Jun 4, 2024

Still an issue from #722

import xarray as xr
import panel as pn
import holoviews as hv
from holoviews.operation.datashader import rasterize
import geoviews as gv
import cartopy.crs as ccrs

hv.extension("bokeh")
import hvplot.xarray
ds = xr.tutorial.open_dataset("air_temperature").isel(time=0)

rasterize(gv.Image(ds, ["lon", "lat"], ["air"])) * gv.feature.coastline()
@ahuang11 ahuang11 added the TRIAGE label Jun 4, 2024
@ahuang11 ahuang11 changed the title Coastline + Rasterize broken Coastline + Rasterize shows blank plot Jun 4, 2024
@ahuang11 ahuang11 added type: bug and removed TRIAGE labels Jun 27, 2024
@TheoMathurin
Copy link

It's odd, in my experience the issue manifested itself when there was a datashader operation involved on both elements (image and geometry), as reported in #593.

@ahuang11
Copy link
Collaborator Author

Finally figured out what is causing this issue, but not sure why. It was introduced in #722

Commenting out https://github.com/holoviz/geoviews/pull/722/files#diff-170766bf0fca811f003fd9c97058f978c51b672af33a49cceab87d3584de2cf5R126-R129 makes it work again

image

With that snippet though, rasterize(obj) * coastline returns empty image

image

Even if I ONLY keep without the unwrap clause, it'd still return an empty image with an overlay

    def update_frame(self, key, ranges=None, element=None):
        super().update_frame(key, ranges, element)

Any ideas @hoxbro or @philippjfr?

@ahuang11
Copy link
Collaborator Author

ahuang11 commented Jul 31, 2024

Heh asking for help always helps me figure it out faster :D

I guess the lesson is always follow best practices; optional kwargs should always have key=value. The positional args didn't match the keyword arguments.

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants