指点成金-最美分享吧

登录

postgrep 判断几何关系函数

佚名 举报

篇首语:本文由小编为大家整理,主要介绍了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 判断几何关系函数的主要内容,如果未能解决你的问题,请参考以下文章