ArcGIS教程:分水岭

  摘要

  确定栅格中一组像元之上的汇流区域。

  使用方法

  · 各个分水岭的值将取自输入栅格中源的值或者要素倾泻点数据。假设倾泻点为栅格数据集,则使用像元值。假设倾泻点为点要素数据集,则从指定的字段中获取值。

  · 假设预先使用捕捉倾泻点工具将倾泻点定位至累积流量大的像元,将得到更加理想的结果。

  · 当指定输入倾泻点位置作为要素数据时,默认字段将为首个可用的有效字段。假设不存在有效字段,则 ObjectID 字段(如 OID 或 FID)将为默认字段。

  语法

  Watershed (in_flow_direction_raster, in_pour_point_data, {pour_point_field})

  代码实例

  Watershed 演示样例 1(Python 窗体)

  本演示样例针对流向 GRID 栅格中选定的倾泻点位置确定汇流区域。

  import arcpy

  from arcpy import env

  from arcpy.sa import *

  env.workspace = "C:/sapyexamples/data"

  outWatershed = Watershed("flowdir", "pourpoint")

  outWatershed.save("C:/sapyexamples/output/outwtrshd01")

  Watershed 演示样例 2(独立脚本)

  本演示样例针对流向 GRID 栅格中选定的倾泻点位置确定汇流区域,并以 TIFF 栅格的形式输出分水岭。

  # Name: Watershed_Ex_02.py

  # Description: Determines the contributing area above a set of cells in a

  # raster.

  # Requirements: Spatial Analyst Extension

  # Import system modules

  import arcpy

  from arcpy import env

  from arcpy.sa import *

  # Set environment settings

  env.workspace = "C:/sapyexamples/data"

  # Set local variables

  inFlowDirection = "flowdir"

  inPourPointData = "pourpoint"

  inPourPointField = "VALUE"

  # Check out the ArcGIS Spatial Analyst extension license

  arcpy.CheckOutExtension("Spatial")

  # Execute Watershed

  outWatershed = Watershed(inFlowDirection, inPourPointData, inPourPointField)

  # Save the output

  outWatershed.save("C:/sapyexamples/output/outwtrshd02.tif")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值