Introduction
Bokeh is a Python interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords high-performance interactivity over large or streaming datasets. Bokeh can produce not just standalone HTML documents and server-hosted content.
Table of contents
In this article, we will delve into various methods of crafting a straightforward map using Bokeh.
Using the Esri World Imagery
One solution is to use the Esri World Imagery which is a basemap that offers the most recent satellite imagery for any place in the world. This allows you to access satellite imagery with high resolution and accurate geospatial information without having to purchase or manage large datasets:
from bokeh.plotting import figure, show
p = figure(x_range=(-2000000, 6000000),
y_range=(4000000, 7000000),
x_axis_type="mercator",
y_axis_type="mercator")
p.add_tile("Esri World Imagery")
show(p)
The code above imports the necessary components from Bokeh, sets the output file to be generated, and creates a figure with specified range bounds. The add_tile()
function overlays a satellite image on top of the figure, and show()
renders the map in an HTML document.
We can then zoom out gradually:
References
Links | Site |
---|---|
tile_demo | docs.bokeh.org |
Mapping Geo Data | docs.bokeh.org |
Creating an interactive map in Python using Bokeh and pandas | towardsdatascience.com |
Mapping geo data | docs.bokeh.org |