Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.FeatureCollection.kriging

  • Thekriging method on aFeatureCollection returns anImage representing the results of sampling a Kriging estimator at each pixel.

  • The method requires specifying thepropertyName to be estimated, the semivariogramshape,range,sill, andnugget.

  • Optional arguments includemaxDistance andreducer to control the inclusion of features and collapsing of overlapping points.

  • Examples demonstrate usingkriging to generate an interpolated surface of air temperature from sampled points in both JavaScript and Python.

Returns the results of sampling a Kriging estimator at each pixel.

UsageReturns
FeatureCollection.kriging(propertyName, shape, range, sill, nugget,maxDistance,reducer)Image
ArgumentTypeDetails
this:collectionFeatureCollectionFeature collection to use as source data for the estimation.
propertyNameStringProperty to be estimated (must be numeric).
shapeStringSemivariogram shape (one of {exponential, gaussian, spherical}).
rangeFloatSemivariogram range, in meters.
sillFloatSemivariogram sill.
nuggetFloatSemivariogram nugget.
maxDistanceFloat, default: nullRadius which determines which features are included in each pixel's computation, in meters. Defaults to the semivariogram's range.
reducerReducer, default: nullReducer used to collapse the 'propertyName' value of overlapping points into a single value.

Examples

Code Editor (JavaScript)

/** * This example generates an interpolated surface using kriging from a * FeatureCollection of random points that simulates a table of air temperature * at ocean weather buoys. */// Average air temperature at 2m height for June, 2020.varimg=ee.Image('ECMWF/ERA5/MONTHLY/202006').select(['mean_2m_air_temperature'],['tmean']);// Region of interest: South Pacific Ocean.varroi=ee.Geometry.Polygon([[[-156.053,-16.240],[-156.053,-44.968],[-118.633,-44.968],[-118.633,-16.240]]],null,false);// Sample the mean June 2020 temperature surface at random points in the ROI.vartmeanFc=img.sample({region:roi,scale:25000,numPixels:50,geometries:true});// 250// Generate an interpolated surface from the points using kriging; parameters// are set according to interpretation of an unshown semivariogram. See section// 2.1 of https://doi.org/10.14214/sf.369 for information on semivariograms.vartmeanImg=tmeanFc.kriging({propertyName:'tmean',shape:'gaussian',range:2.8e6,sill:164,nugget:0.05,maxDistance:1.8e6,reducer:ee.Reducer.mean()});// Display the results on the map.Map.setCenter(-137.47,-30.47,3);Map.addLayer(tmeanImg,{min:279,max:300},'Temperature (K)');

Python setup

See the Python Environment page for information on the Python API and usinggeemap for interactive development.

importeeimportgeemap.coreasgeemap

Colab (Python)

# This example generates an interpolated surface using kriging from a# FeatureCollection of random points that simulates a table of air temperature# at ocean weather buoys.# Average air temperature at 2m height for June, 2020.img=ee.Image('ECMWF/ERA5/MONTHLY/202006').select(['mean_2m_air_temperature'],['tmean'])# Region of interest: South Pacific Ocean.roi=ee.Geometry.Polygon([[[-156.053,-16.240],[-156.053,-44.968],[-118.633,-44.968],[-118.633,-16.240],]],None,False,)# Sample the mean June 2020 temperature surface at random points in the ROI.tmean_fc=img.sample(region=roi,scale=25000,numPixels=50,geometries=True)# Generate an interpolated surface from the points using kriging parameters# are set according to interpretation of an unshown semivariogram. See section# 2.1 of https://doi.org/10.14214/sf.369 for information on semivariograms.tmean_img=tmean_fc.kriging(propertyName='tmean',shape='gaussian',range=2.8e6,sill=164,nugget=0.05,maxDistance=1.8e6,reducer=ee.Reducer.mean(),)# Display the results on the map.m=geemap.Map()m.set_center(-137.47,-30.47,3)m.add_layer(tmean_img,{'min':279,'max':300,'min':279,'max':300},'Temperature (K)',)m

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-10-06 UTC.