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

Issues with Projected Polygons when using hv.operation.datashader.rasterize with "bokeh" backend #743

Open
philipc2 opened this issue Sep 4, 2024 · 3 comments

Comments

@philipc2
Copy link

philipc2 commented Sep 4, 2024

ALL software version info

Mac OS, M1 Mac

GeoViews: '1.12.0'
HoloViews: 1.19.1'

Description of expected behavior and the observed behavior

I am looking to rasterize projected polygons using HoloViews. However, when I rasterize them, the projection appears to have been lost. This only occurs with the "bokeh" backend.

Complete, minimal, self-contained example code that reproduces the issue

import holoviews as hv
import geoviews as gv
import cartopy.crs as ccrs


hv.extension("bokeh")

# GeoDataFrame with polygons already pre-projected 
gdf = ... 

projection = ccrs.Robinson()

out = gv.Polygons(gdf, crs=projection).opts(projection=projection, width=700, height=350, global_extent=True)

hv.operation.datashader.rasterize(out)

Screenshots or screencasts of the bug in action

Here is the plot of the gv.Polygons()

image

When I rasterize them, I get the following:

image
@philipc2 philipc2 changed the title Issues with Projected Polygons when using hv.operation.datashader.rasterize Issues with Projected Polygons when using hv.operation.datashader.rasterize with "bokeh" backend Sep 10, 2024
@ahuang11
Copy link
Collaborator

What if it's not pre-projected?

@philipc2
Copy link
Author

What if it's not pre-projected?

Do you mean using not pre-projected data and then projecting using GeoViews?

@ahuang11
Copy link
Collaborator

Correct; I'm wondering if there's logic in GeoViews if crs == projection, it's not properly projecting on the map.

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