公告 :凡是在
2025 年 4 月 15 日前 註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格 ,才能繼續存取。如未在 2025 年 9 月 26 日前完成驗證,存取權可能會暫停。
提供意見
ee.FeatureCollection.kriging
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回每個像素的 Kriging 估算器取樣結果。
用量 傳回 FeatureCollection. kriging (propertyName, shape, range, sill, nugget, maxDistance , reducer )
圖片
引數 類型 詳細資料 這個:collection
FeatureCollection 做為估算來源資料的地圖項目集合。 propertyName
字串 要估算的屬性 (必須是數值)。 shape
字串 半變異函數形狀 (其中一種:{exponential、gaussian、spherical})。 range
浮點值 半變異函數範圍 (以公尺為單位)。 sill
浮點值 半變異函數變異數。 nugget
浮點值 半變異函數塊金。 maxDistance
浮點值,預設值為空值 決定每個像素計算中包含哪些特徵的半徑 (以公尺為單位)。預設為半變異函數的範圍。 reducer
Reducer,預設值:null Reducer,用於將重疊點的「propertyName」值摺疊為單一值。
範例
程式碼編輯器 (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.
var img = ee . Image ( 'ECMWF/ERA5/MONTHLY/202006' )
. select ([ 'mean_2m_air_temperature' ], [ 'tmean' ]);
// Region of interest: South Pacific Ocean.
var roi = 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.
var tmeanFc = 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.
var tmeanImg = 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 設定
請參閱
Python 環境 頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
import ee
import geemap.core as geemap
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
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
想進一步說明嗎?
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[],["The `kriging` method interpolates a surface from a `FeatureCollection` by sampling a Kriging estimator at each pixel, returning an `Image`. Key parameters include: `propertyName` (numeric property to estimate), `shape` (semivariogram shape), `range`, `sill`, and `nugget` (semivariogram values). `maxDistance` limits feature inclusion in pixel calculations. An optional `reducer` handles overlapping points. Example demonstrates creating a temperature surface from sampled points, setting Kriging parameters, and visualizing the result.\n"]]