Drawing Tools ¶
Bokeh's drawing tools are the basis for a wide range of functionality in EarthSim, using the convenient interface provided by HoloViews . They make it simple to build systems for annotating existing data, highlighting regions of interest, and drawing and editing shapes that can be used as input to simulators or other programs. This user guide will give a basic introduction to the drawing tools, including how to access the resulting data from within Python code.
For more detail about the underlying Bokeh tools, see the
Bokeh user guide
. Note that most of the discussion here is not specific to EarthSim, and applies to any usage of the drawing tools in practice, apart from a few I/O routines imported from
when used below.
import os import numpy as np import holoviews as hv import geoviews as gv import cartopy.crs as ccrs from holoviews.streams import PointDraw, PolyEdit, BoxEdit, PolyDraw, FreehandDraw tiles = gv.tile_sources.Wikipedia hv.extension('bokeh')