Skip to content

Documentation Python Versions License: GPL v3 pre-commit PyPI version

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 with band= (1-based).
  • Draw an unstructured UGRID mesh (pyramids.netcdf.ugrid.MeshDataset) on its own faces — see MeshSource for which backends take one.

Installation#

  • pip (PyPI):
pip install digitalearth
  • conda (conda-forge):
conda install -c conda-forge digitalearth
  • pixi (development):
pixi add digitalearth

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#