ImageCollection 차트

ui.Chart.image 모듈에는 ImageCollection 내 이미지의 시공간 감소 결과에서 차트를 렌더링하기 위한 함수 집합이 포함되어 있습니다. 함수를 선택하면 차트의 데이터 배열이 결정됩니다. 즉, x축 및 y축 값을 정의하는 항목과 계열을 정의하는 항목이 결정됩니다. 다음 함수 설명과 예시를 사용하여 목적에 가장 적합한 함수를 결정하세요.

차트 함수

다음 플롯 다이어그램을 시각적 가이드로 사용하여 각 함수가 차트에서 시공간 이미지 모음 감소 결과를 정렬하는 방식(즉, x 값, y 값, 계열을 정의하는 요소)을 이해합니다. ui.Chart.image.doySeries* 함수는 두 개의 리듀서를 사용합니다. 하나는 지역 감소 (regionReducer)를 위한 것이고 다른 하나는 연간 일치하는 일수 감소 (yearReducer)를 위한 것입니다. 다음 섹션의 예에서는 이 두 매개변수의 인수로 ee.Reducer.mean()를 사용합니다.

ui.Chart.image.series

이미지 날짜는 system:time_start 속성에 따라 x축에 표시됩니다. 시리즈는 이미지 밴드로 정의됩니다. Y축 값은 단일 지역의 이미지 감소 수치(날짜별)입니다.

ui.Chart.image.seriesByRegion

이미지 날짜는 system:time_start 속성에 따라 x축에 표시됩니다. 시리즈는 지역별로 정의됩니다. Y축 값은 단일 이미지 밴드의 이미지 감소를 날짜별로 나타낸 것입니다.

ui.Chart.image.doySeries

이미지 일 수는 system:time_start 속성에 따라 x축에 표시됩니다. 시리즈는 이미지 밴드로 정의됩니다. Y축 값은 특정 지역의 이미지 픽셀 감소량으로, 일 수를 기준으로 그룹화됩니다.

ui.Chart.image.doySeriesByYear

이미지 일 수는 system:time_start 속성에 따라 x축에 표시됩니다. 시리즈는 ImageCollection에 있는 연도로 정의됩니다. Y축 값은 선택한 이미지 밴드의 특정 지역에서 이미지 픽셀이 감소한 값으로, 일 수를 기준으로 그룹화됩니다.

ui.Chart.image.doySeriesByRegion

이미지 일 수는 system:time_start 속성에 따라 x축에 표시됩니다. 시리즈는 지역별로 정의됩니다. Y축 값은 선택한 이미지 밴드의 특정 지역에서 이미지 픽셀이 감소한 값으로, 일 수를 기준으로 그룹화됩니다.

예시 데이터

다음 예에서는 MODIS 기반 NDVI 및 EVI의 시계열인 ImageCollection를 사용합니다. 지역 축소는 데모 목적으로 설계된 FeatureCollection의 지형지물로 정의된 생태 지역에서 실행됩니다(제작 방법 알아보기).

ui.Chart.image.series

ui.Chart.image.series를 사용하여 지정된 지역의 이미지 시계열을 표시합니다. 각 이미지 밴드는 고유한 계열로 표시됩니다. 개별 이미지 밴드의 시계열을 비교하는 데 유용합니다. 여기서는 NDVI 및 EVI 식생 지수를 나타내는 밴드가 포함된 MODIS 이미지 모음을 표시합니다. 모든 이미지 관측 날짜는 x축에 포함되며, 숲 생태 지역을 교차하는 픽셀의 평균 감소량은 y축을 정의합니다.

코드 편집기 (JavaScript)

// Import the example feature collection and subset the forest feature.
var forest = ee.FeatureCollection('projects/google/charts_feature_example')
                 .filter(ee.Filter.eq('label', 'Forest'));

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .series({
          imageCollection: vegIndices,
          region: forest,
          reducer: ee.Reducer.mean(),
          scale: 500,
          xProperty: 'system:time_start'
        })
        .setSeriesNames(['EVI', 'NDVI'])
        .setOptions({
          title: 'Average Vegetation Index Value by Date for Forest',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'Vegetation index (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['e37d05', '1d6b99'],
          curveType: 'function'
        });
print(chart);

ui.Chart.image.seriesByRegion

ui.Chart.image.seriesByRegion를 사용하여 여러 지역의 단일 이미지 밴드 시계열을 표시합니다. 각 지역은 고유한 시리즈로 표시됩니다. 여러 지역에서 단일 밴드의 시계열을 비교하는 데 유용합니다. 여기서는 NDVI 시계열을 나타내는 MODIS 이미지 모음을 세 개의 생태 지역별로 표시합니다. 모든 이미지 관측 날짜는 x축에 포함되며, 숲, 사막, 초원 생태 지역을 교차하는 픽셀의 평균 감소는 y축 계열을 정의합니다.

