Pengumuman : Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses. Jika Anda belum melakukan verifikasi hingga 26 September 2025, akses Anda mungkin ditangguhkan.
Kirim masukan
ee.ImageCollection.getArray
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengekstrak properti dari fitur.
Penggunaan Hasil ImageCollection. getArray (property)
Array
Argumen Jenis Detail ini: object
Elemen Fitur untuk mengekstrak properti. property
String Properti yang akan diekstrak.
Contoh
Code Editor (JavaScript)
// A contrived, empty image collection for simple demonstration.
var col = ee . ImageCollection ([]);
print ( 'Collection without properties' , col );
// Set collection properties using a dictionary.
col = col . set ({
project_name : 'biomass_tracking' ,
project_id : 3 ,
plot_ids : ee . Array ([ 7 , 11 , 20 ])
});
// Set collection properties using a series of key-value pairs.
col = col . set ( 'project_year' , 2018 ,
'rgb_vis' , 'false_color' );
print ( 'Collection with properties' , col );
// Get a dictionary of collection property keys and values.
print ( 'Property keys and values (ee.Dictionary)' , col . toDictionary ());
// Get the value of a collection property. To use the result of
// ee.ImageCollection.get in further computation, you need to cast it to the
// appropriate class, for example, ee.Number(result) or ee.String(result).
print ( 'Project ID (ambiguous object)' , col . get ( 'project_id' ));
// Get the value of a string collection property as an ee.String object.
print ( 'Project name (ee.String)' , col . getString ( 'project_name' ));
// Get the value of a numeric collection property as an ee.Number object.
print ( 'Project year (ee.Number)' , col . getNumber ( 'project_year' ));
// Get the value of an ee.Array collection property as an ee.Array object.
print ( 'Plot IDs (ee.Array)' , col . getArray ( 'plot_ids' ));
Penyiapan Python
Lihat halaman
Lingkungan Python untuk mengetahui informasi tentang Python API dan penggunaan
geemap
untuk pengembangan interaktif.
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
# A contrived, empty image collection for simple demonstration.
col = ee . ImageCollection ([])
print ( 'Collection without properties:' )
pprint ( col . getInfo ())
# Set collection properties using a dictionary.
col = col . set ({
'project_name' : 'biomass_tracking' ,
'project_id' : 3 ,
'plot_ids' : ee . Array ([ 7 , 11 , 20 ])
})
# Set collection properties using a series of key-value pairs.
col = col . set ( 'project_year' , 2018 ,
'rgb_vis' , 'false_color' )
print ( 'Collection with properties:' )
pprint ( col . getInfo ())
# Get a dictionary of collection property keys and values.
print ( 'Property keys and values (ee.Dictionary):' )
pprint ( col . toDictionary () . getInfo ())
# Get the value of a collection property. To use the result of
# ee.ImageCollection.get in further computation, you need to cast it to the
# appropriate class, for example, ee.Number(result) or ee.String(result).
print ( 'Project ID (ambiguous object):' , col . get ( 'project_id' ) . getInfo ())
# Get the value of a string collection property as an ee.String object.
print ( 'Project name (ee.String):' , col . getString ( 'project_name' ) . getInfo ())
# Get the value of a numeric collection property as an ee.Number object.
print ( 'Project year (ee.Number):' , col . getNumber ( 'project_year' ) . getInfo ())
# Get the value of an ee.Array collection property as an ee.Array object.
print ( 'Plot IDs (ee.Array):' , col . getArray ( 'plot_ids' ) . getInfo ())
Kirim masukan
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0 , sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0 . Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers . Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
Ada masukan untuk kami?
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-26 UTC."],[],[]]