@ / />

更新时间:
复制 MD 格式

Checks whether a grid contains a geometry or another grid.

Syntax

boolean @>(geomgrid grid, geometry geom);
boolean @>(geometry geom, geomgrid grid);
boolean @>(geomgrid grid1, geomgrid grid2);

Parameters

ParameterDescription
gridThe grid whose spatial relationship you want to query.
geomThe geometry whose spatial relationship you want to query.

Description

Returns true if the left-hand operand contains the right-hand operand, and false otherwise. The geometry must use the CGC2000 spatial reference system. The spatial reference system identifier (SRID) of the geometry must be 4490.

Examples

Example 1: Check whether a grid contains a point.

SELECT ST_gridfromtext('G001331032213300013') @>
       ST_GeomFromText('POINT(116.31522216796875 39.910277777777778)', 4490) AS t;

Result:

 t
---
 f

Example 2: Check whether a grid contains another grid.

SELECT ST_gridfromtext('G00133103221330') @>
       ST_gridfromtext('G001331032213300013') AS t;

Result:

 t
---
 t