All Products
Search
Document Center

PolarDB:<@@

Last Updated:Mar 28, 2026

Checks whether the spatial range of a geographic grid is contained within a geometry. Returns true if the grid falls inside the geometry, and false otherwise. This operator returns the spatial relationship between a grid and a geometry.

Syntax

The operator supports the following type combinations:

bool <@@(geometry geom3d, geomgrid gridcode)
bool <@@(geomgrid gridcode, geometry geom3d)
bool <@@(meshgeom geom3d, geomgrid gridcode)
bool <@@(geomgrid gridcode, meshgeom geom3d)
bool <@@(sfmesh geom3d, geomgrid gridcode)
bool <@@(geomgrid gridcode, sfmesh geom3d)
bool <@@(vomesh geom3d, geomgrid gridcode)
bool <@@(geomgrid gridcode, vomesh geom3d)
bool <@@(geomgrid gridcode1, geomgrid gridcode2)

Parameters

ParameterDescription
gridcode / gridcode1 / gridcode2The geographic grid object.
geom3dThe 3D geometry.
The geometry must use the CGC2000 (China Geodetic Coordinate System 2000) spatial reference system. The spatial reference system identifier (SRID) of the geometry must be 4490.

Examples

Check whether a point geometry contains a geographic grid

The following example checks whether a 3D point at coordinates (116.315, 39.910, 1001.8 m altitude) contains the geographic grid GZ00262064446046072072.

SELECT 'srid=4490;POINT(116.31522216796875 39.910277777777778 1001.8)'::geometry,
<@@ ST_GridFromText('GZ00262064446046072072');

Result:

 st_3dwithin
-------------
 t

The result t (true) confirms the grid falls within the specified geometry.

Check containment between two geographic grids

The following example checks whether the finer-grained grid GZ0026206435 is contained within the coarser grid GZ002620643.

SELECT ST_GridFromText('GZ0026206435') <@@ ST_GridFromText('GZ002620643');

Result:

 st_3dwithin
-------------
 t

The result t (true) confirms that GZ0026206435 falls within the spatial range of GZ002620643.