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.FeatureCollection.merge
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
İki koleksiyonu tek bir koleksiyonda birleştirir. Sonuç, her iki koleksiyonda bulunan tüm öğeleri içerir.
İlk koleksiyondaki öğelerin kimliklerinin önüne "1", ikinci koleksiyondaki öğelerin kimliklerinin önüne ise "2 " eklenir.
Not: Birçok koleksiyonun birleştirilmesi gerekiyorsa bunların hepsini bir koleksiyona yerleştirip bunun yerine FeatureCollection.flatten() kullanabilirsiniz. FeatureCollection.merge() işlevinin tekrar tekrar kullanılması, öğe kimliklerinin giderek uzamasına ve performansın düşmesine neden olur.
Kullanım İadeler FeatureCollection. merge (collection2)
FeatureCollection
Bağımsız Değişken Tür Ayrıntılar bu: collection1
FeatureCollection Birleştirilecek ilk koleksiyon. collection2
FeatureCollection Birleştirilecek ikinci koleksiyon.
Örnekler
Kod Düzenleyici (JavaScript)
// FeatureCollection of points representing forest cover.
var fcForest = ee . FeatureCollection ([
ee . Feature ( ee . Geometry . Point ([ - 122.248 , 37.238 ]),
{ 'id' : 0 , 'cover_class' : 'forest' }),
ee . Feature ( ee . Geometry . Point ([ - 122.204 , 37.222 ]),
{ 'id' : 1 , 'cover_class' : 'forest' }),
ee . Feature ( ee . Geometry . Point ([ - 122.110 , 37.199 ]),
{ 'id' : 2 , 'cover_class' : 'forest' })
]);
// FeatureCollection of points representing urban cover.
var fcUrban = ee . FeatureCollection ([
ee . Feature ( ee . Geometry . Point ([ - 121.953 , 37.372 ]),
{ 'id' : 0 , 'cover_class' : 'urban' }),
ee . Feature ( ee . Geometry . Point ([ - 121.861 , 37.308 ]),
{ 'id' : 1 , 'cover_class' : 'urban' }),
ee . Feature ( ee . Geometry . Point ([ - 121.984 , 37.372 ]),
{ 'id' : 2 , 'cover_class' : 'urban' })
]);
// Merge the two FeatureCollections into one.
var fcMerged = fcForest . merge ( fcUrban );
// Display FeatureCollections on the map.
Map . setCenter ( - 122.034 , 37.296 , 11 );
Map . addLayer ( fcForest , { color : 'green' }, 'Forest points' );
Map . addLayer ( fcUrban , { color : 'grey' }, 'Urban points' );
Map . addLayer ( fcMerged , { color : 'yellow' }, 'Protected areas merged' );
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)
# FeatureCollection of points representing forest cover.
fc_forest = ee . FeatureCollection ([
ee . Feature (
ee . Geometry . Point ([ - 122.248 , 37.238 ]),
{
'id' : 0 ,
'cover_class' : 'forest' ,
'id' : 0 ,
'cover_class' : 'forest' ,
},
),
ee . Feature (
ee . Geometry . Point ([ - 122.204 , 37.222 ]),
{
'id' : 1 ,
'cover_class' : 'forest' ,
'id' : 1 ,
'cover_class' : 'forest' ,
},
),
ee . Feature (
ee . Geometry . Point ([ - 122.110 , 37.199 ]),
{
'id' : 2 ,
'cover_class' : 'forest' ,
'id' : 2 ,
'cover_class' : 'forest' ,
},
),
])
# FeatureCollection of points representing urban cover.
fc_urban = ee . FeatureCollection ([
ee . Feature (
ee . Geometry . Point ([ - 121.953 , 37.372 ]),
{ 'id' : 0 , 'cover_class' : 'urban' , 'id' : 0 , 'cover_class' : 'urban' },
),
ee . Feature (
ee . Geometry . Point ([ - 121.861 , 37.308 ]),
{ 'id' : 1 , 'cover_class' : 'urban' , 'id' : 1 , 'cover_class' : 'urban' },
),
ee . Feature (
ee . Geometry . Point ([ - 121.984 , 37.372 ]),
{ 'id' : 2 , 'cover_class' : 'urban' , 'id' : 2 , 'cover_class' : 'urban' },
),
])
# Merge the two FeatureCollections into one.
fc_merged = fc_forest . merge ( fc_urban )
# Display FeatureCollections on the map.
m = geemap . Map ()
m . set_center ( - 122.034 , 37.296 , 11 )
m . add_layer ( fc_forest , { 'color' : 'green' }, 'Forest points' )
m . add_layer ( fc_urban , { 'color' : 'grey' }, 'Urban points' )
m . add_layer ( fc_merged , { 'color' : 'yellow' }, 'Protected areas merged' )
m
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."],[],[]]