stilt.Zones#

class stilt.Zones(*, base: stilt.config.spatial.Grid | stilt.geometry.Mesh, labels: tuple[str, ...]) → None[source]#

Super-cells: labels that merge the cells of a Grid or Mesh.

Parameters

baseGrid | Mesh

The geometry being merged.

labelssequence of str

One label per base cell, in base.index order. Cells sharing a label form one super-cell; the state index lists labels in order of first appearance.

Methods#

from_labels(base, labels)

Build from any label sequence (values are stringified).

Attributes#

bounds

Envelope of the base geometry.

crs

CRS of the base geometry.

hash

10-char SHA-256 of the base geometry and the labels.

index

Unique labels in order of first appearance, named "cell".

is_longlat

True when the base geometry is lon/lat.

membership

(n_groups, n_base) indicator matrix mapping base cells to labels.

min_cell_width

Smallest base cell width (super-cells are never smaller).

base

labels