• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
等值面
博客园    首页    新随笔    联系   管理    订阅  订阅

基于TauDEM进行水文响应单元划分的方法研究 (1)

以下内容来自于GPT:

TauDEM (Terrain Analysis Using Digital Elevation Models) 是一个用于地形分析的开源软件包,广泛应用于水文模型和地形分析中。TauDEM 可以处理数字高程模型(DEM),并通过一系列工具完成流向计算、流量累积、流域划分、河网提取等功能。

以下是详细的 TauDEM 工具使用介绍及其应用案例,包括指定的命令:pitremove、d8flowdir、dinfflowdir、aread8、areadinf、gridnet、threshold、streamnet 和 MoveOutletsToStreams。

1. 安装 TauDEM

Windows:

  1. 下载 TauDEM:
    • 前往 TauDEM 官方网站下载 TauDEM 安装包。
  2. 安装 MPI:
    • TauDEM 需要 MPI。推荐使用 Microsoft MPI,可从 Microsoft MPI 官网 下载。
  3. 配置环境变量:
    • 将 TauDEM 的 bin 目录添加到系统环境变量 PATH 中。

Linux:

  1. 安装依赖项:
    sudo apt-get update
    sudo apt-get install gdal-bin libgdal-dev mpich
    
  2. 下载并编译 TauDEM:
    git clone https://github.com/dtarb/TauDEM.git
    cd TauDEM/src
    make
    sudo make install
    

2. TauDEM 工具及其应用案例

为了详细讲解 TauDEM 工具,并通过 outlet.shp 和 dem.tif 文件划分水文响应单元(多个单元),以下是整个过程和所需命令的详细介绍和案例展示。

前提条件

确保你已经安装了 TauDEM,并准备好 outlet.shp 和 dem.tif 文件。

案例步骤

以下是从 DEM 预处理到划分多个水文响应单元的完整流程:

  1. 填补 DEM 中的空洞
  2. 计算 D8 流向
  3. 计算 D-Infinity 流向
  4. 计算 D8 流量累积
  5. 计算 D-Infinity 流量累积
  6. 计算网格网络参数
  7. 阈值处理以提取河网
  8. 提取流网络
  9. 移动出水口至河道
  10. 划分水文响应单元

Step 1: 填补空洞 (Pit Remove)

mpiexec -n 8 pitremove -z dem.tif -fel dem_filled.tif
  • -z dem.tif: 输入 DEM 文件
  • -fel dem_filled.tif: 输出填补空洞后的 DEM 文件

Step 2: 计算 D8 流向 (D8 Flow Direction)

mpiexec -n 8 d8flowdir -fel dem_filled.tif -p flow_dir_d8.tif -sd8 slope_d8.tif
  • -fel dem_filled.tif: 输入填补空洞后的 DEM 文件
  • -p flow_dir_d8.tif: 输出 D8 流向文件
  • -sd8 slope_d8.tif: 输出坡度文件

Step 3: 计算 D-Infinity 流向 (D-Infinity Flow Direction)

mpiexec -n 8 dinfflowdir -fel dem_filled.tif -ang flow_dir_dinf.tif -slp slope_dinf.tif
  • -fel dem_filled.tif: 输入填补空洞后的 DEM 文件
  • -ang flow_dir_dinf.tif: 输出 D-Infinity 流向文件
  • -slp slope_dinf.tif: 输出坡度文件

Step 4: 计算 D8 流量累积 (D8 Flow Accumulation)

mpiexec -n 8 aread8 -p flow_dir_d8.tif -ad8 flow_acc_d8.tif
  • -p flow_dir_d8.tif: 输入 D8 流向文件
  • -ad8 flow_acc_d8.tif: 输出 D8 流量累积文件

Step 5: 计算 D-Infinity 流量累积 (D-Infinity Flow Accumulation)

mpiexec -n 8 areadinf -ang flow_dir_dinf.tif -sca flow_acc_dinf.tif
  • -ang flow_dir_dinf.tif: 输入 D-Infinity 流向文件
  • -sca flow_acc_dinf.tif: 输出 D-Infinity 流量累积文件

Step 6: 计算网格网络参数 (Grid Network)

mpiexec -n 8 gridnet -p flow_dir_d8.tif -gord grid_order.tif -plen path_length.tif -tlen total_length.tif
  • -p flow_dir_d8.tif: 输入 D8 流向文件
  • -gord grid_order.tif: 输出网络顺序文件
  • -plen path_length.tif: 输出路径长度文件
  • -tlen total_length.tif: 输出总长度文件

