简体   繁体   English

使用 R 从 DEM GRID 栅格中获取坡度栅格

[英]Using R to obtain slope raster from DEM GRID raster

After some extensive googling, I wasn't able to find my answer (first time I couldn't surmount the issue by looking at others questions/answers).经过一番广泛的谷歌搜索,我找不到我的答案(第一次我无法通过查看其他问题/答案来解决这个问题)。 I am new to asking questions, so forgive any missteps.我是提问的新手,所以请原谅任何失误。

I am attempting to perform what ArcGIS or QGIS performs with the slope tool, just within R.我试图在 R 内执行 ArcGIS 或 QGIS 使用坡度工具执行的操作。 To do so I have been importing a raster that I exported from ArcGIS in GRID format with the following characteristics:为此,我一直在导入从 ArcGIS 以 GRID 格式导出的栅格,该栅格具有以下特征:

class      : RasterLayer 
dimensions : 821, 581, 477001  (nrow, ncol, ncell)
resolution : 4.996121, 4.996121  (x, y)
extent     : 2832147, 2835049, 14234048, 14238150  (xmin, xmax, ymin, ymax)
crs        : +proj=tmerc +lat_0=34.75 +lon_0=-118.583333333333 +k=0.9999 +x_0=800000.000000001 +y_0=3999999.99999999 +datum=NAD83 +units=us-ft +no_defs 
source     : rr_2020_shell 
names      : rr_2020_shell 
values     : 5623.253, 6401.356  (min, max)

It is already projected in the correct coordinate system (EPSG: 3423) but when I go to find the slope using the following code:它已经投影在正确的坐标系(EPSG:3423)中,但是当我 go 使用以下代码找到斜率时:

RR_2020_Slope = terrain(RR_2020_St1_Raster,'slope', units = 'degrees', neighbors = 8, filename = 'RR_2020_Slope.grd', overwrite = T)

The result is a slope raster that ranges from 0 to 1.28°, which is very different from what I have calculated in ArcGIS using the slope tool.结果是一个范围从 0 到 1.28° 的坡度栅格,这与我在 ArcGIS 中使用坡度工具计算的结果非常不同。 Using the same DEM raster in the same projection in ArcGIS I used the slope tool with an input of 'Degree' for the output measurement, 'Planar' for the method, and 1 for Z factor and my resulting slope raster ranges from 0.001 to 73.396°.在 ArcGIS 中的同一投影中使用相同的 DEM 栅格我使用坡度工具,output 测量的输入为“Degree”,方法为“Planar”,Z 因子为 1,我得到的坡度栅格范围从 0.001 到 73.396 °。

Overall I am wondering where my mistake in R originates from, is it an elevation resolution problem?总的来说,我想知道我在 R 中的错误来自哪里,是高程分辨率问题吗? Are there issues with my projection?我的投影有问题吗? Forgive me, I can't necessarily include the data as they are sensitive materials but perhaps there is a clear and obvious mistake in my approach or assumptions about the functions I have used?原谅我,我不一定包含这些数据,因为它们是敏感材料,但我的方法或对我使用的功能的假设可能存在明显的错误?

The only red flag I see is that you say "it is already projected in the correct coordinate system".我看到的唯一危险信号是您说“它已经投影在正确的坐标系中”。 Projecting raster data degrades the quality.投影栅格数据会降低质量。 As cell values get smoothed, the slopes will get smaller.随着像元值变得平滑,斜率会变小。 This may be particularly pronounced if the relief is at the scale of the cell size (eg sand dunes vs mountain chains).如果地势处于像元大小的尺度(例如沙丘与山脉),这可能会特别明显。 Have you compared with what you get with the original data?你有没有与你得到的原始数据进行比较?

Another source of error could be that the units of the values are different from the units of the coordinate reference system.另一个错误来源可能是值的单位与坐标参考系的单位不同。 But it would appear that in your case both are in feet.但在你的情况下,两者都以英尺为单位。

Can you also try this with terra::terrain() ?你也可以用terra::terrain()试试这个吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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