Projection with Geoviews/HVplot

Hallo,

I am trying to use a projection where the entire globe isn’t shown:

nodes = gv.Points(lonlat_df)

trimesh = gv.TriMesh((df, nodes)).redim(
    x="Longitude (˚E)", y="Latitude (˚N)", z="Resolution (m**2)"
)

#projection = ccrs.PlateCarree()
projection = ccrs.NearsidePerspective()

projected_trimesh = gv.project(trimesh, projection=projection)

FESOM_Resolution = rasterize(projected_trimesh).opts(
    cmap="bgy_r",
    projection=projection,
    width=800,
    height=600,
    colorbar=True,
    colorbar_position="bottom",
    tools=["hover"],
    clabel="Resolution as Average Element Edge Length (km)",
    bgcolor="darkgray",
    color_levels=20,
    cformatter="%.0f",
    clim=(20, 180),
    title="FESOM Resolution (MIS 3 Closed: {:,} 2d Nodes)".format(mesh.n2d),

)

FESOM_Resolution

However, this yields an error with index out of bounds:

IndexError: index 99834 is out of bounds for size 41391

Any hints would help!
Thanks,
PG

Don’t have any immediate suggestions, what this indicates to me is that the projection operation is dropping a bunch of nodes because they fall outside the projection bounds. This ends up confusing the trimesh code which uses simple indexes to look up the vertex positions. I’d consider this a bug in HoloViews tbh which should be addressable by switching to a pandas merge to look up the positions.

Should I open an issue for this? If yes, under which project? I’ll try to include a minimal working example independent of any external data

That would be great. HoloViews is likely the best place since that’s where the fix would be.