All Products
Search
Document Center

ApsaraDB RDS:ST_Intersects

Last Updated:Mar 28, 2026

Returns true if a grid and a geometry share any point in common.

Syntax

boolean ST_Intersects(geomgrid grid, geometry geom);
boolean ST_Intersects(geometry geom, geomgrid grid);

Parameters

ParameterDescription
gridThe grid whose spatial relationship you want to query.
geomThe geometry whose spatial relationship you want to query. Must use the CGC2000 spatial reference system (SRID 4490).

Examples

The following example checks whether a grid intersects with a line string. The result is t (true).

SELECT ST_Intersects(
    ST_gridfromtext('G001331032213300013'),
    ST_geomfromtext('LINESTRING(122.48077 51.72814, 122.47416 51.73714)', 4490)
);

 st_intersects
---------------
 t