Step 7: 阈值处理 (Threshold)

mpiexec -n 8 threshold -ssa flow_acc_d8.tif -src stream_source.tif -thresh 1000
  • -ssa flow_acc_d8.tif: 输入流量累积文件
  • -src stream_source.tif: 输出源流文件
  • -thresh 1000: 阈值(例如 1000)

Step 8: 提取流网络 (Stream Network)

mpiexec -n 8 streamnet -fel dem_filled.tif -p flow_dir_d8.tif -ad8 flow_acc_d8.tif -src stream_source.tif -ord stream_order.tif -tree stream_tree.dat -coord stream_coord.dat -net stream_net.shp
  • -fel dem_filled.tif: 输入填补空洞后的 DEM 文件
  • -p flow_dir_d8.tif: 输入 D8 流向文件
  • -ad8 flow_acc_d8.tif: 输入流量累积文件
  • -src stream_source.tif: 输入源流文件
  • -ord stream_order.tif: 输出流序文件
  • -tree stream_tree.dat: 输出树文件
  • -coord stream_coord.dat: 输出坐标文件
  • -net stream_net.shp: 输出流网络矢量文件

Step 9: 移动出水口至河道 (Move Outlets to Streams)

mpiexec -n 8 MoveOutletsToStreams -p flow_dir_d8.tif -src stream_source.tif -o outlet.shp -om outlet_moved.shp
  • -p flow_dir_d8.tif: 输入 D8 流向文件
  • -src stream_source.tif: 输入源流文件
  • -o outlet.shp: 输入出水口点文件
  • -om outlet_moved.shp: 输出移动后的出水口点文件

Step 10: 划分水文响应单元 (Watershed Delineation)

mpiexec -n 8 gagewatershed -p flow_dir_d8.tif -o outlet_moved.shp -gw watershed.tif
  • -p flow_dir_d8.tif: 输入 D8 流向文件
  • -o outlet_moved.shp: 输入移动后的出水口点文件
  • -gw watershed.tif: 输出流域文件

完整案例总结

以下是从 DEM 预处理到划分多个水文响应单元的完整命令序列:

# Step 1: Fill pits in DEM
mpiexec -n 8 pitremove -z dem.tif -fel dem_filled.tif

# Step 2: Compute D8 Flow Direction
mpiexec -n 8 d8flowdir -fel dem_filled.tif -p flow_dir_d8.tif -sd8 slope_d8.tif

# Step 3: Compute D-Infinity Flow Direction
mpiexec -n 8 dinfflowdir -fel dem_filled.tif -ang flow_dir_dinf.tif -slp slope_dinf.tif

# Step 4: Compute D8 Flow Accumulation
mpiexec -n 8 aread8 -p flow_dir_d8.tif -ad8 flow_acc_d8.tif

# Step 5: Compute D-Infinity Flow Accumulation
mpiexec -n 8 areadinf -ang flow_dir_dinf.tif -sca flow_acc_dinf.tif

# Step 6: Calculate Grid Network
mpiexec -n 8 gridnet -p flow_dir_d8.tif -gord grid_order.tif -plen path_length.tif -tlen total_length.tif

# Step 7: Apply Threshold
mpiexec -n 8 threshold -ssa flow_acc_d8.tif -src stream_source.tif -thresh 1000

# Step 8: Extract Stream Network
mpiexec -n 8 streamnet -fel dem_filled.tif -p flow_dir_d8.tif -ad8 flow_acc_d8.tif -src stream_source.tif -ord stream_order.tif -tree stream_tree.dat -coord stream_coord.dat -net stream_net.shp

# Step 9: Move Outlets to Streams
mpiexec -n 8 MoveOutletsToStreams -p flow_dir_d8.tif -src stream_source.tif -o outlet.shp -om outlet_moved.shp

# Step 10: Delineate Watersheds
mpiexec -n 8 gagewatershed -p flow_dir_d8.tif -o outlet_moved.shp -gw watershed.tif

通过这些步骤,你可以从一个 DEM 文件生成填补空洞后的 DEM、流向、流量累积、河网以及最终的多个水文响应单元。这些单元可以用于进一步的水文分析和建模。TauDEM 提供了一套完整的工具,用于地形和水文分析,适用于各种规模的流域。

当我到达高处,便发觉自己总是孤独的,无人同我说话,孤寂的寒冬令我发抖,我在高处,究竟意欲何为?
posted @ 2024-07-16 17:54  等值面  阅读(294)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3