Open WesleyTheGeolien opened 3 years ago
This also seems to occur with:
AlbersEqualArea
AzimuthalEquidistant
EquidistantConic
LambertConformal
Mercator
Mollweide
Robinson
Sinusoidal
Stereographic
InterruptedGoodeHomolosine
RotatedPole
Selection works but not the right zone see below
Geostationary
LambertAzimuthalEqualArea
EqualEarth
NorthPolarStereo
SouthPolarStereo
For debugging purposes, does a geographic selection made on plots where such projection is working apply correctly to one of these other projections? I.e. if you put a Plate Carree projection next to an Orthographic projection and select on Plate Caree, does that work at least? (Especially if crossing a zero-longitude boundary, where I think some issues remain in general.)
It doesn't appear so, see code and screenshot below.
I am guessing because they are both using the same variable name holoviz is trying to do some trickery to get them both to line up correctly. Notice the grid coordinates on the Plate Carre have extents from -6e6 to 6e6 for longitude instead of -180 to 180.
import xarray as xr
import geoviews as gv
from holoviews.selection import link_selections
from cartopy import crs
# Load in a dataset anything will do
ds = xr.open_dataset('/home/wesley/Documents/CEREGE/Data/TopoBathyc38.nc')
# Convert dataset to geoviews dataset
dataset = gv.Dataset(ds, crs = crs.PlateCarree())
# Create the maps
# Plate carree works
# Orthographic
fig_plate_carree = dataset.to(gv.Image, ['longitude', 'latitude'], 'Z').opts(projection=crs.PlateCarree(), width=500)
fig_ortho = dataset.to(gv.Image, ['longitude', 'latitude'], 'Z').opts(projection=crs.Orthographic())
selection = link_selections.instance()
selection(fig_ortho + fig_plate_carree)
Zooming in massively show the data on the plate carree is there notice how the orthographic is zoomed in as well.
Finally selection Northern Africa on Plate Carree correctly selects Northern Africa on the orthographic projection.
Given that linked selections is a really cool new feature we want to promote, I hope we can fix this ASAP (and I'll assign this issue to the next milestone).
ALL software version info
geoviews: 1.8.1 holoviews: 1.13.4 bokeh: 2.2.3 cartopy: 0.18.0 python: 3.8.5
Description of expected behavior and the observed behavior
When using
holoviews.selection.link_selections
on an Orthographic plot (we are particularly interested in plots around the poles but realise this is more complicated) the selection_expr appears to be incorrect, this means that any selection carried out on the map will not carry across to the other plots.This functionality works when using PlateCarree projections for example.
Complete, minimal, self-contained example code that reproduces the issue
Screenshots or screencasts of the bug in action
Not working cf. selection_expr
Working: