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.

Speeding up projected maps in geoviews?

See original GitHub issue

I’m visualizing public Landsat data with hvplot.xarray but I think this is likely a geoviews issue.

It takes about 3 seconds to render an image when not using the crs: 2018-09-19_17-11-28

It takes about 3 minutes to render an image when using the crs: 2018-09-19_17-12-26

Without crs it’s using my dask cluster, but with crs it does not use the cluster.

This is the code I’m using:

import rasterio 
import xarray as xr
import hvplot.xarray
from dask.distributed import Client, progress
import cartopy.crs as ccrs

client = Client()

image_url = 'https://storage.googleapis.com/gcp-public-data-landsat/LC08/01/047/027/LC08_L1TP_047027_20130421_20170310_01_T1/LC08_L1TP_047027_20130421_20170310_01_T1_B4.TIF'

da = xr.open_rasterio(image_url, chunks={'band': 1, 'x': 2048, 'y': 2048})

band1 = da.sel(band=1).persist()

display(band1.hvplot(rasterize=True, width=600, height=400, cmap='viridis'))

crs = ccrs.UTM(zone='10n')
display(band1.hvplot(crs=crs, rasterize=True, width=600, height=400, cmap='viridis'))

Here is the notebook.

Is this expected?

Is there anything I can do to speed up visualization with crs specified?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
philippjfrcommented, Nov 2, 2018

I’ve opened https://github.com/pyviz/hvplot/pull/106 to add the project=True/False argument to hvplot.

1reaction
philippjfrcommented, Nov 2, 2018

Okay, I’m now wondering whether hvplot is doing something quite suboptimal, using geoviews directly things are pretty quick:

import geoviews as gv
from holoviews.operation.datashader import rasterize
gv.extension('bokeh')

tiff = gv.load_tiff('/Users/philippjfr/Downloads/LC08_L1TP_047027_20130421_20170310_01_T1_B4.TIF')
rasterize(tiff)

It seems like hvplot is projecting before rasterizing, which would explain the slow speed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Speeding up projected maps in geoviews? · Issue #230 - GitHub
I'm visualizing public Landsat data with hvplot.xarray but I think this is likely a geoviews issue. It takes about 3 seconds to render...
Read more >
Projections — GeoViews 1.9.5+g5eb9cd4-dirty documentation
The GeoViews package provides a library of HoloViews Element types which make it very easy to plot data on various geographic projections and...
Read more >
python 3.x - Displaying Paths with Geoviews - Stack Overflow
I'm trying to use geoviews to display a path. I can get it to display ONLY the points properly: import numpy as np...
Read more >
Interactive maps — Environmental Simulation Modelling
Interactive maps¶. In this notebook, we will explore other capabilities of the hvPlot ecosystem. The associated functions allow to create plots with many ......
Read more >
Fancy Folium - Kaggle
My main aim was to produce interactive maps and I started off with libraries that used shapefiles such as geoviews (http://geo.holoviews.org/), this was...
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