סקירה כללית על מערך
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ב-Earth Engine, וקטורים חד-ממדיים, מטריצות דו-ממדיות, קוביות תלת-ממדיות והיפרקוביות בממדים גבוהים יותר מיוצגים באמצעות הסוג 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 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 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."]]