ee.FeatureCollection.map

একটি সংগ্রহের উপর একটি অ্যালগরিদম ম্যাপ করে।

ম্যাপ করা সংগ্রহ ফেরত দেয়।

ব্যবহার রিটার্নস
FeatureCollection. map (algorithm, dropNulls ) সংগ্রহ
যুক্তি টাইপ বিস্তারিত
এই: collection সংগ্রহ সংগ্রহের উদাহরণ।
algorithm ফাংশন সংগ্রহের ছবি বা বৈশিষ্ট্যের উপর ম্যাপ করার অপারেশন। একটি জাভাস্ক্রিপ্ট ফাংশন যা একটি চিত্র বা বৈশিষ্ট্য গ্রহণ করে এবং একটি প্রদান করে। ফাংশনটি শুধুমাত্র একবার কল করা হয় এবং ফলাফলটি একটি বিবরণ হিসাবে ক্যাপচার করা হয়, তাই এটি অপরিহার্য ক্রিয়াকলাপ সম্পাদন করতে পারে না বা বাহ্যিক অবস্থার উপর নির্ভর করতে পারে না।
dropNulls বুলিয়ান, ঐচ্ছিক সত্য হলে, ম্যাপ করা অ্যালগরিদমকে নাল রিটার্ন করার অনুমতি দেওয়া হয়, এবং যে উপাদানগুলির জন্য এটি নাল রিটার্ন করে সেগুলি বাদ দেওয়া হবে।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');

// Function to convert power plant capacity from megawatts to gigawatts and
// add the value as a new feature property.
var mwToGw = function(feature) {
  var megawatt = feature.getNumber('capacitymw');
  var gigawatt = megawatt.divide(1000);
  return feature.set('capacitygw', gigawatt);
};

// Apply the function to each feature in the collection.
fc = fc.map(mwToGw);

print('Note the new "capacitygw" property in each feature', fc);

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

# Function to convert power plant capacity from megawatts to gigawatts and
# add the value as a new feature property.
def mw_to_gw(feature):
  megawatt = feature.getNumber('capacitymw')
  gigawatt = megawatt.divide(1000)
  return feature.set('capacitygw', gigawatt)

# Apply the function to each feature in the collection.
fc = fc.map(mw_to_gw)

print('Note the new "capacitygw" property in each feature:', fc.getInfo())