W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
ST_Centroid(geometry) 函數(shù) -= 作用:
獲取幾何對(duì)象的中心點(diǎn)
語(yǔ)法:
ST_Centroid (geometry Data Type)
返回類(lèi)型:
PostGis return type: geometry
Examples: 例 1:
SELECT ST_Centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )');
------------------------------------------
010100000062277662277602406227766227760A40
例 2:
SELECT ST_AsText(ST_Centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'));
------------------------------------------
POINT(2.30769230769231 3.30769230769231)
(1 row)
例 3:
SELECT st_asgeojson(ST_Centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'));
---------------------------------------
{"type":"Point","coordinates":[2.30769230769231,3.30769230769231]}
參考文獻(xiàn):
1.https://docs.microsoft.com/zh-cn/sql/t-sql/spatial-geometry/stcentroid-geometry-data-type
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: