Geographic visualizations for HoloViews
GeoViews is a Python library that makes it easy to explore and visualize geographical, meteorological, and oceanographic datasets, such as those used in weather, climate, and remote sensing research.
GeoViews is built on the HoloViews library for building flexible visualizations of multidimensional data. GeoViews adds a family of geographic plot types based on the Cartopy library, plotted using either the Matplotlib or Bokeh packages. With GeoViews, you can now work easily and naturally with large, multidimensional geographic datasets, instantly visualizing any subset or combination of them, while always being able to access the raw data underlying any plot. Here’s a simple example:
import geoviews as gv import geoviews.feature as gf import xarray as xr from cartopy import crs gv.extension('bokeh', 'matplotlib')
(gf.ocean + gf.land + gf.ocean * gf.land * gf.coastline * gf.borders).opts( 'Feature', projection=crs.Geostationary(), global_extent=True, height=325)
GeoViews is designed to work well with the Iris and xarray libraries for working with multidimensional arrays, such as those stored in netCDF files. GeoViews also accepts data as NumPy arrays and Pandas data frames. In each case, the data can be left stored in its original, native format, wrapped in a HoloViews or GeoViews object that provides instant interactive visualizations.
The following example loads a dataset originally taken from iris-sample-data and quickly builds an interactive tool for exploring how the data changes over time:
dataset = gv.Dataset(xr.open_dataset('./data/ensemble.nc')) ensemble = dataset.to(gv.Image, ['longitude', 'latitude'], 'surface_temperature') gv.output(ensemble.opts(cmap='viridis', colorbar=True, fig_size=120, backend='matplotlib') * gf.coastline(), backend='matplotlib')