Closed ahuang11 closed 5 years ago
Nevermind works with {'geoviews': '1.6.0', 'holoviews': '1.11.0.post4+gc80f60fc6-dirty', 'hvplot': '0.3.0a7.post2+g73d8f28', 'xarray': '0.11.1'}
Yes, I meant to release hvplot 0.3 before I went on a break. Hoping to do it this weekend now.
Actually if you import geopandas, this breaks:
import xarray as xr
import geopandas as gpd
import holoviews as hv
import geoviews as gv
import hvplot.xarray
import cartopy.crs as ccrs
hv.extension('bokeh')
r = hv.renderer('bokeh')
xr.tutorial.open_dataset('air_temperature')['air'].hvplot(groupby='time', geo=True, projection=ccrs.NorthPolarStereo()) * gv.feature.land
Workaround:
import xarray as xr
import geopandas as gpd
import holoviews as hv
import geoviews as gv
import hvplot.xarray
import cartopy.crs as ccrs
from cartopy import feature
hv.extension('bokeh')
r = hv.renderer('bokeh')
land_shps = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')).dissolve('continent')['geometry']
land = gv.Overlay([gv.Shape(shp) for shp in land_shps])
xr.tutorial.open_dataset('air_temperature')['air'].rename({'lon': 'Longitude', 'lat': 'Latitude'}).hvplot(groupby='time', geo=True, projection=ccrs.NorthPolarStereo()) * land
land_shps = gpd.read_file(
gpd.datasets.get_path('naturalearth_lowres')
)
gv.Polygons(land_shps.dissolve('continent')).opts(projection=ccrs.NorthPolarStereo())
This alone errors
DataError: Supplied data does not contain specified dimensions, the following dimensions were not found: ['Longitude', 'Latitude']
Works with Robinson, PlateCarreee, Mercator, and probably more, but not with Polar/Lambert Conformal