ee.Terrain.products

지형 DEM에서 경사, 사면, 간단한 음영을 계산합니다.

미터로 측정된 단일 고도 밴드가 포함된 이미지 또는 밴드가 두 개 이상인 경우 'elevation'이라는 이름의 밴드가 포함된 이미지를 예상합니다. 시각화를 위해 'slope' 및 'aspect'라는 출력 밴드를 도 단위로 측정하고 'hillshade'라는 부호 없는 바이트 출력 밴드를 추가합니다. 다른 모든 밴드와 메타데이터는 입력 이미지에서 복사됩니다. 로컬 그라데이션은 각 픽셀의 4방향 연결 이웃을 사용하여 계산되므로 이미지의 가장자리 주변에 누락된 값이 발생합니다.

사용반환 값
ee.Terrain.products(input)이미지
인수유형세부정보
input이미지고도 이미지(미터)입니다.

코드 편집기 (JavaScript)

// A digital elevation model.
var dem = ee.Image('NASA/NASADEM_HGT/001').select('elevation');

// Calculate slope. Units are degrees, range is [0,90).
var slope = ee.Terrain.slope(dem);

// Calculate aspect. Units are degrees where 0=N, 90=E, 180=S, 270=W.
var aspect = ee.Terrain.aspect(dem);

// Display slope and aspect layers on the map.
Map.setCenter(-123.457, 47.815, 11);
Map.addLayer(slope, {min: 0, max: 89.99}, 'Slope');
Map.addLayer(aspect, {min: 0, max: 359.99}, 'Aspect');

// Use the ee.Terrain.products function to calculate slope, aspect, and
// hillshade simultaneously. The output bands are appended to the input image.
// Hillshade is calculated based on illumination azimuth=270, elevation=45.
var terrain = ee.Terrain.products(dem);
print('ee.Terrain.products bands', terrain.bandNames());
Map.addLayer(terrain.select('hillshade'), {min: 0, max: 255}, 'Hillshade');

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

# A digital elevation model.
dem = ee.Image('NASA/NASADEM_HGT/001').select('elevation')

# Calculate slope. Units are degrees, range is [0,90).
slope = ee.Terrain.slope(dem)

# Calculate aspect. Units are degrees where 0=N, 90=E, 180=S, 270=W.
aspect = ee.Terrain.aspect(dem)

# Display slope and aspect layers on the map.
m = geemap.Map()
m.set_center(-123.457, 47.815, 11)
m.add_layer(slope, {'min': 0, 'max': 89.99}, 'Slope')
m.add_layer(aspect, {'min': 0, 'max': 359.99}, 'Aspect')

# Use the ee.Terrain.products function to calculate slope, aspect, and
# hillshade simultaneously. The output bands are appended to the input image.
# Hillshade is calculated based on illumination azimuth=270, elevation=45.
terrain = ee.Terrain.products(dem)
display('ee.Terrain.products bands', terrain.bandNames())
m.add_layer(terrain.select('hillshade'), {'min': 0, 'max': 255}, 'Hillshade')
m