公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Array.ceil
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
以元素为单位,计算大于或等于输入的最小整数。
示例
代码编辑器 (JavaScript)
// Requires an explicit PixelType if no data.
print(ee.Array([], ee.PixelType.int8()).ceil()); // []
print(ee.Array([-1.1]).ceil()); // [-1]
print(ee.Array([-0.1]).ceil()); // [0]
print(ee.Array([0]).ceil()); // [0]
print(ee.Array([0.1]).ceil()); // [1]
print(ee.Array([1.1]).ceil()); // [2]
Python 设置
如需了解 Python API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
# Requires an explicit PixelType if no data.
display(ee.Array([], ee.PixelType.int8()).ceil()) # []
display(ee.Array([-1.1]).ceil()) # [-1]
display(ee.Array([-0.1]).ceil()) # [0]
display(ee.Array([0]).ceil()) # [0]
display(ee.Array([0.1]).ceil()) # [1]
display(ee.Array([1.1]).ceil()) # [2]
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eArray.ceil()\u003c/code\u003e computes the smallest integer greater than or equal to each element in the input array.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a new array with the ceiling values of the original elements.\u003c/p\u003e\n"],["\u003cp\u003eIt operates on an element-wise basis, meaning it applies the ceiling operation to each individual element of the input array.\u003c/p\u003e\n"],["\u003cp\u003eIf the input is an empty array, it returns an empty array.\u003c/p\u003e\n"]]],["The `ceil()` method computes the ceiling of each element in an input array, returning a new array. The function determines the smallest integer greater than or equal to each input element. It operates element-wise. If the input array is empty, an explicit PixelType is required. The input array can contain positive and negative numbers, as shown with the provided examples. `Array.ceil()` method returns a new Array.\n"],null,["# ee.Array.ceil\n\nOn an element-wise basis, computes the smallest integer greater than or equal to the input.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------|---------|\n| Array.ceil`()` | Array |\n\n| Argument | Type | Details |\n|---------------|-------|------------------|\n| this: `input` | Array | The input array. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Requires an explicit PixelType if no data.\nprint(ee.Array([], ee.PixelType.int8()).ceil()); // []\n\nprint(ee.Array([-1.1]).ceil()); // [-1]\nprint(ee.Array([-0.1]).ceil()); // [0]\nprint(ee.Array([0]).ceil()); // [0]\nprint(ee.Array([0.1]).ceil()); // [1]\nprint(ee.Array([1.1]).ceil()); // [2]\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\n# Requires an explicit PixelType if no data.\ndisplay(ee.Array([], ee.PixelType.int8()).ceil()) # []\n\ndisplay(ee.Array([-1.1]).ceil()) # [-1]\ndisplay(ee.Array([-0.1]).ceil()) # [0]\ndisplay(ee.Array([0]).ceil()) # [0]\ndisplay(ee.Array([0.1]).ceil()) # [1]\ndisplay(ee.Array([1.1]).ceil()) # [2]\n```"]]