ee.data.computePixels (Python only)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह इमेज डेटा पर कोई भी हिसाब लगाकर, एक टाइल बनाता है.
वैल्यू:
पिक्सल को रॉ इमेज डेटा के तौर पर दिखाता है.
इस्तेमाल | रिटर्न |
ee.data.computePixels(params) | Object|Value |
आर्ग्यूमेंट | टाइप | विवरण |
params | ऑब्जेक्ट | यह एक ऐसा ऑब्जेक्ट होता है जिसमें पैरामीटर होते हैं. इनकी ये वैल्यू हो सकती हैं:
expression - यह कैलकुलेट किया जाने वाला एक्सप्रेशन होता है.
fileFormat - यह फ़ाइल फ़ॉर्मैट का नतीजा है. डिफ़ॉल्ट रूप से, यह png पर सेट होता है. उपलब्ध फ़ॉर्मैट के लिए, ImageFileFormat देखें. ऐसे अन्य फ़ॉर्मैट भी उपलब्ध हैं जो डाउनलोड किए गए ऑब्जेक्ट को Python डेटा ऑब्जेक्ट में बदलते हैं. इनमें ये शामिल हैं:
NUMPY_NDARRAY , जिसे स्ट्रक्चर्ड NumPy ऐरे में बदल दिया जाता है.
grid - ये ऐसे पैरामीटर होते हैं जिनसे उस पिक्सल ग्रिड के बारे में पता चलता है जिसमें डेटा फ़ेच करना है.
यह डिफ़ॉल्ट रूप से, डेटा के नेटिव पिक्सल ग्रिड पर सेट होता है.
bandIds - अगर यह मौजूद है, तो यह बैंड का एक खास सेट तय करता है, जिससे पिक्सल मिलते हैं.
visualizationOptions - अगर मौजूद है, तो डेटा को विज़ुअलाइज़ करने के लिए विकल्पों का एक सेट. इसका इस्तेमाल, रॉ डेटा के बजाय डेटा का 8-बिट आरजीबी विज़ुअलाइज़ेशन बनाने के लिए किया जाता है.
workloadTag - उपयोगकर्ता ने इस कंप्यूटेशन को ट्रैक करने के लिए टैग दिया है. |
उदाहरण
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Region of interest.
coords = [
-121.58626826832939,
38.059141484827485,
]
region = ee.Geometry.Point(coords)
# Sentinel-2 median composite.
image = (ee.ImageCollection('COPERNICUS/S2')
.filterBounds(region)
.filterDate('2020-04-01', '2020-09-01')
.median())
# Make a projection to discover the scale in degrees.
proj = ee.Projection('EPSG:4326').atScale(10).getInfo()
# Get scales out of the transform.
scale_x = proj['transform'][0]
scale_y = -proj['transform'][4]
# Make a request object.
request = {
'expression': image,
'fileFormat': 'PNG',
'bandIds': ['B4', 'B3', 'B2'],
'grid': {
'dimensions': {
'width': 640,
'height': 640
},
'affineTransform': {
'scaleX': scale_x,
'shearX': 0,
'translateX': coords[0],
'shearY': 0,
'scaleY': scale_y,
'translateY': coords[1]
},
'crsCode': proj['crs'],
},
'visualizationOptions': {'ranges': [{'min': 0, 'max': 3000}]},
}
image_png = ee.data.computePixels(request)
# Do something with the image...
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eee.data.computePixels\u003c/code\u003e computes a tile by performing an arbitrary computation on image data and returns the pixels as raw image data.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eparams\u003c/code\u003e argument to \u003ccode\u003eee.data.computePixels\u003c/code\u003e allows for customizing the computation through an expression, file format, pixel grid, band selection, visualization options, and workload tag.\u003c/p\u003e\n"],["\u003cp\u003eThe provided Python example demonstrates using \u003ccode\u003eee.data.computePixels\u003c/code\u003e to retrieve a PNG image tile from a Sentinel-2 median composite with specified visualization and grid parameters.\u003c/p\u003e\n"]]],[],null,["# ee.data.computePixels (Python only)\n\n\u003cbr /\u003e\n\nComputes a tile by performing an arbitrary computation on image data.\n\n\u003cbr /\u003e\n\nReturns:\nThe pixels as raw image data.\n\n| Usage | Returns |\n|---------------------------------|---------------|\n| `ee.data.computePixels(params)` | Object\\|Value |\n\n| Argument | Type | Details |\n|----------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `params` | Object | An object containing parameters with the following possible values: `expression` - The expression to compute. `fileFormat` - The resulting file format. Defaults to png. See [ImageFileFormat](https://developers.google.com/earth-engine/reference/rest/v1/ImageFileFormat) for the available formats. There are additional formats that convert the downloaded object to a Python data object. These include: `NUMPY_NDARRAY`, which converts to a structured NumPy array. `grid` - Parameters describing the pixel grid in which to fetch data. Defaults to the native pixel grid of the data. `bandIds` - If present, specifies a specific set of bands from which to get pixels. `visualizationOptions` - If present, a set of visualization options to apply to produce an 8-bit RGB visualization of the data, rather than returning the raw data. `workloadTag` - User supplied tag to track this computation. |\n\nExamples\n--------\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# Region of interest.\ncoords = [\n -121.58626826832939,\n 38.059141484827485,\n]\nregion = ee.Geometry.Point(coords)\n\n# Sentinel-2 median composite.\nimage = (ee.ImageCollection('COPERNICUS/S2')\n .filterBounds(region)\n .filterDate('2020-04-01', '2020-09-01')\n .median())\n\n# Make a projection to discover the scale in degrees.\nproj = ee.Projection('EPSG:4326').atScale(10).getInfo()\n\n# Get scales out of the transform.\nscale_x = proj['transform'][0]\nscale_y = -proj['transform'][4]\n\n# Make a request object.\nrequest = {\n 'expression': image,\n 'fileFormat': 'PNG',\n 'bandIds': ['B4', 'B3', 'B2'],\n 'grid': {\n 'dimensions': {\n 'width': 640,\n 'height': 640\n },\n 'affineTransform': {\n 'scaleX': scale_x,\n 'shearX': 0,\n 'translateX': coords[0],\n 'shearY': 0,\n 'scaleY': scale_y,\n 'translateY': coords[1]\n },\n 'crsCode': proj['crs'],\n },\n 'visualizationOptions': {'ranges': [{'min': 0, 'max': 3000}]},\n}\n\nimage_png = ee.data.computePixels(request)\n# Do something with the image...\n```"]]