ST_Contains
更新时间:
复制 MD 格式
Tests whether one geometry or grid contains another — every point of the second argument lies within the first, and their interiors share at least one point.
Syntax
boolean ST_Contains(geomgrid grid, geometry geom);
boolean ST_Contains(geometry geom, geomgrid grid);
boolean ST_Contains(geomgrid grid1, geomgrid grid2);Parameters
| Parameter | Description |
|---|---|
grid | The grid whose spatial relationship you want to query. |
geom | The geometry whose spatial relationship you want to query. |
Return value
Returns boolean.
Returns
trueif the first argument contains the second.Returns
falseif the containment condition is not met.
Examples
Example 1: Grid versus geometry (returns false)
select st_contains(ST_gridfromtext('G001331032213300013'),
ST_geomfromtext('POINT(116.31522216796875 39.910277777777778)',4490));
st_intersects
---------------
fExample 2: Parent grid versus child grid (returns true)
The grid G00133103221330 fully contains the smaller grid G001331032213300013, so ST_Contains returns true.
select st_contains(ST_gridfromtext('G00133103221330'),
ST_gridfromtext('G001331032213300013'))
st_contains
-------------
t该文章对您有帮助吗?