文档

ST_ClosestPoint

更新时间:

返回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)
                
  • 本页导读 (1)
文档反馈