All Products
Search
Document Center

PolarDB:<@@

Last Updated:Mar 28, 2026

Returns true if the spatial range of a geographic grid is contained by a geometry.

Syntax

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

Description

<@@ checks whether the spatial range of a geographic grid (geomgrid) is contained by a geometry. The geometry must use the CGC2000 spatial reference system with a spatial reference system identifier (SRID) of 4490.

Examples

Example 1: Check whether a geometry contains a grid

The following query checks whether the 3D point at longitude 116.315, latitude 39.910, altitude 1001.8 is contained by the grid GZ00262064446046072072. The result is t (true) because the point falls within the grid's spatial range.

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

Example 2: Check whether one grid is contained by another

The following query checks whether grid GZ0026206435 is contained by the parent grid GZ002620643. A child grid code is always contained by its parent.

SELECT ST_GridFromText('GZ0026206435') <@@ ST_GridFromText('GZ002620643');
 st_3dwithin
-----------------
 t