Rendering Big Data (Slow when zooming or moving

Hey guys, i’m currently receiving data from a shapefile which has +100k LineString’s. My biggest issue is when i try to zoom out/in or even moving the content, it’s extremely slow. It’s most likely due to a big quantity of data.

Is there any way to solve this issue?

from django.shortcuts import render_to_response

from bokeh.plotting import figure

from bokeh.embed import components

from bokeh.models import ColumnDataSource

import geopandas as gpd

import sys

def index(request):

Read file

data= gpd.read_file("./shapefiles/file.shp")

Read coords

data[‘x’] = data.apply(getPolyCoords, geom=‘geometry’, coord_type=‘x’, axis=1)

Point DataSource

source = ColumnDataSource(data.drop(‘geometry’, axis=1).copy())

Plot

plot = figure(x_axis_location=None, y_axis_location=None, sizing_mode = ‘scale_both’)

plot.multi_line(‘x’, ‘y’, source=source, color=‘black’, line_width=1)

#Store components

script, div = components(plot)

#Feed them to the Django template.

return render_to_response( ‘posts/index.html’,

{‘script’ : script , ‘div’ : div} )

Hi,

This is probably just too much for Bokeh directly. If you only having issues when panning/zooming, you *might* be able to get by with adjusting this Level Of Detail settings to decimate more aggressively during interactive events:

  https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#controlling-level-of-detail

Otherwise, you could have a look at data shader, which can be integrated with Bokeh plots:

  http://datashader.org/

Thanks,

Bryan

···

On Nov 1, 2018, at 09:42, [email protected] wrote:

Hey guys, i'm currently receiving data from a shapefile which has +100k LineString's. My biggest issue is when i try to zoom out/in or even moving the content, it's extremely slow. It's most likely due to a big quantity of data.
Is there any way to solve this issue?

from django.shortcuts import render_to_response
from bokeh.plotting import figure
from bokeh.embed import components
from bokeh.models import ColumnDataSource
import geopandas as gpd
import sys

def index(request):

    # Read file
    data= gpd.read_file("./shapefiles/file.shp")

    # Read coords
    data['x'] = data.apply(getPolyCoords, geom='geometry', coord_type='x', axis=1)

    # Point DataSource
    source = ColumnDataSource(data.drop('geometry', axis=1).copy())

    # Plot
    plot = figure(x_axis_location=None, y_axis_location=None, sizing_mode = 'scale_both')
    plot.multi_line('x', 'y', source=source, color='black', line_width=1)

    #Store components
    script, div = components(plot)

    #Feed them to the Django template.
    return render_to_response( 'posts/index.html',
            {'script' : script , 'div' : div} )

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/abe757d9-3a5e-47e1-a5f2-f1a2084bbc31%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Note that datashader doesn’t currently have any specific support for shapefiles. We are currently looking for people to fund the addition of that functionality, but I don’t know if/when we would be able to do so.

···

On Mon, Nov 26, 2018 at 7:02 PM Bryan Van de ven [email protected] wrote:

Hi,

This is probably just too much for Bokeh directly. If you only having issues when panning/zooming, you might be able to get by with adjusting this Level Of Detail settings to decimate more aggressively during interactive events:

    [https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#controlling-level-of-detail](https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#controlling-level-of-detail)

Otherwise, you could have a look at data shader, which can be integrated with Bokeh plots:

    [http://datashader.org/](http://datashader.org/)

Thanks,

Bryan

On Nov 1, 2018, at 09:42, [email protected] wrote:

Hey guys, i’m currently receiving data from a shapefile which has +100k LineString’s. My biggest issue is when i try to zoom out/in or even moving the content, it’s extremely slow. It’s most likely due to a big quantity of data.

Is there any way to solve this issue?

from django.shortcuts import render_to_response

from bokeh.plotting import figure

from bokeh.embed import components

from bokeh.models import ColumnDataSource

import geopandas as gpd

import sys

def index(request):

# Read file
data= gpd.read_file("./shapefiles/file.shp")
# Read coords
data['x'] = data.apply(getPolyCoords, geom='geometry', coord_type='x', axis=1)
# Point DataSource
source = ColumnDataSource(data.drop('geometry', axis=1).copy())
# Plot
plot = figure(x_axis_location=None, y_axis_location=None, sizing_mode = 'scale_both')
plot.multi_line('x', 'y', source=source, color='black', line_width=1)
#Store components
script, div = components(plot)
#Feed them to the Django template.
return render_to_response( 'posts/index.html',
        {'script' : script , 'div' : div} )

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/abe757d9-3a5e-47e1-a5f2-f1a2084bbc31%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/BBBA39AE-71EE-49B7-B95A-1619933A5204%40anaconda.com.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.