ee.Image.changeProj
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह इनपुट इमेज के प्रोजेक्शन में बदलाव करता है. साथ ही, हर पिक्सल को srcProj में उसकी जगह से dstProj में एक ही कोऑर्डिनेट पर ले जाता है.
इस्तेमाल | रिटर्न |
---|
Image.changeProj(srcProj, dstProj) | इमेज |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: input | इमेज | |
srcProj | अनुमान | ओरिजनल प्रोजेक्शन. |
dstProj | अनुमान | नई प्रोजेक्शन. |
उदाहरण
कोड एडिटर (JavaScript)
// A DEM image object.
var img = ee.Image('MERIT/DEM/v1_0_3');
// Construct a projection object from a WKT string or EPSG code, for example,
// the Robinson projection (https://epsg.io/54030).
var proj = ee.Projection(
'PROJCS["World_Robinson",' +
'GEOGCS["GCS_WGS_1984",' +
'DATUM["WGS_1984",' +
'SPHEROID["WGS_1984",6378137,298.257223563]],' +
'PRIMEM["Greenwich",0],' +
'UNIT["Degree",0.017453292519943295]],' +
'PROJECTION["Robinson"],' +
'UNIT["Meter",1]]'
)
// Optionally adjust projection scale; stretch layer larger in this case.
.scale(0.9, 0.9);
// "Paint" the image in the desired projection onto the projection of
// the map canvas ('EPSG:3857').
var imgProj = img.changeProj(proj, 'EPSG:3857');
// Add an overlay image to the map to cover the default base layers.
Map.setCenter(0, 0, 2);
Map.addLayer(ee.Image(1), {palette: 'grey'}, 'Grey background', false);
// Add the projection-tweaked image to the map.
Map.addLayer(imgProj, {min: 0, max: 3000}, 'DEM in Robinson projection');
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# A DEM image object.
img = ee.Image('MERIT/DEM/v1_0_3')
# Construct a projection object from a WKT string or EPSG code, for example,
# the Robinson projection (https://epsg.io/54030).
proj = (
ee.Projection(
'PROJCS["World_Robinson",'
+ 'GEOGCS["GCS_WGS_1984",'
+ 'DATUM["WGS_1984",'
+ 'SPHEROID["WGS_1984",6378137,298.257223563]],'
+ 'PRIMEM["Greenwich",0],'
+ 'UNIT["Degree",0.017453292519943295]],'
+ 'PROJECTION["Robinson"],'
+ 'UNIT["Meter",1]]'
)
# Optionally adjust projection scale stretch layer larger in this case.
.scale(0.9, 0.9)
)
# "Paint" the image in the desired projection onto the projection of
# the map canvas ('EPSG:3857').
img_proj = img.changeProj(proj, 'EPSG:3857')
# Add an overlay image to the map to cover the default base layers.
m = geemap.Map()
m.set_center(0, 0, 2)
m.add_layer(ee.Image(1), {'palette': 'grey'}, 'Grey background', False)
# Add the projection-tweaked image to the map.
m.add_layer(
img_proj,
{'min': 0, 'max': 3000},
'DEM in Robinson projection',
)
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) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eImage.changeProj()\u003c/code\u003e modifies the projection of an image by moving pixels to match coordinates in a new projection.\u003c/p\u003e\n"],["\u003cp\u003eIt takes the original projection (\u003ccode\u003esrcProj\u003c/code\u003e) and the target projection (\u003ccode\u003edstProj\u003c/code\u003e) as inputs.\u003c/p\u003e\n"],["\u003cp\u003eYou can define projections using WKT strings or EPSG codes.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a new Image object with the altered projection.\u003c/p\u003e\n"],["\u003cp\u003eThis is useful for visualizing or processing data in different coordinate systems.\u003c/p\u003e\n"]]],["The `changeProj` function modifies an image's projection by relocating each pixel from its original projection (`srcProj`) to a new projection (`dstProj`). This is done by taking an image object as input and takes in two parameters `srcProj` and `dstProj`. For example, it takes a DEM image, defines a Robinson projection with an adjusted scale, and then applies `changeProj` to re-project the image onto the map canvas projection (`EPSG:3857`). The result is an image with the modified projection.\n"],null,["# ee.Image.changeProj\n\nTweaks the projection of the input image, moving each pixel from its location in srcProj to the same coordinates in dstProj.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------|---------|\n| Image.changeProj`(srcProj, dstProj)` | Image |\n\n| Argument | Type | Details |\n|---------------|------------|--------------------------|\n| this: `input` | Image | |\n| `srcProj` | Projection | The original projection. |\n| `dstProj` | Projection | The new projection. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A DEM image object.\nvar img = ee.Image('MERIT/DEM/v1_0_3');\n\n// Construct a projection object from a WKT string or EPSG code, for example,\n// the Robinson projection (https://epsg.io/54030).\nvar proj = ee.Projection(\n 'PROJCS[\"World_Robinson\",' +\n 'GEOGCS[\"GCS_WGS_1984\",' +\n 'DATUM[\"WGS_1984\",' +\n 'SPHEROID[\"WGS_1984\",6378137,298.257223563]],' +\n 'PRIMEM[\"Greenwich\",0],' +\n 'UNIT[\"Degree\",0.017453292519943295]],' +\n 'PROJECTION[\"Robinson\"],' +\n 'UNIT[\"Meter\",1]]'\n)\n// Optionally adjust projection scale; stretch layer larger in this case.\n.scale(0.9, 0.9);\n\n// \"Paint\" the image in the desired projection onto the projection of\n// the map canvas ('EPSG:3857').\nvar imgProj = img.changeProj(proj, 'EPSG:3857');\n\n// Add an overlay image to the map to cover the default base layers.\nMap.setCenter(0, 0, 2);\nMap.addLayer(ee.Image(1), {palette: 'grey'}, 'Grey background', false);\n\n// Add the projection-tweaked image to the map.\nMap.addLayer(imgProj, {min: 0, max: 3000}, 'DEM in Robinson projection');\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 DEM image object.\nimg = ee.Image('MERIT/DEM/v1_0_3')\n\n# Construct a projection object from a WKT string or EPSG code, for example,\n# the Robinson projection (https://epsg.io/54030).\nproj = (\n ee.Projection(\n 'PROJCS[\"World_Robinson\",'\n + 'GEOGCS[\"GCS_WGS_1984\",'\n + 'DATUM[\"WGS_1984\",'\n + 'SPHEROID[\"WGS_1984\",6378137,298.257223563]],'\n + 'PRIMEM[\"Greenwich\",0],'\n + 'UNIT[\"Degree\",0.017453292519943295]],'\n + 'PROJECTION[\"Robinson\"],'\n + 'UNIT[\"Meter\",1]]'\n )\n # Optionally adjust projection scale stretch layer larger in this case.\n .scale(0.9, 0.9)\n)\n\n# \"Paint\" the image in the desired projection onto the projection of\n# the map canvas ('EPSG:3857').\nimg_proj = img.changeProj(proj, 'EPSG:3857')\n\n# Add an overlay image to the map to cover the default base layers.\nm = geemap.Map()\nm.set_center(0, 0, 2)\nm.add_layer(ee.Image(1), {'palette': 'grey'}, 'Grey background', False)\n\n# Add the projection-tweaked image to the map.\nm.add_layer(\n img_proj,\n {'min': 0, 'max': 3000},\n 'DEM in Robinson projection',\n)\nm\n```"]]