공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
지연된 실행
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
클라이언트와 서버 비교 문서에서는 스크립트에서 참조되는 객체가 클라이언트 측 또는 서버 측일 수 있는 방법을 설명합니다. 전체 스크립트에는 사용하려는 객체뿐만 아니라 Earth Engine에 객체를 어떻게 처리할지 지시하는 일련의 안내가 포함됩니다. 이 문서에서는 이러한 안내가 처리를 위해 Google로 전송되는 방법과 결과가 표시되도록 클라이언트로 다시 전송되는 방법을 설명합니다.
Earth Engine에서 스크립트 (JavaScript 또는 Python)를 작성하면 Google의 Earth Engine 서버에서 코드가 직접 실행되지는 않습니다. 대신 클라이언트 라이브러리가 스크립트를 JSON 객체 세트로 인코딩하고 객체를 Google에 전송한 후 응답을 기다립니다. 각 객체는 특정 출력(예: 클라이언트에 표시할 이미지)을 가져오는 데 필요한 일련의 작업을 나타냅니다.
다음 코드를 살펴보세요.
코드 편집기 (JavaScript)
var image = ee.Image('CGIAR/SRTM90_V4');
var operation = image.add(10);
print(operation.toString());
print(operation);
Python 설정
Python API 및 대화형 개발을 위한 geemap
사용에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
image = ee.Image('CGIAR/SRTM90_V4')
operation = image.add(10)
print(operation)
print(operation.getInfo())
첫 번째 print 문이 클라이언트 라이브러리가 Google의 서버에 이미지를 설명하는 데 사용하는 JSON 구조를 출력합니다.
ee.Image({
"type": "Invocation",
"arguments": {
"image1": {
"type": "Invocation",
"arguments": {
"id": "CGIAR/SRTM90_V4"
},
"functionName": "Image.load"
},
"image2": {
"type": "Invocation",
"arguments": {
"value": 10
},
"functionName": "Image.constant"
}
},
"functionName": "Image.add"
})
두 번째 print 문이 요청을 Google에 전송하고 Google 서버의 POST 응답을 출력합니다. JSON 형식으로 응답을 보려면 콘솔 오른쪽에 있는 출력된 객체 옆에 있는 JSON
링크를 클릭합니다.
{
"type": "Image",
"bands": [
{
"id": "elevation",
"data_type": {
"type": "PixelType",
"precision": "int",
"min": -32758,
"max": 32777
},
"crs": "EPSG:4326",
"crs_transform": [
0.0008333333535119891,
0,
-180,
0,
-0.0008333333535119891,
60
]
}
]
}
요청이 있을 때까지는 처리를 위해 Google로 전송되는 항목이 없습니다. 이 예에서는 서버 객체에서 getInfo()
호출의 결과를 출력하면 요청이 트리거됩니다. 이 결과가 명시적으로 요청될 때까지 서버에서 처리가 이루어지지 않습니다. JavaScript 코드 편집기의 print()
는 비동기 getInfo()
호출을 래핑하는 특수한 클라이언트 측 함수입니다. Python의 경우 이를 직접 호출합니다.
요청의 또 다른 예는 Code Editor 또는 geemap 지도 요소에 표시하는 것입니다. 이 요청이 Google에 전송되면 Code Editor 또는 geemap 지도 요소에 결과를 표시하는 데 필요한 타일만 반환됩니다.
구체적으로 지도의 위치와 확대/축소 수준에 따라 처리되어 지도에 표시할 수 있는 이미지로 변환되는 데이터가 결정됩니다. 화면 이동이나 확대/축소를 하면 다른 타일은 지연 컴퓨팅됩니다. 이 주문형 시스템을 사용하면 병렬 처리와 효율적인 처리가 가능하지만 지도 경계의 확대/축소 수준과 위치에 따라 지도에 표시되는 이미지가 서로 다른 입력으로 생성된다는 의미이기도 합니다. 확장 문서에서 계산 입력이 요청에서 결정되는 방식을 자세히 알아보세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eEarth Engine code execution involves encoding scripts into JSON objects by the client library and sending them to Google servers for processing, with results returned to the client for display.\u003c/p\u003e\n"],["\u003cp\u003eProcessing on Google servers is triggered only when there's an explicit request, such as printing an object's information or displaying it on a map.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine employs a lazy processing system where only the necessary data for the current view is computed, improving efficiency and allowing for parallelization.\u003c/p\u003e\n"],["\u003cp\u003eThe displayed image on the map depends on the zoom level and map bounds, resulting in different inputs being used for computation at various scales.\u003c/p\u003e\n"],["\u003cp\u003eFurther details on how inputs are determined for computations based on requests can be found in the Scale documentation.\u003c/p\u003e\n"]]],[],null,["# Deferred Execution\n\nThe [Client vs. Server](/earth-engine/guides/client_server) doc describes how objects referenced\nin your script can be either client-side or server-side. The complete script contains\nnot only the objects you want to use, but also a set of instructions that tell Earth Engine\nwhat to do with them. This doc describes how those instructions are sent to Google for\nprocessing and how the results are sent back to the client for display.\n\nWhen you write a script in Earth Engine (either JavaScript or Python), that code does\nNOT run directly on Earth Engine servers at Google. Instead, the\n[client library](https://github.com/google/earthengine-api) encodes the\nscript into a set of [JSON](http://www.json.org/) objects, sends the objects\nto Google and waits for a response. Each object represents a set of operations\nrequired to get a particular output, an image to display in the client, for example.\nConsider the following code:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar image = ee.Image('CGIAR/SRTM90_V4');\nvar operation = image.add(10);\nprint(operation.toString());\nprint(operation);\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\nimage = ee.Image('CGIAR/SRTM90_V4')\noperation = image.add(10)\nprint(operation)\nprint(operation.getInfo())\n```\n\nThe first print statement will output the JSON structure that the client library\nuses to describe that image to the server at Google: \n\n```gdscript\nee.Image({\n \"type\": \"Invocation\",\n \"arguments\": {\n \"image1\": {\n \"type\": \"Invocation\",\n \"arguments\": {\n \"id\": \"CGIAR/SRTM90_V4\"\n },\n \"functionName\": \"Image.load\"\n },\n \"image2\": {\n \"type\": \"Invocation\",\n \"arguments\": {\n \"value\": 10\n },\n \"functionName\": \"Image.constant\"\n }\n },\n \"functionName\": \"Image.add\"\n})\n \n```\n\nThe second print statement will send the request to Google and output the\n[POST](https://en.wikipedia.org/wiki/POST_(HTTP)) response from Google\nservers. To see the response in all its JSON glory, click the `JSON` link\non the right side of the console, next to the printed object: \n\n```carbon\n{\n \"type\": \"Image\",\n \"bands\": [\n {\n \"id\": \"elevation\",\n \"data_type\": {\n \"type\": \"PixelType\",\n \"precision\": \"int\",\n \"min\": -32758,\n \"max\": 32777\n },\n \"crs\": \"EPSG:4326\",\n \"crs_transform\": [\n 0.0008333333535119891,\n 0,\n -180,\n 0,\n -0.0008333333535119891,\n 60\n ]\n }\n ]\n}\n \n```\n\nNothing is sent to Google for processing until there is a request for it. In this\nexample, printing the result of a `getInfo()` call on a server object triggers a\nrequest. No processing is done on the server until that result is explicitly\nrequested. Note that `print()` in the JavaScript Code Editor is a special\nclient-side function that wraps an asynchronous `getInfo()` call; for Python we\ncall it directly.\n\nAnother example of requesting something is displaying it on the Code Editor or geemap map\nelement. When this request is sent to Google, only the tiles\nnecessary to display the result in the Code Editor or geemap map element are returned.\nSpecifically, the position of the map and the zoom level determine which data get processed\nand turned into images that can be displayed on the map. If you pan or zoom, note that\nother tiles are computed lazily. This on-demand system allows for parallelization and\nefficient processing, but also means that the image displayed on the map is produced from\ndifferent inputs depending on the zoom level and location of the map bounds. Learn more about\nhow inputs to a computation are determined from the request in the\n[Scale](/earth-engine/guides/scale) doc."]]