सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.Image.remap
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इनपुट वैल्यू को आउटपुट वैल्यू पर मैप करता है. इन्हें दो पैरलल सूचियों के तौर पर दिखाया जाता है. इनपुट सूची में शामिल नहीं की गई किसी भी इनपुट वैल्यू को, defaultValue पर सेट किया जाता है. अगर defaultValue नहीं दिया गया है, तो उसे मास्क कर दिया जाता है. ध्यान दें कि फ़्लोटिंग पॉइंट वैल्यू वाले इनपुट, फ़्लोटिंग पॉइंट की सटीक वैल्यू से जुड़ी गड़बड़ियों की वजह से कभी-कभी मैच नहीं हो पाते.
| इस्तेमाल | रिटर्न |
|---|
Image.remap(from, to, defaultValue, bandName) | इमेज |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|
यह: image | इमेज | वह इमेज जिस पर रीमैपिंग लागू की गई है. |
from | सूची | सोर्स वैल्यू (संख्याएं या ee.Array). इस सूची में मौजूद सभी वैल्यू को 'to' में मौजूद वैल्यू से मैप किया जाएगा. |
to | सूची | डेस्टिनेशन वैल्यू (संख्याएं या ee.Array). इनका इस्तेमाल, 'from' में मौजूद वैल्यू को बदलने के लिए किया जाता है. इसमें उतनी ही वैल्यू होनी चाहिए जितनी 'from' में हैं. |
defaultValue | ऑब्जेक्ट, डिफ़ॉल्ट: null | 'from' एट्रिब्यूट की वैल्यू से मैच न होने वाली वैल्यू को बदलने के लिए डिफ़ॉल्ट वैल्यू. अगर यह विकल्प नहीं चुना जाता है, तो मेल न खाने वाली वैल्यू को मास्क कर दिया जाता है. |
bandName | स्ट्रिंग, डिफ़ॉल्ट: null | रीमैप किए जाने वाले बैंड का नाम. अगर यह तय नहीं किया गया है, तो इमेज में मौजूद पहले बैंड का इस्तेमाल किया जाता है. |
उदाहरण
कोड एडिटर (JavaScript)
// A land cover image.
var img = ee.Image('ESA/WorldCover/v100/2020');
// A list of pixel values to replace.
var fromList = [10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100];
// A corresponding list of replacement values (10 becomes 1, 20 becomes 2, etc).
var toList = [ 1, 2, 2, 2, 3, 2, 4, 5, 6, 6, 2];
// Replace pixel values in the image. If the image is multi-band, only the
// remapped band will be returned. The returned band name is "remapped".
// Input image properties are retained in the output image.
var imgRemap = img.remap({
from: fromList,
to: toList,
defaultValue: 0,
bandName: 'Map'
});
// Display the original and remapped images. Note that similar land cover
// classes in the original image are grouped into aggregate classes by
// from → to value mapping.
Map.addLayer(img, null, 'Original image');
Map.addLayer(imgRemap, {
min: 1, max: 6,
palette:'darkgreen, lightgreen, red, white, blue, lightblue'
}, 'Remapped image');
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# A land cover image.
img = ee.Image('ESA/WorldCover/v100/2020')
# A list of pixel values to replace.
from_list = [10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]
# A corresponding list of replacement values (10 becomes 1, 20 becomes 2, etc).
to_list = [1, 2, 2, 2, 3, 2, 4, 5, 6, 6, 2]
# Replace pixel values in the image. If the image is multi-band, only the
# remapped band will be returned. The returned band name is "remapped".
# Input image properties are retained in the output image.
img_remap = img.remap(from_list, to_list, defaultValue=0, bandName='Map')
# Display the original and remapped images. Note that similar land cover
# classes in the original image are grouped into aggregate classes by
# from → to value mapping.
m = geemap.Map()
m.add_layer(img, None, 'Original image')
m.add_layer(
img_remap,
{
'min': 1,
'max': 6,
'palette': [
'darkgreen',
'lightgreen',
'red',
'white',
'blue',
'lightblue',
],
},
'Remapped image',
)
m
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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 `Image.remap` function replaces pixel values in an image based on two parallel lists: `from` and `to`. Values in `from` are mapped to corresponding values in `to`. Unmatched values are set to `defaultValue` if provided, otherwise they are masked. The function allows users to specify a `bandName`. It is designed to aggregate similar classes by mapping original values to new values, the remapped band name is \"remapped\".\n"]]