如果给定的Geometry对象A完全在对象B之内,则返回True。
语法
boolean  ST_Within(geometry  A , geometry  B);参数
参数名称  | 描述  | 
A  | 第一个Geometry对象。  | 
B  | 第二个Geometry对象。  | 
描述
为使此函数有意义,两个Geometry对象必须都具有相同的投影方式,且具有相同的空间参考(SRID)。
如果ST_Within(A,B)为True且ST_Within(B,A)为True,则认为这两个Geometry对象在空间上相等。
该函数不支持GeometryCollection类型对象作为输入参数。
不能将该函数用于无效的Geometry对象,否则将得到错误的输出结果。
该函数会自动生成一个bounding box,用于使用几何对象上的索引。如果不想使用索引,请使用函数_ST_Within。
示例
SELECT ST_Within('POLYGON((1 1,1 2,2 2,2 1,1 1))'::geometry,'POLYGON((0 0,0 3,3 3,3 0,0 0))'::geometry);
 st_within
-----------
 t
(1 row)
                该文章对您有帮助吗?