stilt.Zones#

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

Regions made by merging the cells of a Grid or Mesh.

Parameters

baseGrid or Mesh

Geometry whose cells are merged.

labelssequence of str

One label per cell of base, in base.index order. Cells with the same label form one region. The index lists the labels in order of first appearance.

Methods#

from_labels(base, labels)

Return zones from labels of any type, converted to strings.

Attributes#

bounds

(xmin, ymin, xmax, ymax) extent of the base geometry.

crs

CRS of the base geometry.

hash

First 10 characters of a SHA-256 hash of the base geometry and labels.

index

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

is_longlat

Whether the base geometry is in longitude/latitude degrees.

membership

Sparse (n_regions, n_base_cells) matrix, 1 where a base cell is in a region.

min_cell_width

Smallest cell width of the base geometry, since no region is smaller.

base

labels