Przegląd tablicy
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Earth Engine obsługuje wektory jednowymiarowe, macierze dwuwymiarowe, sześciany trójwymiarowe i hipersześciany o większej wymiarowości o typie ee.Array
. Tablice to elastyczna struktura danych, ale w zamian za oferowaną przez nie moc nie skalują się tak dobrze jak inne struktury danych w Earth Engine. Jeśli problem można rozwiązać bez użycia tablic, wynik zostanie obliczony szybciej i skuteczniej. Jeśli jednak problem wymaga modelu o większej wymiarowości, elastycznej algebry liniowej lub czegoś innego, do czego najlepiej nadają się tablice, możesz użyć klasy Array
.
Wymiar, kształt i rozmiar tablicy
Wymiar tablicy odnosi się do liczby osi, wzdłuż których zmieniają się dane. Na przykład tablice 0-wymiarowe to liczby skalarne, 1-wymiarowe to wektory, 2-wymiarowe to macierze, 3-wymiarowe to sześciany, a >3-wymiarowe to hipersześciany. W przypadku tablicy N-wymiarowej jest N osi od 0 do N-1. Kształt tablicy jest określany przez długości osi. Długość osi to liczba pozycji na niej. Rozmiar tablicy, czyli liczba elementów w tablicy, jest równa iloczynowi długości osi. Każda wartość w każdej pozycji na każdej osi musi być prawidłową liczbą, ponieważ obecnie nie są obsługiwane rzadkie ani nieregularne tablice. Typ elementu tablicy wskazuje, jakiego typu są poszczególne elementy. Wszystkie elementy tablicy mają ten sam typ.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 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."]]