Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198.
Existing Python UDFs will continue to function until June 30, 2026. For more information, see the
blog post
ST_Intersects
ST_Intersects returns true if the 2D projections of the two input geometries have at least one point in common.
Syntax
ST_Intersects(geom1, geom2)
Arguments
- geom1
-
A value of data type
GEOMETRYor an expression that evaluates to aGEOMETRYtype. - geom2
-
A value of data type
GEOMETRYor an expression that evaluates to aGEOMETRYtype.
Return type
BOOLEAN
If geom1 or geom2 is null, then null is returned.
If geom1 and geom2 don't have the same value for the spatial reference system identifier (SRID), then an error is returned.
If geom1 or geom2 is a geometry collection, then an error is returned.
Examples
The following SQL checks if the first polygon intersects the second polygon.
SELECT ST_Intersects(ST_GeomFromText('POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 5,5 5,5 2,2 2))'), ST_GeomFromText('MULTIPOINT((4 4),(6 6))'));
st_intersects
-------------
true