『公告』 预祝您龙年大吉,万事如意, 过节期间, 大家如需数据服务,请拨打400 或直接添加客服微信,再祝大家龙年,心想事成。
关注我们 新浪 腾讯

ArcGIS教程:水流长度

ArcGIS教程:水流长度
水流长度工具的主要用途是计算给定盆地内最长水流的长度。该度量值常用于计算盆地的聚集时间。这可使用 UPSTREAM 选项来完成。该工具也可通过将权重栅格用作下坡运动的阻抗,来创建假设降雨和径流事件的距离-面积图。

摘要

    计算沿每个像元的流路径的上游(或下游)距离或加权距离。

用法

·      水流长度输出栅格的值类型为浮点型。

·      水流长度工具的主要用途是计算给定盆地内最长水流的长度。该度量值常用于计算盆地的聚集时间。这可使用 UPSTREAM 选项来完成。

该工具也可通过将权重栅格用作下坡运动的阻抗,来创建假设降雨和径流事件的距离-面积图。

语法

    FlowLength (in_flow_direction_raster, {direction_measurement}, {in_weight_raster})

参数

说明

数据类型

in_flow_direction_raster

根据每个像元来显示流向的输入栅格。

可以使用流向 工具创建流向栅格。

Raster Layer

direction_measurement

(可选)

沿流路径的度量方向。

·         DOWNSTREAM — 计算沿流路径从每个像元到栅格边上的汇点或出水口的下坡距离。

·         UPSTREAM — 计算沿流路径从每个像元到分水岭顶部的最长上坡距离。

String

in_weight_raster

(可选)

对每一像元应用权重的可选输入栅格。

如果未指定权重栅格,则将默认的权重值 1 应用于每个像元。对于输出栅格中的每个像元,结果为流入其中的像元数。

Raster Layer

返回值

名称

说明

数据类型

out_raster

显示每个像元的沿流路径的上游或下游距离的输出栅格。

Raster

代码实例

    水流长度 (FlowLength) 示例 1Python 窗口)

    本例计算沿每个像元的流路径的下游距离。

import arcpy

from arcpy import env

from arcpy.sa import *

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

outFlowLength = FlowLength("flowdir", "DOWNSTREAM", "")

outFlowLength.save("c:/sapyexamples/output/outflowlen01")

    水流长度 (FlowLength) 示例 2(独立脚本)

    本例计算沿每个像元的流路径的下游距离。

# Name: _Ex_02.py

# Description:

# 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

inFlowDirectionRaster = "flowdir"

inWeightRaster = ""

directionType = "DOWNSTREAM"

# Check out the ArcGIS Spatial Analyst extension license

arcpy.CheckOutExtension("Spatial")

# Execute

outFlowLength = FlowLength(inFlowDirectionRaster, directionType, inWeightRaster)

# Save the output

outFlowLength.save("c:/sapyexamples/output/outflowlen02.tif")

      京ICP备2025132830号-1 京公网安备 号