প্রথম সংগ্রহের উপাদানগুলোর আইডির শুরুতে "1 " এবং দ্বিতীয় সংগ্রহের উপাদানগুলোর আইডির শুরুতে "2" থাকবে ।
দ্রষ্টব্য: যদি একাধিক কালেকশন একত্রিত করার প্রয়োজন হয়, তবে সেগুলোকে একটি কালেকশনে রেখে FeatureCollection.flatten() ব্যবহার করার কথা বিবেচনা করুন। বারবার FeatureCollection.merge() ব্যবহার করলে এলিমেন্ট আইডিগুলো ক্রমশ দীর্ঘ হতে থাকবে এবং পারফরম্যান্স কমে যাবে।
| ব্যবহার | ফেরত |
|---|---|
FeatureCollection. merge (collection2) | ফিচার কালেকশন |
| যুক্তি | প্রকার | বিস্তারিত |
|---|---|---|
এই: collection1 | ফিচার কালেকশন | মার্জ করার জন্য প্রথম সংগ্রহ। |
collection2 | ফিচার কালেকশন | মার্জ করার জন্য দ্বিতীয় কালেকশন। |
উদাহরণ
কোড এডিটর (জাভাস্ক্রিপ্ট)
// 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');
import ee import geemap.core as geemap
কোলাব (পাইথন)
# 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