ee.FeatureCollection.remap

यह फ़ंक्शन, किसी कलेक्शन में मौजूद किसी प्रॉपर्टी की वैल्यू को फिर से मैप करता है. यह फ़ंक्शन, दो पैरलल सूचियां लेता है और एक सूची में मौजूद वैल्यू को दूसरी सूची में मौजूद वैल्यू पर मैप करता है. अगर किसी एलिमेंट की वैल्यू, पहली सूची में नहीं दी गई है, तो उसे आउटपुट कलेक्शन से हटा दिया जाता है.

इस्तेमालरिटर्न
FeatureCollection.remap(lookupIn, lookupOut, columnName)FeatureCollection
आर्ग्यूमेंटटाइपविवरण
यह: collectionFeatureCollectionवह कलेक्शन जिसमें बदलाव करना है.
lookupInसूचीइनपुट मैपिंग वैल्यू. यह सिर्फ़ स्ट्रिंग और पूर्णांकों के लिए उपलब्ध है.
lookupOutसूचीआउटपुट मैपिंग की वैल्यू. इसका साइज़, lookupIn के साइज़ के बराबर होना चाहिए.
columnNameस्ट्रिंगरीमैप की जाने वाली प्रॉपर्टी का नाम.

उदाहरण

कोड एडिटर (JavaScript)

// Classify features based on a string property.
// The 'nonsense' category gets dropped.
var fc = ee.FeatureCollection([
  ee.Feature(ee.Geometry.Point([1, 2]), {isTree: 'Tree'}),
  ee.Feature(ee.Geometry.Point([3, 4]), {isTree: 'NotTree'}),
  ee.Feature(ee.Geometry.Point([5, 6]), {isTree: 'nonsense'}),
]);

var trees = fc.remap(['NotTree', 'Tree'], [0, 1], 'isTree');
print('remapped trees', trees);

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

# Classify features based on a string property.
# The 'nonsense' category gets dropped.
fc = ee.FeatureCollection([
    ee.Feature(ee.Geometry.Point([1, 2]), {'isTree': 'Tree'}),
    ee.Feature(ee.Geometry.Point([3, 4]), {'isTree': 'NotTree'}),
    ee.Feature(ee.Geometry.Point([5, 6]), {'isTree': 'nonsense'}),
    ])

trees = fc.remap(['NotTree', 'Tree'], [0, 1], 'isTree')
print('Remapped trees:', trees.getInfo())