Earth Engine의 tileScale 이해

Sep 05 2020

같은 많은 어스 엔진 기능에서 Image.reduceRegionsImage.sample,라는 주장이있다 tileScale. API 문서는 일반적으로 다음과 같이 해석합니다.

집계 타일 크기를 줄이는 데 사용되는 배율 인수입니다. 더 큰 tileScale (예 : 2 또는 4)을 사용하면 기본값으로 메모리가 부족한 계산이 가능할 수 있습니다.

이것은 잘 문서화되어있는 것처럼 보이지만 계산의 최종 결과에 대한 tileScale의 영향을 여전히 이해하지 못합니다.

  • 무엇을 tileScale합니까?
  • tileScale계산을 수행하기 전에 이미지를 청크 합니까 ?
  • 규모에 영향을 미칩니 까?

다음은 작업 할 코드 샘플입니다 ( code link ).

// Getting the image of the region of interest
var roi = ee.Geometry.Point([1.864578244475683, 14.492292970253338]);
var image = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
                .filterDate('2019-01-01', '2019-01-31')
                .filterBounds(roi)
                .select(['B5', 'B4', 'B3'])
                .toBands()
                .rename(['B5', 'B4', 'B3']);
                
// Checking it out
print(image);

// Define the visualization parameters.
var vizParams = {
  bands: ['B5', 'B4', 'B3'],
  min: 0,
  max: 0.5,
  gamma: [0.95, 1.1, 1]
};

// Center the map and display the image.
Map.centerObject(image, 9);
Map.addLayer(image, vizParams, 'false color composite');

// Computing the band means at 30 meters and tileScale of 1: (Computation succeeded)
var control = image.reduceRegion({
  reducer:ee.Reducer.mean(),
  scale    :  30,
  tileScale:   1, 
  maxPixels:1e13
});

print(control, 'first scenario');

// Computing the band means at 5 meters and tileScale of 1: (Computation succeeded)
var scenario2 = image.reduceRegion({
  reducer:ee.Reducer.mean(),
  scale:        5,
  tileScale:    1, 
  maxPixels: 1e13
});

print(scenario2, 'second scenario');

// Computing the band means at 5 meters and tileScale of 16: (Computation Error: Computation timed out.)
var scenario3 = image.reduceRegion({
  reducer:ee.Reducer.mean(),
  scale:        5,
  tileScale:   16, 
  maxPixels: 1e13
});

print(scenario3, 'third scenario');

답변

3 KevinReid Sep 05 2020 at 00:13

tileScale의 기능은 무엇입니까? tileScale은 계산을 수행하기 전에 이미지를 청크합니까?

예.

와 같은 작업을 수행 할 때마다 reduceRegion이미지에서 하나 이상의 축소 된 값을 계산할 때 리듀서로 들어가는 이미지 픽셀은 타일로 계산됩니다 (지도에서보기에 사용되는 타일처럼), 리듀서는 다음과 같습니다. 중간 결과를 생성하기 위해 해당 픽셀 타일에 적용된 다음 중간 결과가 함께 결합됩니다.

더 높게 설정하면 tileScale해당 타일의 크기가 줄어 듭니다. 이는 다음을 의미합니다.

  • 각 타일에서 사용되는 메모리가 적으므로 계산시 메모리가 부족할 가능성이 적습니다.
  • 더 많은 타일이 있으므로 설정하는 데 더 많은 시간이 걸립니다 (따라서 계산 시간이 더 오래 걸립니다).

규모에 영향을 미칩니 까?

이미지의 해상도 / 픽셀 크기를 의미하는 경우 : 아니요. 계산이 성공하면 결과는 항상 동일해야합니다 tileScale(부동 소수점 연산 순서로 인한 작은 차이 제외).