Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses Earth Engine.
Ringkasan Array
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Earth Engine merepresentasikan vektor 1-D, matriks 2-D, kubus 3-D, dan hiperkubus berdimensi lebih tinggi dengan jenis ee.Array
. Array adalah struktur data yang fleksibel, tetapi sebagai ganti dari kemampuan yang ditawarkannya, array tidak diskalakan sebaik struktur data lainnya di Earth Engine. Jika masalah dapat diselesaikan tanpa menggunakan array, hasilnya akan
dihitung lebih cepat dan lebih efisien. Namun, jika masalah memerlukan model dimensi yang lebih tinggi,
aljabar linear yang fleksibel, atau array apa pun yang cocok secara unik, Anda dapat menggunakan
class Array
.
Dimensi, bentuk, dan ukuran array
Dimensi array mengacu pada jumlah sumbu yang menjadi dasar bervariasinya data. Misalnya, array 0-D adalah angka skalar, array 1-D adalah vektor, array 2-D adalah matriks, array 3-D adalah kubus, dan array >3-D adalah hiperkubus. Untuk array
N-dimensi, ada N sumbu dari 0 hingga N-1. Bentuk array ditentukan oleh panjang sumbu. Panjang sumbu adalah jumlah posisi sepanjang sumbu. Ukuran array, atau jumlah total elemen dalam array, sama dengan produk
panjang sumbu. Setiap nilai di setiap posisi pada setiap sumbu harus memiliki angka yang valid,
karena array jarang atau tidak beraturan saat ini tidak didukung. Jenis elemen array
menunjukkan jenis angka setiap elemen; semua elemen array akan memiliki
jenis yang sama.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-25 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-25 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."]]