ST_Flow_direction

更新时间: 2026-03-28 12:24:23

Computes the flow direction for each cell in a specified area using a digital elevation model (DEM).

Syntax

float8[] ST_flow_direction(raster rast, Box box);

Parameters

ParameterDescription
rastThe raster object to analyze. Must be a single-band DEM.
boxThe bounding box of the area to analyze, in world coordinates.

How it works

ST_Flow_direction applies the D8 flow direction algorithm to compute the flow direction in an area based on the DEM data in the area.

Example

SELECT st_flow_direction(rast, '((-202286.94,2232375.16),(-202135.0,2232225))'::box)
FROM t_overflow
WHERE id = 2;

Output:

{2,2,2,4,4,8,2,2,2,4,4,8,1,1,2,4,8,4,128,128,1,2,4,8,2,2,1,4,4,4,1,1,1,1,4,16}
(1 row)
上一篇: ST_Overflow 下一篇: ST_Contour
阿里云首页 云原生数据库 PolarDB 相关技术圈