標籤:arcgis教程 水流長度
摘要
計算沿每個像元的流路徑的上遊(或下遊)距離或加權距離。
用法
· 水流長度輸出柵格的值類型為浮點型。
· 水流長度工具的主要用途是計算給定盆地內最長水流的長度。該度量值常用於計算盆地的聚集時間。這可使用 UPSTREAM選項來完成。
該工具也可通過將權重柵格用作下坡運動的阻抗,來建立假設降雨和徑流事件的距離-面積圖。
文法
FlowLength (in_flow_direction_raster, {direction_measurement}, {in_weight_raster})
代碼執行個體
水流長度 (FlowLength) 樣本 1(Python 視窗)
本例計算沿每個像元的流路徑的下遊距離。
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")
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
ArcGIS教程:水流長度