根据区域中的DEM高程值生成等值线。
语法
set of record ST_Contour(
    raster rast,
    integer band,
    cstring contourOptions);参数
| 参数名称 | 描述 | 
| rast | Raster对象,目前仅支持1波段的DEM。 | 
| band | 波段号,从0开始。 | 
| contourOptions | 生成等值线参数。 | 
contourOptions支持的参数如下:
| 参数名称 | 描述 | 类型 | 默认值 | 说明 | 
| level_base | 起始等值线值。 | float | 0.0 | 无。 | 
| fixed_level | 以浮点型数组方式指定各条等值线的间隔。 | float array | 无 | 如果指定fixed_level,则忽略interval。 | 
| interval | 等值线间距。 | float | 无 | 无。 | 
| polygonize | 输出等值线类型。 | bool | false | 要创建的等值线类型: 
 | 
| nodata | nodata值。 | float | -1.0 | 无。 | 
描述
指定Raster对象与波段编号生成等值线。
返回结果中的字段包括:
- id:等值线/面的序号。 
- max_value:等值线/面中的最大值。 
- min_value:等值线/面中的最小值。 
- geom:等值线/面的geometry对象。 
示例
--指定interval,返回线
select (ST_Contour(rast,0,'{"interval":"2.0"}')).* from raster_table where id =1;
--以数组方式指定等值线的间隔,返多边形
select (ST_Contour(rast,0,'{"fixed_level":[1,5,10,15,20,30],"polygonize":"true"}')).* from raster_table where id =1;
--指定nodata,返多边形
select (ST_Contour(rast,0,'{"interval":"5","nodata":"0.0","level_base":"1.0","polygonize":"true"}')).* from raster_table where id =1;            该文章对您有帮助吗?