In [1]:
from bokeh.io import output_file, show, output_notebook
from bokeh.layouts import gridplot
from bokeh.plotting import figure
from bokeh.models import GeoJSONDataSource
from bokeh.tile_providers import CARTODBPOSITRON
from bokeh import plotting as plt
from glob import glob
import json
In [2]:
output_notebook()
In [4]:
step = 3500000
x_bound = -9000000 # meters
y_bound = -1500000 # meters
fig = figure(
tools='pan, wheel_zoom',
#x_range=(x_bound, bound+step),
#y_range=(y_bound, bound+step),
height=450, width=900
)
#fig.axis.visible = False
#fig.add_tile(CARTODBPOSITRON)
for fn in glob('../data/estados_2010-*.json'):
with open(fn) as f:
geo_source = GeoJSONDataSource(geojson=f.read())
fig.patches(xs='xs', ys='ys', source=geo_source)
fig.multi_line(
xs='xs', ys='ys', line_color='white',
line_width=2, source=geo_source
)
show(fig)
Out[4]:
[1] Bokeh library is not good enough yet to be used as a Web GIS library. Accessed at 2016-09-09, source: https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/geojson/bokeh/wlQ2LKuxG9Y/UCYOeqrBCgAJ.