question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for crs on holoviews datashader operations

See original GitHub issue

Datashader is very useful when working with geospatial data and holoviews now offers datashader operations. One major issue is that these operations do not currently handle a crs, which makes it difficult to work with them. The main obstacle here is that a) there is no geoviews RGB type, which could be used to hold the output of datashade and b) that projecting on every datashader plot update is very inefficient. I’d therefore suggest a temporary approach to make this work is to offer an operation that projects any Element type to a new crs and secondly to add a crs-aware RGB type to geoviews.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexHilsoncommented, Dec 13, 2017

Thanks a lot for the above information, it’s really helpful.

When I use regrid with the matplotlib backend the above code works as I’d expect. But with the bokeh backend I get DataError: None of the available storage backends were able to support the supplied data format.

i.e. given the setup:

# <iris 'Cube' of air_temperature / (K) (latitude: 1200; longitude: 1600)>
kdims = ['longitude', 'latitude']
vdims = ['air_temperature']
ds = gv.Dataset(cube, kdims=kdims, vdims=vdims)
gv_img = ds.to(gv.Image, kdims)
hv_img = ds.to(hv.Image, kdims)

These will plot:

hv.notebook_extension('bokeh')
regrid(hv_img)
hv.notebook_extension('matplotlib')
regrid(gv_img)

But this throws the exception:

hv.notebook_extension('bokeh')
regrid(gv_img)

My understanding is that I can only add gf.coastline when using gv.Image, so this means that when using datashader I need to choose between an interactive bokeh plot and one with coastlines.

Does this seem correct? If there’s anything I can do to help that’d be great, I’d love to have interactive + geospatially aware datashader plots.

0reactions
philippjfrcommented, Jan 8, 2018

This has now been implemented, datashader operations will now respect the coordinate reference system of the inputs. Should make things a lot more intuitive, we should however add a guide on working with Datashader and GeoViews.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for crs on holoviews datashader operations #45
One major issue is that these operations do not currently handle a crs , which makes it difficult to work with them. The...
Read more >
How to set crs of datashader image - HoloViz Discourse
When I use holoviews.streams.Buffer and hv.DynamicMap(gv.Points, streams=[dfstream]) to stream point geometries onto a geoviews.tile_source ...
Read more >
Working with large data using datashader — HoloViews v1.15.3
If you have Datashader installed, you can instead use Datashader operations like rasterize() to create a dynamic Datashader-based Bokeh plot.
Read more >
pyviz/pyviz - Gitter
This chat is for informal discussions and debugging sessions with developers of the HoloViz.org tools (HoloViews, Datashader, Panel, hvPlot, GeoViews, Param, ...
Read more >
Polygons — Datashader v0.14.3
Spatialpandas provides two Pandas ExtensionArrays that support polygons: ... import holoviews as hv from holoviews.operation.datashader import rasterize ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found