| Name | Downloads | Version | Platforms |
|---|---|---|---|
geostatista is the geostatistics tier of the serapeum stack: variograms, kriging, and spatial autocorrelation, built on top of pyramids and its GDAL stack. Input is scattered point observations; output is a continuous surface plus an uncertainty estimate, or per-feature autocorrelation statistics.
- Variograms — empirical variogram clouds (Matheron / Cressie estimators) and
fitted theoretical models (
spherical,exponential,gaussian,matern, pluspower/nuggetfunctions). - Ordinary kriging — from a fitted variogram onto a regular grid, returning a
2-band
KrigedSurface(band 0 = estimate, band 1 = kriging variance) with acKDTreemoving neighborhood for large sample sets. - Validation — leave-one-out cross-validation with ME / RMSE / standardized-error diagnostics.
- Spatial autocorrelation — a sparse
Weightsmatrix (queen / rook contiguity, k-nearest, distance-band) feeding global (Moran's I, Geary's C) and local (Local Moran / LISA, Getis-Ord Gi*) statistics, with one-callspatial_autocorrelation/hotspotsfacades. - Plotting — variogram, LISA-cluster, and hotspot maps through
cleopatra (the
vizextra).
Everything hangs off Samples, a FeatureCollection subclass, so a column name is
always a method argument. See ADR 0001
for the pyramids ↔ geostatista boundary (pyramids keeps IDW and the free gdal.Grid
algorithms; geostatista owns every variogram and kriging variant).
conda install -c conda-forge geostatistaList the versions available on your platform with:
conda search geostatista --channel conda-forgepip install geostatistapip install git+https://github.com/serapeum-org/geostatistaKrige scattered point observations onto a grid, with an uncertainty band:
from geostatista import Samples
samples = Samples.read_file("rain_gauges.geojson") # a Samples is-a FeatureCollection
vg = samples.variogram("rain").fit(model="spherical") # explore + fit spatial structure
surface = samples.krige("rain", vg, cell_size=1000) # 2-band KrigedSurface (estimate + variance)
surface.to_file("rain.tif") # self-describing GeoTIFF (GS_* tags)
cv = samples.cross_validate("rain", vg) # leave-one-out diagnostics
print(cv.attrs["summary"]) # ME, RMSE, standardized error, correlationMeasure and map spatial autocorrelation over polygon features:
from geostatista import Weights, morans_i, local_morans
w = Weights.queen(tracts) # queen-contiguity weights
morans_i(tracts, "income", w) # global Moran's I (I, EI, z, p)
lisa = local_morans(tracts, "income", w) # per-feature LISA clusters (HH / LL / HL / LH / ns)See the documentation for the full guide.
