Tests if a grid and a geometry share at least one point in common.
Syntax
boolean ST_Intersects(geomgrid grid, geometry geom);
boolean ST_Intersects(geometry geom, geomgrid grid);Parameters
| Parameter | Description |
|---|---|
grid | The grid whose spatial relationship you want to query. |
geom | The geometry whose spatial relationship you want to query. |
Description
ST_Intersects returns true if the grid and the geometry intersect (that is, their intersection is not empty), and false otherwise.
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
The following example tests whether the grid G001331032213300013 intersects with a line string geometry.
SELECT ST_Intersects(
ST_gridfromtext('G001331032213300013'),
ST_geomfromtext('LINESTRING(122.48077 51.72814, 122.47416 51.73714)', 4490)
);Output:
st_intersects
---------------
tThe result t indicates that the grid intersects with the geometry.
该文章对您有帮助吗?