코드 편집기 (JavaScript)

// Import the example feature collection.
var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example');

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .seriesByRegion({
          imageCollection: vegIndices,
          band: 'NDVI',
          regions: ecoregions,
          reducer: ee.Reducer.mean(),
          scale: 500,
          seriesProperty: 'label',
          xProperty: 'system:time_start'
        })
        .setOptions({
          title: 'Average NDVI Value by Date',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'NDVI (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['f0af07', '0f8755', '76b349'],
        });
print(chart);

ui.Chart.image.doySeries

ui.Chart.image.doySeries를 사용하여 특정 지역의 일 수를 나타내는 시계열을 표시합니다. 각 이미지 밴드는 고유한 계열로 표시됩니다. 이 예와 같이 MODIS의 연간 평균 NDVI 및 EVI 프로필을 비교하기 위해 여러 해에 걸쳐 같은 날짜에 발생한 관측을 줄이는 데 유용합니다.

코드 편집기 (JavaScript)

// Import the example feature collection and subset the grassland feature.
var grassland = ee.FeatureCollection('projects/google/charts_feature_example')
                    .filter(ee.Filter.eq('label', 'Grassland'));

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .doySeries({
          imageCollection: vegIndices,
          region: grassland,
          regionReducer: ee.Reducer.mean(),
          scale: 500,
          yearReducer: ee.Reducer.mean(),
          startDay: 1,
          endDay: 365
        })
        .setSeriesNames(['EVI', 'NDVI'])
        .setOptions({
          title: 'Average Vegetation Index Value by Day of Year for Grassland',
          hAxis: {
            title: 'Day of year',
            titleTextStyle: {italic: false, bold: true}
          },
          vAxis: {
            title: 'Vegetation index (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['e37d05', '1d6b99'],
        });
print(chart);

ui.Chart.image.doySeriesByYear

ui.Chart.image.doySeriesByYear를 사용하여 지정된 지역 및 이미지 밴드의 일 년 시계열을 표시합니다. 여기서 이미지 모음의 각 연도는 고유한 시리즈로 표시됩니다. 연도별 연간 시계열을 비교하는 데 유용합니다. 예를 들어 이 예에서는 2012년과 2019년의 초원 생태 지역의 연간 MODIS 파생 NDVI 프로필을 표시하여 편리하게 전년 대비 해석을 제공합니다.

코드 편집기 (JavaScript)

// Import the example feature collection and subset the grassland feature.
var grassland = ee.FeatureCollection('projects/google/charts_feature_example')
                    .filter(ee.Filter.eq('label', 'Grassland'));

// Load MODIS vegetation indices data and subset years 2012 and 2019.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.or(
                         ee.Filter.date('2012-01-01', '2013-01-01'),
                         ee.Filter.date('2019-01-01', '2020-01-01')))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart = ui.Chart.image
                .doySeriesByYear({
                  imageCollection: vegIndices,
                  bandName: 'NDVI',
                  region: grassland,
                  regionReducer: ee.Reducer.mean(),
                  scale: 500,
                  sameDayReducer: ee.Reducer.mean(),
                  startDay: 1,
                  endDay: 365
                })
                .setOptions({
                  title: 'Average NDVI Value by Day of Year for Grassland',
                  hAxis: {
                    title: 'Day of year',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  vAxis: {
                    title: 'NDVI (x1e4)',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  lineWidth: 5,
                  colors: ['39a8a7', '9c4f97'],
                });
print(chart);

ui.Chart.image.doySeriesByRegion

ui.Chart.image.doySeriesByRegion를 사용하여 여러 지역의 단일 이미지 밴드 일 일자 시계열을 표시합니다. 여기서 각 고유한 지역은 고유한 시리즈로 표시됩니다. 지역 간의 연간 단일 밴드 시계열을 비교하는 데 유용합니다. 예를 들어 이 예에서는 숲, 사막, 초원 생태 지역의 연간 MODIS 파생 NDVI 프로필을 표시하여 지역별 NDVI 응답을 편리하게 비교할 수 있습니다. 같은 날에 발생한 연내 관측값은 평균을 뺀 값으로 줄어듭니다.

코드 편집기 (JavaScript)

// Import the example feature collection.
var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example');

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart = ui.Chart.image
                .doySeriesByRegion({
                  imageCollection: vegIndices,
                  bandName: 'NDVI',
                  regions: ecoregions,
                  regionReducer: ee.Reducer.mean(),
                  scale: 500,
                  yearReducer: ee.Reducer.mean(),
                  seriesProperty: 'label',
                  startDay: 1,
                  endDay: 365
                })
                .setOptions({
                  title: 'Average NDVI Value by Day of Year',
                  hAxis: {
                    title: 'Day of year',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  vAxis: {
                    title: 'NDVI (x1e4)',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  lineWidth: 5,
                  colors: ['f0af07', '0f8755', '76b349'],
                });
print(chart);