CG_Visibility — 计算一个从点或多边形几何中的线段生成的可见性多边形
geometry CG_Visibility(
geometry polygon, geometry point)
;
geometry CG_Visibility(
geometry polygon, geometry pointA, geometry pointB)
;
可用性:3.5.0 - 需要 SFCGAL >= 1.5.0。
需要 SFCGAL 版本>= 1.5.0
该方法需要SFCGAL后端。
该函数支持 3d 并且不会丢失 z-index。
该函数支持多面体曲面。
此函数支持三角形和不规则三角网面 (TIN)。
SELECT CG_Visibility('POLYGON((23.5 23.5,23.5 173.5,173.5 173.5,173.5 23.5,23.5 23.5),(108 98,108 36,156 37,155 99,108 98),(107 157.5,107 106.5,135 107.5,133 127.5,143.5 127.5,143.5 108.5,153.5 109.5,151.5 166,107 157.5),(41 95.5,41 35,100.5 36,98.5 68,78.5 68,77.5 96.5,41 95.5),(39 150,40 104,97.5 106.5,95.5 152,39 150))'::geometry, 'POINT(91 87)'::geometry);
SELECT CG_Visibility('POLYGON((23.5 23.5,23.5 173.5,173.5 173.5,173.5 23.5,23.5 23.5),(108 98,108 36,156 37,155 99,108 98),(107 157.5,107 106.5,135 107.5,133 127.5,143.5 127.5,143.5 108.5,153.5 109.5,151.5 166,107 157.5),(41 95.5,41 35,100.5 36,98.5 68,78.5 68,77.5 96.5,41 95.5),(39 150,40 104,97.5 106.5,95.5 152,39 150))'::geometry,'POINT(78.5 68)'::geometry, 'POINT(98.5 68)'::geometry);