Duyuru:
15 Nisan 2025'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin Earth Engine erişimini sürdürmek için
ticari olmayan uygunluğu doğrulaması gerekir.
ee.Image.changeProj
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Giriş resminin projeksiyonunu değiştirerek her pikseli srcProj'deki konumundan dstProj'deki aynı koordinatlara taşır.
Kullanım | İadeler |
---|
Image.changeProj(srcProj, dstProj) | Resim |
Bağımsız Değişken | Tür | Ayrıntılar |
---|
bu: input | Resim | |
srcProj | Projeksiyon | Orijinal projeksiyon. |
dstProj | Projeksiyon | Yeni tahmin. |
Örnekler
Kod Düzenleyici (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 kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
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
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 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```"]]