نمای کلی آرایه
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Earth Engine بردارهای 1 بعدی، ماتریس های 2 بعدی، مکعب های 3 بعدی و ابرمکعب های ابعاد بالاتر را با نوع ee.Array
نشان می دهد. آرایهها یک ساختار داده انعطافپذیر هستند، اما در ازای قدرتی که ارائه میکنند، به اندازه سایر ساختارهای داده در Earth Engine مقیاس نمیشوند. اگر بتوان مشکل را بدون استفاده از آرایه ها حل کرد، نتیجه سریعتر و کارآمدتر محاسبه می شود. اما اگر مشکل نیاز به مدل ابعاد بالاتر، جبر خطی منعطف، یا هر چیز دیگری دارد که آرایهها به طور منحصر به فرد مناسب هستند، میتوانید از کلاس Array
استفاده کنید.
ابعاد آرایه، شکل و اندازه
بعد یک آرایه به تعداد محورهایی اشاره دارد که داده های اساسی در امتداد آنها تغییر می کند. به عنوان مثال، آرایه های 0-D اعداد اسکالر هستند، آرایه های 1-D بردار هستند، آرایه های 2-D ماتریس هستند، آرایه های 3-D مکعب هستند و آرایه های 3-D> بیش از حد مکعب هستند. برای یک آرایه N بعدی، N محور از 0 تا N-1 وجود دارد. شکل آرایه با طول محورها تعیین می شود. طول یک محور، تعداد موقعیت های موجود در طول آن است. اندازه آرایه یا تعداد کل عناصر در آرایه برابر است با حاصل ضرب طول محور. هر مقدار در هر موقعیت در هر محور باید یک عدد معتبر داشته باشد، زیرا آرایههای پراکنده یا ناهموار در حال حاضر پشتیبانی نمیشوند. نوع عنصر آرایه نشان می دهد که هر عنصر چه نوع عددی است. تمام عناصر آرایه یک نوع خواهند داشت.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]