ee.FeatureCollection.map
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह किसी कलेक्शन पर एल्गोरिदम को मैप करता है.
यह फ़ंक्शन, मैप किए गए कलेक्शन को दिखाता है.
इस्तेमाल | रिटर्न |
---|
FeatureCollection.map(algorithm, dropNulls) | संग्रह |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: collection | संग्रह | कलेक्शन इंस्टेंस. |
algorithm | फ़ंक्शन | संग्रह की इमेज या सुविधाओं को मैप करने की प्रोसेस. यह एक JavaScript फ़ंक्शन है, जिसे इमेज या सुविधाएं मिलती हैं और यह एक इमेज या सुविधा दिखाता है. इस फ़ंक्शन को सिर्फ़ एक बार कॉल किया जाता है और नतीजे को ब्यौरे के तौर पर कैप्चर किया जाता है. इसलिए, यह ज़रूरी कार्रवाइयां नहीं कर सकता या बाहरी स्थिति पर निर्भर नहीं रह सकता. |
dropNulls | बूलियन, ज़रूरी नहीं | अगर यह वैल्यू सही है, तो मैप किए गए एल्गोरिदम को शून्य वैल्यू वापस लाने की अनुमति होती है. साथ ही, जिन एलिमेंट के लिए यह शून्य वैल्यू वापस लाता है उन्हें हटा दिया जाएगा. |
उदाहरण
कोड एडिटर (JavaScript)
// 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);
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# 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())
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],["The `map` algorithm applies a user-defined function to each element within a collection (e.g., features or images). This function, which accepts an element as input and returns a modified one, is applied to each item of the collection. The `dropNulls` argument allows filtering null return values. The result is a new collection containing the modified elements. For example, converting power plant capacity units and adding them as a new property to the features.\n"],null,[]]