文档

ST_ShadowRatio

更新时间:

计算给定点(单个点或多个点)在某段时间内或给定时刻的阴影率。

语法

geometry  ST_ShadowRatio(scene  sc, geometry points, cstring sunlight);
geometry  ST_ShadowRatio(scene  sc, geometry points,  geometry location, cstring time);

参数

参数名称

描述

sc

Scene对象。

points

计算阴影率的点数据,Geometry类型。

sunlight

光照信息,JSON格式。

location

阴影率分析场景所在的经纬度信息,Geometry类型。

time

阴影率分析的时间。

JSON格式的sunlight字段含义:

参数名称

描述

备注

location

阴影率分析场景所在的经纬度信息,如对北京市的某个小区做阴影率分析,则为该小区对应的经纬度坐标。

必须为EPSG:4326 坐标系。由于Scene对象中的坐标都是局部坐标,因此需要该参数来指定Scene对象所在经纬度,用于计算光照方向。

start_time

阴影率分析的开始时间。

必须为有效的时间格式。

end_time

阴影率分析的结束时间。

必须为有效的时间格式。

time_interval

阴影率分析的时间采样间隔。

时间采样间隔不得为0。

sunlight的示例如下:

{
  sunlight = {
  "location": "srid=4326; POINT(120 30)",  //经纬度信息
  "start_time": "2021-07-12 08:00:00 +0800",  //开始时间
  "end_time": "2021-07-12 18:00:00 +0800",  //结束时间
  "time_interval": "01:00:00"   //时间采样间隔
}

描述

  • 方式一:根据输入的光照信息,从开始时间到结束时间,按照指定的时间间隔进行采样,计算给定点(单个点或多个点)的阴影率,并将阴影率记录在点的m坐标中。

  • 方式二:计算给定点(单个点或多个点)在指定时刻是否被阴影所覆盖,如果被阴影覆盖阴影率则为1,否则为0。并将阴影率记录在点的m坐标中。

示例

  • 方式一:

    SELECT ST_AsText(ST_ShadowRatio(the_scene, 'MULTIPOINT(0 0 -2, 1 2 8, -70 -400 1330)'::geometry, '{"location": "srid=4326; POINT(120 30)", 
        "start_time": "2021-07-12 08:00:00 +0800", "end_time":"2021-07-12 18:00:00 +0800", "time_interval": "01:00:00"}')) from t_scene;
    --------
    MULTIPOINT ZM ((0 0 -2 0.636363636363636),(1 2 8 0),(-70 -400 1330 0))
  • 方式二:

    SELECT ST_AsText(ST_ShadowRatio(the_scene, 'MULTIPOINT(-2 0 0, 0 0 0, 2 0 0, 0 0 2)'::geometry, 'srid=4326; POINT(120 30)'::geometry,
        '2021-07-12 12:00:00 +0800')) from t_scene;
    --------
     MULTIPOINT ZM ((-2 0 0 0),(0 0 0 1),(2 0 0 0),(0 0 2 0))
  • 本页导读 (0)
文档反馈