@@ -1114,9 +1114,9 @@ def get_terrain_attribute(
1114
1114
@overload
1115
1115
def slope (
1116
1116
dem : NDArrayf | MArrayf ,
1117
- resolution : float | tuple [float , float ] | None = None ,
1118
1117
method : str = "Horn" ,
1119
1118
degrees : bool = True ,
1119
+ resolution : float | tuple [float , float ] | None = None ,
1120
1120
use_richdem : bool = False ,
1121
1121
) -> NDArrayf :
1122
1122
...
@@ -1125,19 +1125,19 @@ def slope(
1125
1125
@overload
1126
1126
def slope (
1127
1127
dem : RasterType ,
1128
- resolution : float | tuple [float , float ] | None = None ,
1129
1128
method : str = "Horn" ,
1130
1129
degrees : bool = True ,
1130
+ resolution : float | tuple [float , float ] | None = None ,
1131
1131
use_richdem : bool = False ,
1132
1132
) -> Raster :
1133
1133
...
1134
1134
1135
1135
1136
1136
def slope (
1137
1137
dem : NDArrayf | MArrayf | RasterType ,
1138
- resolution : float | tuple [float , float ] | None = None ,
1139
1138
method : str = "Horn" ,
1140
1139
degrees : bool = True ,
1140
+ resolution : float | tuple [float , float ] | None = None ,
1141
1141
use_richdem : bool = False ,
1142
1142
) -> NDArrayf | Raster :
1143
1143
"""
@@ -1147,9 +1147,9 @@ def slope(
1147
1147
http://dx.doi.org/10.1002/esp.3290120107.
1148
1148
1149
1149
:param dem: The DEM to generate a slope map for.
1150
- :param resolution: The X/Y or (X, Y) resolution of the DEM.
1151
1150
:param method: Method to calculate slope: "Horn" or "ZevenbergThorne".
1152
1151
:param degrees: Whether to use degrees or radians (False means radians).
1152
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array.
1153
1153
:param use_richdem: Whether to use RichDEM to compute the attribute.
1154
1154
1155
1155
:examples:
@@ -1205,6 +1205,8 @@ def aspect(
1205
1205
1206
1206
0=N, 90=E, 180=S, 270=W.
1207
1207
1208
+ Note that aspect, representing only the orientation of the slope, is independent of the grid resolution.
1209
+
1208
1210
:param dem: The DEM to calculate the aspect from.
1209
1211
:param method: Method to calculate aspect: "Horn" or "ZevenbergThorne".
1210
1212
:param degrees: Whether to use degrees or radians (False means radians).
@@ -1234,11 +1236,11 @@ def aspect(
1234
1236
@overload
1235
1237
def hillshade (
1236
1238
dem : NDArrayf | MArrayf ,
1237
- resolution : float | tuple [float , float ] | None = None ,
1238
1239
method : str = "Horn" ,
1239
1240
azimuth : float = 315.0 ,
1240
1241
altitude : float = 45.0 ,
1241
1242
z_factor : float = 1.0 ,
1243
+ resolution : float | tuple [float , float ] | None = None ,
1242
1244
use_richdem : bool = False ,
1243
1245
) -> NDArrayf :
1244
1246
...
@@ -1247,23 +1249,23 @@ def hillshade(
1247
1249
@overload
1248
1250
def hillshade (
1249
1251
dem : RasterType ,
1250
- resolution : float | tuple [float , float ] | None = None ,
1251
1252
method : str = "Horn" ,
1252
1253
azimuth : float = 315.0 ,
1253
1254
altitude : float = 45.0 ,
1254
1255
z_factor : float = 1.0 ,
1256
+ resolution : float | tuple [float , float ] | None = None ,
1255
1257
use_richdem : bool = False ,
1256
1258
) -> RasterType :
1257
1259
...
1258
1260
1259
1261
1260
1262
def hillshade (
1261
1263
dem : NDArrayf | MArrayf ,
1262
- resolution : float | tuple [float , float ] | None = None ,
1263
1264
method : str = "Horn" ,
1264
1265
azimuth : float = 315.0 ,
1265
1266
altitude : float = 45.0 ,
1266
1267
z_factor : float = 1.0 ,
1268
+ resolution : float | tuple [float , float ] | None = None ,
1267
1269
use_richdem : bool = False ,
1268
1270
) -> NDArrayf | RasterType :
1269
1271
"""
@@ -1272,11 +1274,11 @@ def hillshade(
1272
1274
Based on Horn (1981), http://dx.doi.org/10.1109/PROC.1981.11918.
1273
1275
1274
1276
:param dem: The input DEM to calculate the hillshade from.
1275
- :param resolution: One or two values specifying the resolution of the DEM.
1276
1277
:param method: Method to calculate the slope and aspect used for hillshading.
1277
1278
:param azimuth: The shading azimuth in degrees (0-360°) going clockwise, starting from north.
1278
1279
:param altitude: The shading altitude in degrees (0-90°). 90° is straight from above.
1279
1280
:param z_factor: Vertical exaggeration factor.
1281
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array.
1280
1282
:param use_richdem: Whether to use RichDEM to compute the slope and aspect used for the hillshade.
1281
1283
1282
1284
@@ -1334,7 +1336,7 @@ def curvature(
1334
1336
See xdem.terrain.get_quadric_coefficients() for more information.
1335
1337
1336
1338
:param dem: The DEM to calculate the curvature from.
1337
- :param resolution: The X/Y resolution of the DEM.
1339
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array .
1338
1340
:param use_richdem: Whether to use RichDEM to compute the attribute.
1339
1341
1340
1342
:raises ValueError: If the inputs are poorly formatted.
@@ -1380,7 +1382,7 @@ def planform_curvature(
1380
1382
Based on Zevenbergen and Thorne (1987), http://dx.doi.org/10.1002/esp.3290120107.
1381
1383
1382
1384
:param dem: The DEM to calculate the curvature from.
1383
- :param resolution: The X/Y resolution of the DEM.
1385
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array .
1384
1386
:param use_richdem: Whether to use RichDEM to compute the attribute.
1385
1387
1386
1388
:raises ValueError: If the inputs are poorly formatted.
@@ -1433,7 +1435,7 @@ def profile_curvature(
1433
1435
Based on Zevenbergen and Thorne (1987), http://dx.doi.org/10.1002/esp.3290120107.
1434
1436
1435
1437
:param dem: The DEM to calculate the curvature from.
1436
- :param resolution: The X/Y resolution of the DEM.
1438
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array .
1437
1439
:param use_richdem: Whether to use RichDEM to compute the attribute.
1438
1440
1439
1441
:raises ValueError: If the inputs are poorly formatted.
@@ -1485,7 +1487,7 @@ def maximum_curvature(
1485
1487
Based on Zevenbergen and Thorne (1987), http://dx.doi.org/10.1002/esp.3290120107.
1486
1488
1487
1489
:param dem: The DEM to calculate the curvature from.
1488
- :param resolution: The X/Y resolution of the DEM.
1490
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array .
1489
1491
:param use_richdem: Whether to use RichDEM to compute the attribute.
1490
1492
1491
1493
:raises ValueError: If the inputs are poorly formatted.
@@ -1648,7 +1650,7 @@ def rugosity(
1648
1650
Based on: Jenness (2004), https://doi.org/10.2193/0091-7648(2004)032[0829:CLSAFD]2.0.CO;2.
1649
1651
1650
1652
:param dem: The DEM to calculate the rugosity from.
1651
- :param resolution: The X/Y resolution of the DEM.
1653
+ :param resolution: The X/Y resolution of the DEM, only if passed as an array .
1652
1654
1653
1655
:raises ValueError: If the inputs are poorly formatted.
1654
1656
0 commit comments