Open hdsingh opened 5 years ago
Reproducible Example:
import xarray as xr import hvplot.xarray import geoviews as gv import geoviews.tile_sources as gvts data = xr.tutorial.open_dataset('air_temperature') gvts.OSM * data.air.hvplot.quadmesh(x='lon', y='lat', global_extent=True, rasterize=True,)
produces empty map(it appears for a second though)
however it works correct without rasterize:
gvts.OSM * data.air.hvplot.quadmesh(x='lon', y='lat', global_extent=True)
gv.version: '1.6.2' hvplot.version: '0.4.0'
Same behaviour can be seen with data = xr.tutorial.open_dataset('rasm').
data = xr.tutorial.open_dataset('rasm')
Subtracting 360 from longitude solves this: data['lon'] = data['lon'] -360.
data['lon'] = data['lon'] -360
(The python way to convert [0-360] to [-180:180] is lon180 = ((lon360 - 180) % 360) - 180).
lon180 = ((lon360 - 180) % 360) - 180)
Should geoviews handle this internally?
geoviews
For now this can be handled by telling hvPlot that it should project the data ahead of time:
data.air.hvplot.quadmesh(x='lon', y='lat', global_extent=True, rasterize=True, project=True)
Reproducible Example:
produces empty map(it appears for a second though)
however it works correct without rasterize:
gv.version: '1.6.2' hvplot.version: '0.4.0'
Same behaviour can be seen with
data = xr.tutorial.open_dataset('rasm')
.Solution:
Subtracting 360 from longitude solves this:
data['lon'] = data['lon'] -360
.(The python way to convert [0-360] to [-180:180] is
lon180 = ((lon360 - 180) % 360) - 180)
.Should
geoviews
handle this internally?