Set x_range/y_range with projection

It seems the x_range and y_range in datashade don’t support transform=ccrs.PlateCarree().
How could I set the correct x_range and y_range using lon/lat value?

Here’s the example where I want to plot data between 60 N and 90 N.

import xarray as xr
import geoviews as gv
import cartopy.crs as ccrs
import geoviews.feature as gf
from holoviews.operation.datashader import datashade

gv.extension("bokeh")

ds = xr.tutorial.open_dataset('rasm').load()

gvds = gv.Dataset(ds.isel(time=0),
                 crs=ccrs.PlateCarree(),
                 )

mesh = gvds.to(gv.QuadMesh, kdims=["xc", "yc"], vdims=['Tair'], extents=(-180, 60, 180, 90))

datashade(gv.project(mesh, projection=ccrs.NorthPolarStereo()),
          precompute=True,
          cmap='Spectral_r',
          dynamic=True,
          # y_range=(60, 90),
          # x_range=(-180, 180),
         )*\
gf.coastline.opts(width=500, height=500,
                  tools=['hover'],
                  projection=ccrs.NorthPolarStereo(),
                 )

opts(xlim=, ylim=) in degrees I think works

Unfortunately, it doesn’t work because the projection isn’t PlateCarree.

See https://github.com/holoviz/geoviews/issues/340

Thanks. I have tried to add .redim.range(Longitude=(-180, 180), Latitude=(60, 90)) at the end. It also doesn’t work.

Then you may have to set xlim/ylim using the projected coordinates.