postgrep 判斷幾何關系函數
阿新 • • 發佈:2017-08-16
postgrep 判斷幾何關系函數
geom 為幾何圖形的坐標集合
1、獲取兩個幾何對象間的距離ST_Distance(geometry, geometry)
ST_Distance(a.geom::geography, b.geom::geography) length
2、如果兩個幾何對象間距離在給定值範圍內,則返回TRUE ST_DWithin(geometry, geometry, float)
ST_DWithin(a.geom::geography, b.geom::geography, float);
3、判斷兩個幾何對象是否相等ST_Equals(geometry, geometry)
ST_Equals(a.geom, b.geom)
4、判斷兩個幾何對象是否相交 ST_Intersects(geometry, geometry)
ST_Intersects(a.geom, b.geom)
5、獲取兩個幾何對象相交的部分 ST_Intersection(geometry,geometry)
ST_Intersects(a.geom, b.geom)
6、判斷A是否被B包含 ST_Within(geometry A, geometry B)
ST_Within(a.geom, b.geom)
7、判斷A是否包含B ST_Contains(geometry A, geometry B)
ST_Contains(a.geom, b.geom)
8、判斷幾何對象是否閉合ST_IsClosed(geometry)
本文出自 “簡單可依賴” 博客,請務必保留此出處http://wenxuehui.blog.51cto.com/12898974/1956656
postgrep 判斷幾何關系函數