geoutils.operators.interpolator.Kriging

geoutils.operators.interpolator.Kriging#

class geoutils.operators.interpolator.Kriging(model, *, backend='gstools', neighborhood=None, max_overlap=None, exact=True, pseudo_inverse=True, cache_size=256)[source]#

The Kriging interpolator predicts values from nearby observations and their spatial correlation.

Pass a fitted variogram to describe how correlation changes with distance, then use this interpolator in Raster.interp_points() or PointCloud.grid(). The backend selects GSTools or GPyTorch for ordinary kriging; neighborhood and max_overlap control which nearby values are used.

We reuse weights when points have the same positions relative to the requested coordinate (common in rasters). coefficients() returns those weights, and kriging_variance() gives the prediction variance from the model.

Parameters:
  • model (Variogram | VariogramModel) – Fitted GeoUtils variogram or its VariogramModel representation.

  • backend (Literal['gstools', 'gpytorch']) – Library used to solve the kriging system, "gstools" or "gpytorch".

  • neighborhood (PointNeighbours | GridNeighbours | None) – Points or raster cells considered for each prediction. By default, select points/cells within the model’s longest effective range (the distance over which its values are correlated).

  • max_overlap (float | None) – Optional distance limit for the effective range and the extra data read around chunk edges.

  • exact (bool) – Include the nugget when predicting at a known source location.

  • pseudo_inverse (bool) – Let GSTools use a pseudo inverse for redundant or coincident observations.

  • cache_size (int) – Maximum number of arrangements of nearby points for which calculated weights are stored.

__init__(model, *, backend='gstools', neighborhood=None, max_overlap=None, exact=True, pseudo_inverse=True, cache_size=256)[source]#

Check the covariance model, search radius, selected library, and cache size.

Methods

__init__(model, *[, backend, neighborhood, ...])

Check the covariance model, search radius, selected library, and cache size.

coefficients(data)

Return ordinary kriging weights in the same order as the supplied source values.

evaluate(data, *[, nodata_propagation])

Check nodata and weights before predicting a value.

kriging_variance(data)

Return the model interpolation variance for the same source points used by coefficients().

predict(data)

Predict a value from the nearby source observations.

predict_batch(data, *[, nodata_propagation])

Predict several values by calling evaluate() for each group of source observations.

validate_geospatial_support(coordinate_count)

Check that the variogram uses all coordinates included in the neighbour search.

Attributes

accepts_sample_weights

default_neighborhood

default_nodata_propagation

error_structure

interpolation_order

minimum_inputs