首页 > 其他 > 详细

ArcGIS教程:分水岭

时间:2015-08-19 13:23:54      阅读:278      评论:0      收藏:0      [点我收藏+]

  摘要

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

  用法

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

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

  · 当指定输入倾泻点位置作为要素数据时,默认字段将为首个可用的有效字段。如果不存在有效字段,则 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教程:分水岭

原文:http://blog.csdn.net/dsac1/article/details/47778665

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!