ee.Array.max
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เลือกค่าสูงสุดของค่าแรกและค่าที่สองทีละรายการ
การใช้งาน | การคืนสินค้า |
---|
Array.max(right) | อาร์เรย์ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ left | อาร์เรย์ | ค่าด้านซ้าย |
right | อาร์เรย์ | ค่าทางด้านขวา |
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
var empty = ee.Array([], ee.PixelType.int8());
print(empty.max(empty)); // []
var array1 = ee.Array([0, -3, 5, 3]);
var array2 = ee.Array([0, -1, 2, 4]);
print(array1.max(array2)); // [0,-1,5,4]
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
empty = ee.Array([], ee.PixelType.int8())
display(empty.max(empty)) # []
array1 = ee.Array([0, -3, 5, 3])
array2 = ee.Array([0, -1, 2, 4])
display(array1.max(array2)) # [0, -1, 5, 4]
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eArray.max()\u003c/code\u003e is an element-wise function that returns an array containing the maximum values between two input arrays.\u003c/p\u003e\n"],["\u003cp\u003eThe function compares corresponding elements in the 'left' (this) and 'right' input arrays.\u003c/p\u003e\n"],["\u003cp\u003eIf both input arrays are empty, an empty array is returned.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting array has the same dimensions as the input arrays, with each element representing the maximum between corresponding elements of the inputs.\u003c/p\u003e\n"]]],["The `Array.max(right)` function compares two arrays (`left` and `right`) element-wise. For each corresponding pair of elements, it selects the maximum value. It returns a new array containing these maximum values. Both input arrays must be of the same length. Example show that using this method with `[0, -3, 5, 3]` and `[0, -1, 2, 4]` will result in `[0, -1, 5, 4]` . An empty array compared to an empty array will also result in an empty array.\n"],null,["# ee.Array.max\n\nOn an element-wise basis, selects the maximum of the first and second values.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------|---------|\n| Array.max`(right)` | Array |\n\n| Argument | Type | Details |\n|--------------|-------|-----------------------|\n| this: `left` | Array | The left-hand value. |\n| `right` | Array | The right-hand value. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nvar empty = ee.Array([], ee.PixelType.int8());\nprint(empty.max(empty)); // []\n\nvar array1 = ee.Array([0, -3, 5, 3]);\nvar array2 = ee.Array([0, -1, 2, 4]);\nprint(array1.max(array2)); // [0,-1,5,4]\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nempty = ee.Array([], ee.PixelType.int8())\ndisplay(empty.max(empty)) # []\n\narray1 = ee.Array([0, -3, 5, 3])\narray2 = ee.Array([0, -1, 2, 4])\ndisplay(array1.max(array2)) # [0, -1, 5, 4]\n```"]]