根据区域中的DEM高程值生成等值线。

语法

set of record ST_Contour(
    raster rast,
    integer band,
    cstring contourOptions);

参数

参数名称 描述
rast raster对象,目前仅支持1波段的DEM。
band 波段号。
contourOptions 生成等值线参数。
contourOptions支持的参数如下:
参数名称 描述 类型 默认值 说明
level_base 起始等值线值。 float 0.0
  • true: 使用geometry的MBR作为更改像素值区域
  • false:使用geometry对象作为更改像素值区
fixed_level 以浮点型数组方式指定各条等值线的间隔。 float array 如果指定fixed_level,则忽略interval。
interval 等值线间距。 float 无。
polygonize 输出等值线类型。 bool false 要创建的等值线类型:
  • false:以闭合曲线形式返回等值线。
  • true:用高程值填充每两个等值线之间的区域,以多边形形式返回。
nodata nodata值。 float -1.0 无。

示例

--指定interval,返回线
select (ST_Contour(rast,1,'{"interval":"2.0"}')).* from raster_table where id =1;

--以数组方式指定等值线的间隔,返多边形
select (ST_Contour(rast,1,'{"fixed_level":[1,5,10,15,20,30],"polygonize":"true"}')).* from raster_table where id =1;

--指定nodata,返多边形
select (ST_Contour(rast,1,'{"interval":"5","nodata":"0.0","level_base":"1.0","polygonize":"true"}')).* from raster_table where id =1;