公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Array.sort
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
沿一个轴对数组的元素进行排序。
参数 | 类型 | 详细信息 |
---|
此:array | 数组 | 要排序的数组映像。 |
keys | 数组,默认值:null | 用于排序的可选键。如果未提供,则这些值将用作键。键只能在一个轴上具有多个元素,这决定了排序方向。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003esort\u003c/code\u003e method arranges elements within an array along a single axis.\u003c/p\u003e\n"],["\u003cp\u003eBy default, \u003ccode\u003esort\u003c/code\u003e uses the array values for sorting; however, optional \u003ccode\u003ekeys\u003c/code\u003e can be specified for customized sorting based on another array with matching dimensions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekeys\u003c/code\u003e array must have multiple elements along only one axis to determine the sort direction.\u003c/p\u003e\n"],["\u003cp\u003eThe modified array, with elements sorted according to the specified logic, is returned by the \u003ccode\u003esort\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# ee.Array.sort\n\nSorts elements of the array along one axis.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------|---------|\n| Array.sort`(`*keys*`)` | Array |\n\n| Argument | Type | Details |\n|---------------|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `array` | Array | Array image to sort. |\n| `keys` | Array, default: null | Optional keys to sort by. If not provided, the values are used as the keys. The keys can only have multiple elements along one axis, which determines the direction to sort in. |"]]