数组概览
Earth Engine 使用 ee.Array
类型表示 1 维矢量、2 维矩阵、3 维立方体和更高维的超立方体。数组是一种灵活的数据结构,但与其强大的功能相比,其扩展性不如 Earth Engine 中的其他数据结构。如果问题无需使用数组即可解决,则计算结果的速度会更快,效率也会更高。但是,如果问题需要更高维度的模型、灵活的线性代数或数组特别适合的任何其他内容,您可以使用 Array
类。
数组维度、形状和大小
数组的维度是指底层数据沿着哪些轴变化。例如,0 维数组是标量数,1 维数组是向量,2 维数组是矩阵,3 维数组是立方体,而大于 3 维数组是超立方体。对于 N 维数组,有 N 个轴,从 0 到 N-1。数组的形状由轴的长度决定。轴的长度是沿轴的轴心位置数。数组大小(即数组中的元素总数)等于轴长度的乘积。由于目前不支持稀疏或不规则数组,因此每个轴上的每个位置的每个值都必须是有效数字。数组的元素类型表示每个元素是什么类型的数字;数组的所有元素都将具有相同的类型。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-18。
[null,null,["最后更新时间 (UTC):2025-02-18。"],[[["Earth Engine utilizes the `ee.Array` type to represent vectors, matrices, cubes, and higher-dimensional hypercubes, offering a flexible but potentially less scalable data structure compared to other options."],["The dimension of an array signifies the number of axes, with 0-D representing scalars, 1-D vectors, 2-D matrices, 3-D cubes, and beyond 3-D hypercubes."],["An array's shape is defined by the lengths of its axes, while the total size is the product of these lengths, with each position containing a valid number due to the lack of support for sparse or ragged arrays."]]],[]]