Earth Engine은 강력한 분석 도구이지만 차트, 이미지, 지도 등을 보고서나 간행물에 삽입하기 위해 분석 결과를 내보내야 할 수도 있습니다. 이 섹션에서는 다른 소프트웨어에서 내보내고 볼 수 있는 차트와 이미지를 만드는 방법을 알아봅니다. 이전 섹션에서 다음 코드와 같은 코드를 사용하여 컬렉션의 모든 이미지에 NDVI 밴드를 추가했습니다. 여기서 l8 변수는 Landsat 8 TOA 반사율 컬렉션을 참조합니다.
특정 위치에서 시간 경과에 따른 NDVI 차트를 원한다고 가정해 보겠습니다. 이러한 차트를 만들려면 먼저 관심 있는 위치를 선택해야 합니다. 점 그리기 도구 ()를 가져와 관심 영역에 단일 점 지오메트리를 만들어 점을 만듭니다. (이미 가져온 항목이 있는 경우 먼저 지오메트리 가져오기에 마우스를 가져간 다음 + 새 레이어를 클릭합니다.)
농업 지역, 낙엽수림, 연간 초지 또는 연간 주기가 있는 기타 토지 피복 지역의 지점을 찾습니다. 가져오기 이름을 roi로 지정합니다. (프로그래매틱 방식으로 지오메트리를 만드는 방법에 대한 자세한 내용은 이 페이지를 참고하세요.)
이제 roi 포인트를 사용하여 해당 포인트 아래 픽셀의 시간 경과에 따른 NDVI 차트를 만들어 보겠습니다. Earth Engine에서 차트를 만드는 방법은 ui.Chart 패키지를 사용하는 것입니다. (Earth Engine에서 차트를 만드는 방법 자세히 알아보기)
특히 시간 경과에 따른 차트를 만들려면 ui.Chart.image.series() 메서드를 사용하면 됩니다.
roi 형상의 경우 농업 지역의 한 지점을 선택하여 그림 10과 같은 차트를 얻었습니다. 차트 생성자의 매개변수에는 reduceRegion()와 같은 리듀서와 스케일이 포함됩니다. 영역으로 제공하는 점은 하나의 픽셀과만 교차할 수 있으므로 'first' 리듀서를 사용하면 됩니다. 영역이 더 큰 경우 픽셀을 집계하는 방법을 지정하는 '평균' 또는 기타 리듀서를 사용해야 합니다. 차트를 시각화하려면 차트를 출력하기만 하면 됩니다.
그림 10. 점 형상의 시간 경과에 따른 Landsat NDVI 차트입니다.
여담: Landsat의 간단한 클라우드 마스킹
이 차트에서 알 수 있는 점은 해당 지점의 NDVI 값 시계열이 약간 노이즈가 있다는 것입니다. 구름 때문일 수 있습니다. 이 효과를 개선하기 위해 Earth Engine에는 열 밴드가 있는 Landsat 센서용 클라우드 마스킹 알고리즘(ee.Algorithms.Landsat.simpleCloudScore())이 포함되어 있습니다. Landsat TOA 반사율 이미지를 입력으로 사용하고 cloud라는 밴드를 추가합니다. 이 밴드는 픽셀의 흐림 정도를 0에서 100까지 나타내는 지수로, 각각 흐림이 가장 적은 것부터 가장 많은 것까지 나타냅니다. 컬렉션에 매핑된 함수를 수정하면 클라우드 색인에서 임의의 기준점 (20)을 사용하여 차트를 약간 정리할 수 있습니다.
이 코드와 이전에 사용한 코드의 유일한 차이점은 이제 클라우드 마스크 처리된 컬렉션을 사용한다는 것입니다. Export 패키지를 사용하여 이 데이터의 하위 집합 (리전으로 정의됨)을 내보낼 수 있습니다. (Earth Engine에서 래스터 및 벡터 데이터 내보내기 자세히 알아보기) 예를 들어 다른 문서에 쉽게 삽입할 수 있는 이미지를 내보내려면 이전에 했던 것처럼 시각화 이미지를 만들고 Google Drive 폴더로 내보냅니다.
이 코드를 실행하면 작업 탭에 새 작업이 생성됩니다.
내보내기 구성 대화상자를 실행하려면 작업 탭에서 실행 버튼을 클릭합니다. 작업을 구성한 후 대화상자에서 실행 버튼을 클릭하여 내보내기를 시작합니다. 하지만 그 전에 다음 사항을 주의하세요.
region 인수를 사용하지 않고 내보낼 때 주의해야 하는 이유는 scale 값을 비교적 작은 값으로 설정하고 지도를 넓은 영역으로 축소하면 매우 큰 이미지가 Drive 폴더로 내보내질 수 있기 때문입니다. 자세한 내용과 가능한 구성 매개변수 목록은 문서 탭의 Export.image.toDrive() 문서를 참고하세요.
이상으로 Earth Engine API 소개를 마칩니다. 이제 가장 일반적인 Earth Engine 기능을 많이 살펴봤으므로 더 복잡한 분석을 자신 있게 진행할 수 있습니다. 문서를 읽고포럼에서 다른 질문에 대한 답변을 검색하세요. 즐겁게 코딩해 보세요!
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[[["\u003cp\u003eThis tutorial explains how to export Earth Engine analysis results, like charts and images, for use in external reports or publications.\u003c/p\u003e\n"],["\u003cp\u003eIt demonstrates charting NDVI trends over time using \u003ccode\u003eui.Chart.image.series()\u003c/code\u003e, including applying cloud masking for data refinement.\u003c/p\u003e\n"],["\u003cp\u003eUsers learn to export images, such as a greenest-pixel composite, to Google Drive using the \u003ccode\u003eExport.image.toDrive()\u003c/code\u003e function, emphasizing the importance of specifying a region to control image size.\u003c/p\u003e\n"],["\u003cp\u003eThe tutorial highlights the need for cloud masking to improve data quality and provides a basic example using \u003ccode\u003eee.Algorithms.Landsat.simpleCloudScore()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt encourages further exploration of Earth Engine functionalities through documentation and the user forum.\u003c/p\u003e\n"]]],[],null,["# Exporting Charts and Images\n\nEarth Engine is a powerful analytical tool, but you may have need to export the results\nof your analysis in order to embed charts, images, maps, etc. into reports or\npublications. In this section, you will learn how to create charts and images\nthat can be exported and viewed in other software. Recall that in the\n[previous section](/earth-engine/tutorials/tutorial_api_06), you used code like the following to add an\nNDVI band to every image in a collection, where the `l8` variable references the\n[Landsat 8 TOA reflectance\ncollection](/earth-engine/datasets/catalog/LANDSAT_LC8_L1T_TOA):\n\n### Code Editor (JavaScript)\n\n```javascript\n// Import the Landsat 8 TOA image collection.\nvar l8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA');\n\n// Map a function over the Landsat 8 TOA collection to add an NDVI band.\nvar withNDVI = l8.map(function(image) {\n var ndvi = image.normalizedDifference(['B5', 'B4']).rename('NDVI');\n return image.addBands(ndvi);\n});\n```\n\nCharting\n--------\n\nSuppose that what you want is actually a chart of NDVI over time at a given location. To\nmake such a chart, the first step is to choose a location of interest. Create a point\nby getting the point drawing tool ()\nand make a single point geometry in your area of interest. (If you already have imports,\nhover on **Geometry Imports** and click **+ new layer** first).\nLocate the point in an area of agriculture, deciduous forest, annual grassland or some\nother land cover with an annual cycle). Name the import `roi`. (See\n[this page](/earth-engine/guides/geometries) for information about creating geometries\nprogrammatically).\n\nNow let's use the `roi` point to make a chart of NDVI over time in the pixel\nunder that point. The way to make charts in Earth Engine is with the `ui.Chart`\npackage. ([Learn more about making charts in Earth Engine](/earth-engine/guides/charts)).\nSpecifically, to make a chart over time, you can use the\n`ui.Chart.image.series()` method:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a chart.\nvar chart = ui.Chart.image.series({\n imageCollection: withNDVI.select('NDVI'),\n region: roi,\n reducer: ee.Reducer.first(),\n scale: 30\n}).setOptions({title: 'NDVI over time'});\n\n// Display the chart in the console.\nprint(chart);\n```\n\nFor the `roi` geometry, we chose a point in an agricultural area, resulting\nin a chart that looks something like Figure 10. Note that the parameters to the chart\nconstructor include a reducer and scale like `reduceRegion()`. Since the\npoint we are providing as a region can only intersect one pixel, it suffices to use the\n'first' reducer. If you have a larger region, you should use a 'mean' or other reducer\nthat specifies how to aggregate pixels. Also note that to visualize a chart, all you\nhave to do is print it.\nFigure 10. Chart of Landsat NDVI over time at a point geometry. **Note:** The upper right corner of the chart contains a little pop-out icon (open_in_new). Click that icon to get a new tab with a version of the chart that can be downloaded in a variety of formats. See the `ui.Chart` section of the **Docs** tab for a complete list of the charting options in Earth Engine.\n\nDigression: Simple Cloud Masking for Landsat\n--------------------------------------------\n\nSomething you may have noticed about this chart is that the time series of NDVI values\nat the point looks a little noisy. This is likely due to clouds. To ameliorate this\neffect, Earth Engine includes a cloud-masking algorithm for Landsat sensors with a\nthermal band: `ee.Algorithms.Landsat.simpleCloudScore()`. It takes a Landsat TOA\nreflectance image as input and adds a band named `cloud` which is an index\nof cloudiness in the pixel from zero to 100, from least to most cloudy, respectively. By\nmodifying the function you mapped over the collection, you can use an arbitrary\nthreshold (20) on the cloud index to clean up the chart a bit:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar cloudlessNDVI = l8.map(function(image) {\n // Get a cloud score in [0, 100].\n var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');\n\n // Create a mask of cloudy pixels from an arbitrary threshold.\n var mask = cloud.lte(20);\n\n // Compute NDVI.\n var ndvi = image.normalizedDifference(['B5', 'B4']).rename('NDVI');\n\n // Return the masked image with an NDVI band.\n return image.addBands(ndvi).updateMask(mask);\n});\n\nprint(ui.Chart.image.series({\n imageCollection: cloudlessNDVI.select('NDVI'),\n region: roi,\n reducer: ee.Reducer.first(),\n scale: 30\n}).setOptions({title: 'Cloud-masked NDVI over time'}));\n```\n\nThe cloud-masked result is illustrated in Figure 11. Note that the time series looks a\nlittle smoother, but may still contain pixels affected by clouds. Adjust the threshold\non the cloud index and observe the charted time series to learn how this threshold can\naffect your results.\nFigure 11. Chart of cloud-masked NDVI over time at a point geometry.\n\nExporting Images\n----------------\n\nYou have seen a way to export a chart of data computed by Earth Engine, but what about a\nwhole image? Suppose, for example that you have built a greenest-pixel composite\n[as discussed in the previous\nsection](/earth-engine/tutorials/tutorial_api_06#make-a-greenest-pixel-composite):\n\n### Code Editor (JavaScript)\n\n```javascript\nvar greenest = cloudlessNDVI.qualityMosaic('NDVI');\n```\n\nThe only difference in this code from what you did previously is that now we're using\nthe cloud masked collection. You can export a subset (defined by a region) of this\nusing the `Export` package. ([Learn more about exporting\nraster and vector data from Earth Engine](/earth-engine/guides/exporting).) For example, to export an image that can be\neasily embedded in other docs, let's create a visualization image,\n[as you've done previously](/earth-engine/tutorials/tutorial_api_05#mosaicking), an Export it to your\nGoogle Drive folder:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a 3-band, 8-bit, color-IR composite to export.\nvar visualization = greenest.visualize({\n bands: ['B5', 'B4', 'B3'],\n max: 0.4\n});\n\n// Create a task that you can launch from the Tasks tab.\nExport.image.toDrive({\n image: visualization,\n description: 'Greenest_pixel_composite',\n scale: 30\n});\n```\n\nWhen you run this code, note that a new task is created in the **Tasks** tab.\nTo launch the export configuration dialog, click the **RUN** button in the\n**Tasks** tab. Once you've configured the task, click the **Run**\nbutton in the dialog to start the export. But before you do that, be warned:\n| **Caution:** If you don't specify a region, the Map bounds at the time the script is run will be used!\n\nThe reason you should exercise caution when exporting without a `region`\nargument is that if you set a relatively small value for `scale`, and the\nMap is zoomed out to large area, then you will export a potentially *very* large\nimage to your Drive folder. See the `Export.image.toDrive()` docs in the\n**Docs** tab for more details and a list of possible configuration parameters.\n\nThat concludes this introduction to the Earth Engine API! You have now seen much of\nthe most common Earth Engine functionality and should be able to confidently proceed to\nmore complex analyses. Be sure to [read the docs](/earth-engine/guides) and search the\n[forum](https://groups.google.com/forum/#!forum/google-earth-engine-developers)\nfor answers to other questions. Happy coding! \n[arrow_backPrevious page](/earth-engine/tutorials/tutorial_api_06)"]]