Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
Обзор массива
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Earth Engine представляет одномерные векторы, двумерные матрицы, трехмерные кубы и гиперкубы более высокой размерности с типом ee.Array
. Массивы представляют собой гибкую структуру данных, но в обмен на предоставляемые ими возможности они не масштабируются так же хорошо, как другие структуры данных в Earth Engine. Если задачу можно решить без использования массивов, результат будет вычислен быстрее и эффективнее. Но если задача требует модели более высокой размерности, гибкой линейной алгебры или чего-то еще, для чего массивы однозначно подходят, вы можете использовать класс Array
.
Размерность, форма и размер массива
Размерность массива обозначает количество осей, по которым изменяются базовые данные. Например, 0-D массивы представляют собой скалярные числа, 1-D массивы — это векторы, 2-D массивы — это матрицы, 3-D массивы — это кубы, а >3-D массивы — это гиперкубы. Для N-мерного массива имеется N осей от 0 до N-1. Форма массива определяется длинами осей. Длина оси — это количество позиций вдоль нее. Размер массива или общее количество элементов в массиве равно произведению длин осей. Каждое значение в каждой позиции на каждой оси должно иметь допустимый номер, поскольку разреженные или неровные массивы в настоящее время не поддерживаются. Тип элемента массива указывает, какое число имеет каждый элемент; все элементы массива будут иметь один и тот же тип.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eEarth Engine utilizes the \u003ccode\u003eee.Array\u003c/code\u003e type to represent vectors, matrices, cubes, and higher-dimensional hypercubes, offering a flexible but potentially less scalable data structure compared to other options.\u003c/p\u003e\n"],["\u003cp\u003eThe 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.\u003c/p\u003e\n"],["\u003cp\u003eAn 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.\u003c/p\u003e\n"]]],[],null,["Earth Engine represents 1-D vectors, 2-D matrices, 3-D cubes, and higher dimensional\nhypercubes with the `ee.Array` type. Arrays are a flexible data structure, but\nin exchange for the power they offer, they do not scale as well as other data structures\nin Earth Engine. If the problem can be solved without using arrays, the result will be\ncomputed faster and more efficiently. But if the problem requires a higher dimension model,\nflexible linear algebra, or anything else arrays are uniquely suited to, you can use\nthe `Array` class.\n\nArray dimension, shape and size\n\nThe dimension of an array refers to the number of axes along which the underlying data\nvaries. For example, 0-D arrays are scalar numbers, 1-D arrays are vectors, 2-D arrays\nare matrices, 3-D arrays are cubes, and \\\u003e3-D arrays are hyper-cubes. For an\nN-dimensional array, there are N axes from 0 to N-1. The shape of the array is\ndetermined by the lengths of the axes. The length of an axis is the number of positions\nalong it. The array size, or number of total elements in the array, equals the product\nof the axis lengths. Each value at every position on every axis must have a valid number,\nsince sparse or ragged arrays are not currently supported. The array's element type\nindicates what kind of number each element is; all elements of the array will have the\nsame type."]]