ee.Terrain.products
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำนวณความชัน มุม และการแรเงาอย่างง่ายจาก DEM ของภูมิประเทศ
คาดหวังว่าจะมีรูปภาพที่มีแถบความสูงแถบเดียวซึ่งวัดเป็นเมตร หรือหากมีแถบมากกว่า 1 แถบ จะมีแถบหนึ่งชื่อ "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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,[]]