ee.Image.select
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी इमेज से बैंड चुनता है.
चुने गए बैंड वाली इमेज दिखाता है.
इस्तेमाल | रिटर्न |
---|
Image.select(var_args) | इमेज |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: image | इमेज | इमेज का इंस्टेंस. |
var_args | VarArgs<Object> | इनमें से कोई एक वजह हो सकती है:
- सूची के अलावा, कोई भी संख्या. इन सभी को बैंड सिलेक्टर के तौर पर समझा जाएगा. ये बैंड के नाम, रेगुलर एक्सप्रेशन या अंकों वाले इंडेक्स हो सकते हैं. उदाहरण के लिए, selected = image.select('a', 'b', 3, 'd');
- दो सूचियां. पहले का इस्तेमाल बैंड चुनने वाले टूल के तौर पर और दूसरे का इस्तेमाल चुने गए बैंड के नए नामों के तौर पर किया जाएगा. नए नामों की संख्या, चुने गए बैंड की संख्या से मेल खानी चाहिए. उदाहरण के लिए, selected = image.select(['a', 4], ['newA', 'newB']);
|
उदाहरण
कोड एडिटर (JavaScript)
// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
print('All band names', img.bandNames());
print('Select a band by name',
img.select('B11').bandNames());
print('Select a band by index',
img.select(10).bandNames());
print('Select bands using a list',
img.select(['B11', 'B8', 'B3']).bandNames());
print('Select bands by an argument series',
img.select('B11', 'B8', 'B3').bandNames());
print('Mixing string and integer selectors is valid',
img.select(10, 'B8', 2).bandNames());
print('Rename selected bands using two corresponding lists',
img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green']).bandNames());
// Use regular expressions to select bands.
print('Match "QA" followed by any two characters',
img.select('QA..').bandNames());
print('Match "B" followed by any character, any number of times',
img.select('B.*').bandNames());
print('Match "B" followed by any character, and any optional third character',
img.select('B..?').bandNames());
print('Match "B" followed by a character in the range 6-8',
img.select('B[6-8]').bandNames());
print('Match "B" followed by a character in the range 1-9 and then 1-2',
img.select('B[1-9][1-2]').bandNames());
print('Match "B" or "QA" each followed by any character, any number of times.',
img.select('B.*|QA.*').bandNames());
Python सेटअप
Python API के बारे में जानकारी पाने और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
print('All band names:', img.bandNames().getInfo())
print('Select a band by name:', img.select('B11').bandNames().getInfo())
print('Select a band by index:', img.select(10).bandNames().getInfo())
print('Select bands using a list:',
img.select(['B11', 'B8', 'B3']).bandNames().getInfo())
print('Select bands by an argument series:',
img.select('B11', 'B8', 'B3').bandNames().getInfo())
print('Mixing string and integer selectors is valid:',
img.select(10, 'B8', 2).bandNames().getInfo())
print('Rename selected bands using two corresponding lists:',
img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green'])
.bandNames().getInfo())
# Use regular expressions to select bands.
print('Match "QA" followed by any two characters:',
img.select('QA..').bandNames().getInfo())
print('Match "B" followed by any character, any number of times:',
img.select('B.*').bandNames().getInfo())
print('Match "B" followed by any character, and any optional third character',
img.select('B..?').bandNames().getInfo())
print('Match "B" followed by a character in the range 6-8',
img.select('B[6-8]').bandNames().getInfo())
print('Match "B" followed by a character in the range 1-9 and then 1-2',
img.select('B[1-9][1-2]').bandNames().getInfo())
print('Match "B" or "QA" each followed by any character, any number of times.',
img.select('B.*|QA.*').bandNames().getInfo())
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eImage.select()\u003c/code\u003e is used to select specific bands from an image by their name, index, or using regular expressions.\u003c/p\u003e\n"],["\u003cp\u003eYou can provide band selectors as individual arguments, a single list, or two lists (one for selectors and one for new band names).\u003c/p\u003e\n"],["\u003cp\u003eThis method returns a new image containing only the selected bands, potentially with renamed bands if specified.\u003c/p\u003e\n"],["\u003cp\u003eRegular expressions provide a powerful way to select multiple bands matching a pattern.\u003c/p\u003e\n"]]],[],null,["# ee.Image.select\n\n\u003cbr /\u003e\n\nSelects bands from an image.\n\n\u003cbr /\u003e\n\nReturns an image with the selected bands.\n\n| Usage | Returns |\n|--------------------------|---------|\n| Image.select`(var_args)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The Image instance. |\n| `var_args` | VarArgs\\\u003cObject\\\u003e | One of two possibilities: - Any number of non-list arguments. All of these will be interpreted as band selectors. These can be band names, regexes, or numeric indices. E.g. selected = image.select('a', 'b', 3, 'd'); - Two lists. The first will be used as band selectors and the second as new names for the selected bands. The number of new names must match the number of selected bands. E.g. selected = image.select(\\['a', 4\\], \\['newA', 'newB'\\]); |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A Sentinel-2 surface reflectance image.\nvar img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');\nprint('All band names', img.bandNames());\n\nprint('Select a band by name',\n img.select('B11').bandNames());\n\nprint('Select a band by index',\n img.select(10).bandNames());\n\nprint('Select bands using a list',\n img.select(['B11', 'B8', 'B3']).bandNames());\n\nprint('Select bands by an argument series',\n img.select('B11', 'B8', 'B3').bandNames());\n\nprint('Mixing string and integer selectors is valid',\n img.select(10, 'B8', 2).bandNames());\n\nprint('Rename selected bands using two corresponding lists',\n img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green']).bandNames());\n\n// Use regular expressions to select bands.\nprint('Match \"QA\" followed by any two characters',\n img.select('QA..').bandNames());\n\nprint('Match \"B\" followed by any character, any number of times',\n img.select('B.*').bandNames());\n\nprint('Match \"B\" followed by any character, and any optional third character',\n img.select('B..?').bandNames());\n\nprint('Match \"B\" followed by a character in the range 6-8',\n img.select('B[6-8]').bandNames());\n\nprint('Match \"B\" followed by a character in the range 1-9 and then 1-2',\n img.select('B[1-9][1-2]').bandNames());\n\nprint('Match \"B\" or \"QA\" each followed by any character, any number of times.',\n img.select('B.*|QA.*').bandNames());\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# A Sentinel-2 surface reflectance image.\nimg = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')\nprint('All band names:', img.bandNames().getInfo())\n\nprint('Select a band by name:', img.select('B11').bandNames().getInfo())\n\nprint('Select a band by index:', img.select(10).bandNames().getInfo())\n\nprint('Select bands using a list:',\n img.select(['B11', 'B8', 'B3']).bandNames().getInfo())\n\nprint('Select bands by an argument series:',\n img.select('B11', 'B8', 'B3').bandNames().getInfo())\n\nprint('Mixing string and integer selectors is valid:',\n img.select(10, 'B8', 2).bandNames().getInfo())\n\nprint('Rename selected bands using two corresponding lists:',\n img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green'])\n .bandNames().getInfo())\n\n# Use regular expressions to select bands.\nprint('Match \"QA\" followed by any two characters:',\n img.select('QA..').bandNames().getInfo())\n\nprint('Match \"B\" followed by any character, any number of times:',\n img.select('B.*').bandNames().getInfo())\n\nprint('Match \"B\" followed by any character, and any optional third character',\n img.select('B..?').bandNames().getInfo())\n\nprint('Match \"B\" followed by a character in the range 6-8',\n img.select('B[6-8]').bandNames().getInfo())\n\nprint('Match \"B\" followed by a character in the range 1-9 and then 1-2',\n img.select('B[1-9][1-2]').bandNames().getInfo())\n\nprint('Match \"B\" or \"QA\" each followed by any character, any number of times.',\n img.select('B.*|QA.*').bandNames().getInfo())\n```"]]