返回Geometry对象g1之中,离g2最近的2D坐标点。
语法
geometry  ST_ClosestPoint(geometry  g1 , geometry  g2);参数
| 参数名称 | 描述 | 
|---|---|
| g1 | 第一个Geometry对象。 | 
| g2 | 第二个Geometry对象。 | 
描述
返回的是最短线的端点。
示例
SELECT ST_AsText(ST_ClosestPoint('LINESTRING(0 -1,0 1)'::geometry,'POINT(1 0)'::geometry));
 st_astext
------------
 POINT(0 0)
(1 row)