ST_Intersects
Determine whether two geometries intersect, that is, whether their DE-9IM intersection matrix is not FF*FF****
.
Syntax
ST_Intersects(geo);
ST_Intersects(geo1, geo2);
- geo
- A table column of type ST_GEOMETRY(ANY) containing geometries.
- geo1
- The first input geometry.
Type: ST_GEOMETRY(ANY)
- geo2
- The second input geometry.
Type: ST_GEOMETRY(ANY)
Returns
A value of type BOOL that is TRUE if the two geometries intersect; otherwise FALSE.
Examples
CREATE TABLE points (PointID integer, the_geom ST_GEOMETRY(200));
INSERT INTO points VALUES (1, inza..ST_WKTToSQL('Point (0 0)'));
INSERT INTO points VALUES (2, inza..ST_WKTToSQL('Point (22 0)'));
INSERT INTO points VALUES (3, inza..ST_WKTToSQL('Point (33 33)'));
INSERT INTO points VALUES (4, inza..ST_WKTToSQL('Point (44 44)'));
SELECT inza..ST_Intersects(the_geom) from (SELECT the_geom from points order by PointID LIMIT 9999999) points;
ST_INTERSECTS
---------------
f
(1 row)
SELECT inza..ST_Intersects(inza..ST_WKTToSQL('POLYGON ((0 0, 11 0, 11 11, 0 11, 0 0))'),
inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))'));
ST_INTERSECTS
---------------
t
(1 row)
SELECT inza..ST_Intersects(inza..ST_WKTToSQL('POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0))'),
inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))'));
ST_INTERSECTS
---------------
f
(1 row)
SELECT inza..ST_Intersects(inza..ST_WKTToSQL('POLYGON ((0 0, 0 4, 4 0, 0 0))'),
inza..ST_WKTToSQL('POLYGON ((0 5, 5 5, 5 0, 0 5))'));
ST_INTERSECTS
---------------
f
(1 row)
ST_Intersects - Create a geometry that is the union of a table of geomet-ries.
Creates a geometry by doing a union on a table of geometries
Usage
The ST_Intersects aggregate has the following syntax:
ST_Intersects(geo);
Parameters
geometry
A geometry. Type: VARCHAR(ANY)
Returns
BOOL Returns TRUE if the table of geometries intersect; otherwise FALSE.
Examples
CREATE TABLE points (PointID integer, the_geom VARCHAR(200));
INSERT INTO points VALUES (1, inza..ST_WKTToSQL('Point (0 0)'));
INSERT INTO points VALUES (2, inza..ST_WKTToSQL('Point (22 0)'));
INSERT INTO points VALUES (3, inza..ST_WKTToSQL('Point (33 33)'));
INSERT INTO points VALUES (4, inza..ST_WKTToSQL('Point (44 44)'));
SELECT inza..ST_Intersects(the_geom) from (SELECT the_geom from points order by PointID
LIMIT 9999999) points;
ST_INTERSECTS
---------------
f
(1 row)