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
library for building flexible visualizations of multidimensional data. GeoViews adds a family of geographic plot types based on the
library, plotted using either the
packages. Each of the new
plot types is a new HoloViews
that has an associated geographic projection based on
objects, each of which can easily be overlaid in the same plots. E.g. an object with temperature data can be overlaid with coastline data using an expression like
can also be freely combined in layouts with any other HoloViews
, making it simple to make even complex multi-figure layouts of overlaid objects.
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 holoviews as hv import geoviews as gv import geoviews.feature as gf import xarray as xr from cartopy import crs hv.notebook_extension()
%%opts Feature [projection=crs.Geostationary()] (gf.ocean + gf.land + gf.ocean * gf.land * gf.coastline * gf.borders).cols(3)
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:
%%opts Image [colorbar=True fig_size=200] (cmap='viridis') ensemble = xr.open_dataset('./sample-data/ensemble.nc') dataset = gv.Dataset(ensemble, kdims=['longitude', 'latitude', 'time'], crs=crs.PlateCarree()) dataset.to(gv.Image, ['longitude', 'latitude'], ['surface_temperature'], ['time']) * gf.coastline()
Please see the User Guide for further documentation.
You can install GeoViews and its other dependencies using conda, many users will want iris and/or xarray as well:
conda install -c conda-forge -c ioam holoviews geoviews # (Optional) conda install xarray conda install -c conda-forge iris
You can now switch to your preferred working directory, grab a copy of the notebooks to run locally, and run them using the Jupyter notebook:
cd ~ python -c 'import geoviews; geoviews.examples("geoviews-examples",include_data=True)' cd geoviews-examples jupyter notebook