日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

ST_LineInterpolatePoint

在LineString上指定位置插入點(diǎn)對(duì)象,并返回該點(diǎn)。

語法

geometry  ST_LineInterpolatePoint(geometry  aLinestring , float8  aFraction);
geography  ST_LineInterpolatePoint(geography  aLinestring , float8  aFraction);

參數(shù)

參數(shù)名稱

描述

aLinestring

目標(biāo)LineString對(duì)象。

aFraction

插入點(diǎn)位于該線段的百分比,是一個(gè)從0到1的浮點(diǎn)值。

描述

  • 該函數(shù)支持3D對(duì)象,并且不會(huì)刪除Z坐標(biāo)。

  • 該函數(shù)支持M坐標(biāo)。

  • 使用地理坐標(biāo)系時(shí)會(huì)根據(jù)球面距離進(jìn)行計(jì)算。

示例

  • 計(jì)算給定線段的中點(diǎn)坐標(biāo):

    SELECT ST_AsText(ST_LineInterpolatePoint(geom, 0.5)) FROM (SELECT 'LINESTRING(0 0,2 2)'::geometry as geom) As test;
     st_astext
    ------------
     POINT(1 1)
    (1 row)
    
    
    SELECT ST_AsText(ST_LineInterpolatePoint(geog, 0.5)) FROM (SELECT 'LINESTRING(0 0,2 2)'::geography as geog) As test;
    
    ------------------------------------------
     POINT(0.99969732796684 1.00015638159834)
  • 獲取線上距離某個(gè)Geometry對(duì)象最近的點(diǎn):

    SELECT ST_AsText(ST_LineInterpolatePoint(geom, ST_LineLocatePoint(geom, 'POINT(1 1)'::geometry))) FROM (SELECT 'LINESTRING(0 0,0 2)'::geometry As geom) As test;
     st_astext
    ------------
     POINT(0 1)
    (1 row)
    
    -- geography
    SELECT ST_AsText(ST_LineInterpolatePoint(geog, ST_LineLocatePoint(geog, 'POINT(1 1)'::geography))) FROM (SELECT 'LINESTRING(0 0,0 2)'::geography As geog) As test;
    ---------------------------
     POINT(0 1.00015229710421)