简体   繁体   中英

python calculate slope raster from DEM

I need the slope for 4 points in austria. I have the coordinates and the DEM (from opendata Austria). I found this tutorial ( https://www.earthdatascience.org/tutorials/get-slope-aspect-from-digital-elevation-model/ ) and tried the code. But the results that I get are values like 30000.788... that cannot be degree? do I miss a transformation into meter? I use this code:

import richdem as rd
shasta_dem = rd.LoadGDAL(f'{project_data}dem_au.tif')
slope = rd.TerrainAttribute(shasta_dem, attrib='slope_riserun')
rd.SaveGDAL(f'{project_data}dem_slope.tif', slope)

the picture looks great, but the values... I do not understand them! 奥地利坡度图

The Dem has values from 105 to 3736, if that would be meter it is correct for Austria, but in the describtion it says the DEM scale units are degrees? DEM 奥地利 Can someone explain that to me,please?

For your original question the issue was likely with the scale. In richdem you can use the zscale argument when the pixel resolution unit does not match the elevation unit, for example with the pixel resolution is in degrees (lat/lon) and the elevation unit is in meters.

Here is an explanation from the same function in gdal .

If the horizontal unit of the source DEM is degrees (eg Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet).

I managed to calculate the slope. The problem was the DEM, It had strange dimensions, with another: more precise DEM from open data it worked fine : )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM