Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry path issues in geostationary projection with geometry.geoms #724

Open
TheoMathurin opened this issue Apr 18, 2024 · 4 comments
Open

Comments

@TheoMathurin
Copy link

TheoMathurin commented Apr 18, 2024

geoviews 1.12.0
holoviews 1.18.3
bokeh 3.4.1
cartopy 0.23.0
geos 3.12.1
shapely 2.0.4

With coastline.geoms objects in geostationary projection, paths display weird segments extending apparently infinitely towards the top-left corner.

Not sure this is due to geoviews per se though. I've tried various environments including with older versions of all these libraries and they now all seem to exhibit this behaviour while it used to be fine. I've made sure to delete local natural earth geometries cached by cartopy to fetch the latest (could it come from there?)

Note that it does not happen with a bare gv.feature.coastline, but only with its .geoms (which I use with resample_geometry).

import panel as pn
import geoviews as gv
import cartopy.crs as ccrs

gv.extension('bokeh')


plots = [gv.feature.coastline.geoms(res).options(projection=ccrs.Geostationary()) for res in ['110m', '50m', '10m']]

pn.Row(*plots)

Capture d’écran du 2024-04-18 10-08-41

No error is thrown in python or javascript.

@ahuang11
Copy link
Collaborator

ahuang11 commented Apr 23, 2024

Potential workaround:

import panel as pn
import geoviews as gv
import cartopy.crs as ccrs

gv.extension("bokeh")


plots = [
    gv.Points((0, 0), crs=ccrs.Geostationary()).opts(projection=ccrs.Geostationary())
    * gv.project(gv.feature.coastline().geoms(res), projection=ccrs.Geostationary())
    for res in ["110m", "50m", "10m"]
]

pn.Row(*plots)
image

@TheoMathurin
Copy link
Author

Many thanks @ahuang11 for the idea.

In my admittedly complex use case wrapping geoms into gv.project somehow results in the geometry not showing. Can't really pinpoint a cause right now though.

@TheoMathurin
Copy link
Author

Does anyone know where this issue might come from? I'd like to fix this as otherwise the resampled geometry cannot be used.

@ahuang11
Copy link
Collaborator

ahuang11 commented Jul 11, 2024

To pin it down, I'd look at what gv.project does vs the crs/projection kwargs.

I'd also check if you can reproduce in vanilla matplotlib + cartotpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants