公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Reducer.percentile
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立可計算指定百分位數的縮減器,例如指定 [0、50、100] 會產生名為「p0」、「p50」和「p100」的輸出內容,分別代表最小值、中位數和最大值。如果輸入的資料量較少 (最多 maxRaw),系統會直接計算百分位數;如果輸入的資料量較多,系統則會從直方圖衍生百分位數。
用量 | 傳回 |
---|
ee.Reducer.percentile(percentiles, outputNames, maxBuckets, minBucketWidth, maxRaw) | 縮減函式 |
引數 | 類型 | 詳細資料 |
---|
percentiles | 清單 | 介於 0 到 100 之間的數字清單。 |
outputNames | 清單,預設值為空值 | 輸出內容的名稱清單,或為空值以取得預設名稱。 |
maxBuckets | 整數,預設值為 null | 建構直方圖時使用的最大值範圍數量,會向上取整為 2 的乘方。 |
minBucketWidth | 浮點值,預設值為空值 | 直方圖儲存區寬度下限,或為空值,允許任何 2 的乘冪。 |
maxRaw | 整數,預設值為 null | 建構初始直方圖前要累積的值數量。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eThis reducer calculates specified percentiles (e.g., minimum, median, maximum) from a set of input values.\u003c/p\u003e\n"],["\u003cp\u003eFor smaller datasets, percentiles are computed directly; for larger datasets, a histogram-based approach is used for efficiency.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the percentiles to compute, output band names, and fine-tune the histogram construction parameters.\u003c/p\u003e\n"]]],["The `ee.Reducer.percentile` function computes specified percentiles from a dataset. It accepts a list of `percentiles` (0-100) and optional `outputNames`. For large datasets, it builds a histogram with a `maxBuckets` limit and `minBucketWidth`. For smaller datasets (up to `maxRaw`), it computes percentiles directly. The function returns a Reducer, producing outputs with names like 'p0', 'p50', etc., representing the corresponding percentiles. The user can set custom names or null for defaults.\n"],null,["# ee.Reducer.percentile\n\nCreate a reducer that will compute the specified percentiles, e.g. given \\[0, 50, 100\\] will produce outputs named 'p0', 'p50', and 'p100' with the min, median, and max respectively. For small numbers of inputs (up to maxRaw) the percentiles will be computed directly; for larger numbers of inputs the percentiles will be derived from a histogram.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------------------------------------------------------------------------|---------|\n| `ee.Reducer.percentile(percentiles, `*outputNames* `, `*maxBuckets* `, `*minBucketWidth* `, `*maxRaw*`)` | Reducer |\n\n| Argument | Type | Details |\n|------------------|------------------------|-----------------------------------------------------------------------------------------------------|\n| `percentiles` | List | A list of numbers between 0 and 100. |\n| `outputNames` | List, default: null | A list of names for the outputs, or null to get default names. |\n| `maxBuckets` | Integer, default: null | The maximum number of buckets to use when building a histogram; will be rounded up to a power of 2. |\n| `minBucketWidth` | Float, default: null | The minimum histogram bucket width, or null to allow any power of 2. |\n| `maxRaw` | Integer, default: null | The number of values to accumulate before building the initial histogram. |"]]