Wprowadzamy w Earth Engine
poziomy limitów niekomercyjnych, aby chronić współdzielone zasoby obliczeniowe i zapewnić niezawodną wydajność dla wszystkich. We wszystkich projektach niekomercyjnych trzeba będzie wybrać poziom limitu do
27 kwietnia 2026 r.. W przeciwnym razie zostanie im przydzielony poziom Społeczność. Limity poziomu zaczną obowiązywać we wszystkich projektach (niezależnie od daty wyboru poziomu) od
27 kwietnia 2026 r. Więcej informacji
ee.Image.arrayDotProduct
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Oblicza iloczyn skalarny każdej pary tablic 1D w pasmach obrazów wejściowych.
| Wykorzystanie | Zwroty |
|---|
Image.arrayDotProduct(image2) | Obraz |
| Argument | Typ | Szczegóły |
|---|
to: image1 | Obraz | Pierwszy obraz tablicy wektorów 1-D. |
image2 | Obraz | Drugi obraz tablicy wektorów 1D. |
Przykłady
Edytor kodu (JavaScript)
// A function to print arrays for a selected pixel in the following examples.
function sampArrImg(arrImg) {
var point = ee.Geometry.Point([-121, 42]);
return arrImg.sample(point, 500).first().get('array');
}
// A 1D array image.
var arrayImg1Da = ee.Image([0, 1, 2]).toArray();
print('1D array image A (pixel)', sampArrImg(arrayImg1Da));
// [0, 1, 2]
// A second 1D array image of the same length.
var arrayImg1Db = ee.Image([3, 4, 5]).toArray();
print('1D array image B (pixel)', sampArrImg(arrayImg1Db));
// [3, 4, 5]
// Calculate the dot product for the two 1D arrays.
var test = arrayImg1Da.arrayDotProduct(arrayImg1Db);
print('A⋅B = 0(3) + 1(4) + 2(5) = ', sampArrImg(test));
// 14
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap do interaktywnego programowania znajdziesz na stronie
Środowisko Python.
import ee
import geemap.core as geemap
Colab (Python)
# A function to print arrays for a selected pixel in the following examples.
def samp_arr_img(arr_img):
point = ee.Geometry.Point([-121, 42])
return arr_img.sample(point, 500).first().get('array')
# A 1D array image.
array_img_1d_a = ee.Image([0, 1, 2]).toArray()
display('1D array image A (pixel):', samp_arr_img(array_img_1d_a))
# [0, 1, 2]
# A second 1D array image of the same length.
array_img_1d_b = ee.Image([3, 4, 5]).toArray()
display('1D array image B (pixel):', samp_arr_img(array_img_1d_b))
# [3, 4, 5]
# Calculate the dot product for the two 1D arrays.
test = array_img_1d_a.arrayDotProduct(array_img_1d_b)
display('A⋅B = 0(3) + 1(4) + 2(5) = ', samp_arr_img(test))
# 14
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-10-30 UTC.
[null,null,["Ostatnia aktualizacja: 2025-10-30 UTC."],[],["The `arrayDotProduct` function computes the dot product between two 1-D array images. It takes two image arguments, `image1` and `image2`, representing the first and second array images respectively. The dot product is calculated for each corresponding pair of 1-D arrays in the images' bands. The result is an `Image` representing the dot product. The example illustrates this using arrays [0, 1, 2] and [3, 4, 5], yielding a dot product of 14.\n"]]