Die Earth Engine führt
nicht kommerzielle Kontingentstufen ein, um gemeinsam genutzte Rechenressourcen zu schützen und eine zuverlässige Leistung für alle sicherzustellen. Für alle nicht kommerziellen Projekte muss bis zum
27. April 2026 eine Kontingentstufe ausgewählt werden. Geschieht dies nicht, wird standardmäßig die Stufe „Community“ verwendet. Die Stufenkontingente treten für alle Projekte (unabhängig vom Datum der Stufenauswahl) am
27. April 2026 in Kraft.
Weitere Informationen
Feedback geben
ee.Terrain.slope
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Berechnet die Neigung in Grad aus einem DEM für das Gelände.
Der lokale Gradient wird anhand der vier direkt benachbarten Pixel jedes Pixels berechnet. Daher treten fehlende Werte an den Rändern eines Bildes auf.
Nutzung Ausgabe ee.Terrain.slope(input)Bild
Argument Typ Details inputBild Ein Höhenbild in Metern.
Beispiele
Code-Editor (JavaScript)
// Demonstrate ee.Terrain functions with single-image and collection DEMs.
// DEMs in Earth Engine are often distributed as single images per asset
// (e.g., NASA/NASADEM_HGT/001) or as collections of tiled images that need
// to be mosaicked (e.g., COPERNICUS/DEM/GLO30). Terrain analysis functions
// compute values based on neighboring pixels, so care must be taken to
// select and prepare DEM inputs appropriately.
// 1. Single DEM image asset.
// Assets like NASADEM are presented as single images covering large areas.
// They generally have a single projection and can be used in terrain analysis
// with no preprocessing.
var nasadem = ee . Image ( 'NASA/NASADEM_HGT/001' ). select ( 'elevation' );
// Calculate slope: degrees, range [0, 90).
var nasademSlope = ee . Terrain . slope ( nasadem );
// Visualization parameters.
var elevationVis = {
min : 0.0 ,
max : 3000.0 ,
palette :
[ '333399' , '00a2e5' , '55dd77' , 'ffff99' , 'aa926b' , 'aa928d' , 'ffffff' ]
};
var slopeVis = { min : 0.0 , max : 60.0 };
// Display layers.
Map . setCenter ( - 121.603 , 47.702 , 9 );
Map . addLayer ( nasadem , elevationVis , 'NASADEM Elevation' , false );
Map . addLayer ( nasademSlope , slopeVis , 'NASADEM Slope' );
// 2. Mosaicked DEM ImageCollection asset.
// In contrast to single-image assets like NASADEM, some DEMs like GLO30 are
// provided as a collection of images that need to be mosaicked before use.
// We use this mosaicked DEM for the terrain calculations below.
var glo30collection = ee . ImageCollection ( 'COPERNICUS/DEM/GLO30' );
// When mosaicking a DEM collection that will be used for terrain analysis,
// it is best practice to set the mosaic's default projection to the native
// projection of the DEM tiles. If you don't, Earth Engine's default
// projection for mosaics (EPSG:4326 at 1-degree scale) is used, which is
// often too coarse for analysis and can lead to resampling artifacts if
// the result is reprojected to a different CRS during computation.
// See:
// https://developers.google.com/earth-engine/guides/projections#reprojecting
var glo30Proj = glo30collection . first (). projection ();
var glo30Image =
glo30collection . select ( 'DEM' ). mosaic (). setDefaultProjection ( glo30Proj );
// Calculate slope.
var glo30Slope = ee . Terrain . slope ( glo30Image );
// Display layers.
Map . addLayer ( glo30Image , elevationVis , 'GLO30 Elevation' , false );
Map . addLayer ( glo30Slope , slopeVis , 'GLO30 Slope' );
Python einrichten
Weitere Informationen zur Python API und zur Verwendung von geemap für die interaktive Entwicklung finden Sie auf der Seite
Python-Umgebung .
import ee
import geemap.core as geemap
Colab (Python)
# Demonstrate ee.Terrain functions with single-image and collection DEMs.
# DEMs in Earth Engine are often distributed as single images per asset
# (e.g., NASA/NASADEM_HGT/001) or as collections of tiled images that need
# to be mosaicked (e.g., COPERNICUS/DEM/GLO30). Terrain analysis functions
# compute values based on neighboring pixels, so care must be taken to
# select and prepare DEM inputs appropriately.
# 1. Single DEM image asset.
# Assets like NASADEM are presented as single images covering large areas.
# They generally have a single projection and can be used in terrain analysis
# with no preprocessing.
nasadem = ee . Image ( 'NASA/NASADEM_HGT/001' ) . select ( 'elevation' )
# Calculate slope: degrees, range [0, 90).
nasadem_slope = ee . Terrain . slope ( nasadem )
# Visualization parameters.
elevation_vis = {
'min' : 0.0 ,
'max' : 3000.0 ,
'palette' : [
'333399' ,
'00a2e5' ,
'55dd77' ,
'ffff99' ,
'aa926b' ,
'aa928d' ,
'ffffff' ,
],
}
slope_vis = { 'min' : 0.0 , 'max' : 60.0 }
# Display layers.
m = geemap . Map ()
m . set_center ( - 121.603 , 47.702 , 9 )
m . add_layer ( nasadem , elevation_vis , 'NASADEM Elevation' , False )
m . add_layer ( nasadem_slope , slope_vis , 'NASADEM Slope' )
# 2. Mosaicked DEM ImageCollection asset.
# In contrast to single-image assets like NASADEM, some DEMs like GLO30 are
# provided as a collection of images that need to be mosaicked before use.
# We use this mosaicked DEM for the terrain calculations below.
glo30_collection = ee . ImageCollection ( 'COPERNICUS/DEM/GLO30' )
# When mosaicking a DEM collection that will be used for terrain analysis,
# it is best practice to set the mosaic's default projection to the native
# projection of the DEM tiles. If you don't, Earth Engine's default
# projection for mosaics (EPSG:4326 at 1-degree scale) is used, which is
# often too coarse for analysis and can lead to resampling artifacts if
# the result is reprojected to a different CRS during computation.
# See:
# https://developers.google.com/earth-engine/guides/projections#reprojecting
glo30_proj = glo30_collection . first () . projection ()
glo30_image = (
glo30_collection . select ( 'DEM' ) . mosaic () . setDefaultProjection ( glo30_proj )
)
# Calculate slope.
glo30_slope = ee . Terrain . slope ( glo30_image )
# Display layers.
m . add_layer ( glo30_image , elevation_vis , 'GLO30 Elevation' , False )
m . add_layer ( glo30_slope , slope_vis , 'GLO30 Slope' )
m
Feedback geben
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers . Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2026-04-29 (UTC).
Haben Sie Feedback für uns?
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2026-04-29 (UTC)."],[],[]]