Digital-Earth#
digitalearth is a Python package providing different plots for rasters and vector data, built on top of cleopatra, pyramids, matplotlib, and geopandas.
Main Features#
- Static raster plotting via
quickmap/Map, with rich, customizable styling (color scales, color bars, cell-value annotations). - Overlay vector points on raster maps with configurable size, color, and labels.
- Draw a NetCDF variable, choosing which one with
variable=and which slice of a band/time dimension withband=(1-based). - Draw an unstructured UGRID mesh (
pyramids.netcdf.ugrid.MeshDataset) on its own faces — seeMeshSourcefor which backends take one.
Installation#
- pip (PyPI):
- conda (conda-forge):
- pixi (development):
See Installation for the full guide.
Quick start#
from pyramids.dataset import Dataset
from digitalearth import quickmap
dataset = Dataset.read_file("examples/data/acc4000.tif")
m = quickmap(dataset, crs=dataset.epsg)
m.set_title("Flow Accumulation")
A NetCDF holds several variables and a variable may carry a band or time dimension, so both
can be named — variable= picks the field, band= the slice (1-based; without one the first
is drawn and a warning names how many there were):
from pyramids.netcdf import NetCDF
from digitalearth import quickmap
nc = NetCDF.read_file("forecast.nc")
m = quickmap(nc, variable="t2m", band=3)
An unstructured mesh is drawn the same way, shaded face by face:
from pyramids.netcdf.ugrid.dataset import MeshDataset
from digitalearth import quickmap
mesh = MeshDataset.read_file("river_channel_ugrid.nc")
m = quickmap(mesh, variable="bathymetry")
Next steps#
- Read the Plot raster/array guide for the full plotting API.
- Work through the Maps & raster fields example.
