Duyuru :
15 Nisan 2025 'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin erişimlerini sürdürebilmeleri için
ticari olmayan uygunluklarını doğrulamaları gerekir. 26 Eylül 2025'e kadar doğrulama yapmazsanız erişiminiz bekletilebilir.
Geri bildirim gönderin
ee.Image.arrayGet
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Her bant için, giriş çok boyutlu pikselinden o banttaki belirli konumdaki değerin çıkarılmasıyla aynı ada sahip bir çıkış bandı oluşturulur.
Kullanım İadeler Image. arrayGet (position)
Resim
Bağımsız Değişken Tür Ayrıntılar bu: image
Resim Öğenin alınacağı dizi. position
Resim Alınacak öğenin koordinatları. Giriş resminde boyut sayısı kadar skaler bant olmalıdır.
Örnekler
Kod Düzenleyici (JavaScript)
// A function to print the array 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' );
}
// Create a 1D array image.
var arrayImg1D = ee . Image ([ 0 , 1 , 2 , 3 , 4 , 5 ]). toArray ();
print ( '1D array image (pixel)' , sampArrImg ( arrayImg1D ));
// [0, 1, 2, 3, 4, 5]
// Get the array value at a given position. Here we target the 4th element.
var position1D = ee . Image ([ 3 ]);
var selectedElement1D = arrayImg1D . arrayGet ( position1D );
print ( 'Element at position [3] (4th element)' , sampArrImg ( selectedElement1D ));
// [3]
// Create a 2D 2x3 array image (reshape the 1D array image).
var arrayImg2D = arrayImg1D . arrayReshape ( ee . Image ([ 2 , 3 ]). toArray (), 2 );
print ( '2D 2x3 array image (pixel)' , sampArrImg ( arrayImg2D ));
// [[0, 1, 2],
// [3, 4, 5]]
// Get the array element value at axis-0, position 0 and axis-1, position 2.
var position2D = ee . Image ([ 0 , 2 ]);
var selectedElement2D = arrayImg2D . arrayGet ( position2D );
print ( 'Element at position [0, 2]' , sampArrImg ( selectedElement2D ));
// 2
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
import ee
import geemap.core as geemap
Colab (Python)
# A function to print the array 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' )
# Create a 1D array image.
array_img_1d = ee . Image ([ 0 , 1 , 2 , 3 , 4 , 5 ]) . toArray ()
print ( '1D array image (pixel):' , samp_arr_img ( array_img_1d ) . getInfo ())
# [0, 1, 2, 3, 4, 5]
# Get the array value at a given position. Here we target the 4th element.
position_1d = ee . Image ([ 3 ])
selected_element_1d = array_img_1d . arrayGet ( position_1d )
print (
'Element at position [3] (4th element):' ,
samp_arr_img ( selected_element_1d ) . getInfo ()
)
# [3]
# Create a 2D 2x3 array image (reshape the 1D array image).
array_img_2d = array_img_1d . arrayReshape ( ee . Image ([ 2 , 3 ]) . toArray (), 2 )
print ( '2D 2x3 array image (pixel):' , samp_arr_img ( array_img_2d ) . getInfo ())
# [[0, 1, 2],
# [3, 4, 5]]
# Get the array element value at axis-0, position 0 and axis-1, position 2.
position_2d = ee . Image ([ 0 , 2 ])
selected_element_2d = array_img_2d . arrayGet ( position_2d )
print (
'Element at position [0, 2]:' ,
samp_arr_img ( selected_element_2d ) . getInfo ()
)
# 2
Geri bildirim gönderin
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları 'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
Bize geri bildirimde bulunmak mı istiyorsunuz?
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-26 UTC."],[],[]]