您的位置:首页 > 其它

ArcGIS教程:分水岭

2015-08-19 12:10 295 查看
  摘要

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

  用法

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

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

  · 当指定输入倾泻点位置作为要素数据时,默认字段将为首个可用的有效字段。如果不存在有效字段,则 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")
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ArcGIS教程 分水岭