Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

ST_Covers

Focus mode
ST_Covers - Amazon Redshift

ST_Covers returns true if the 2D projection of the first input geometry covers the 2D projection of the second input geometry. Geometry A covers geometry B if both are nonempty and every point in B is a point in A.

ST_Covers(A, B) is equivalent to ST_CoveredBy(B, A).

Syntax

ST_Covers(geom1, geom2)

Arguments

geom1

A value of data type GEOMETRY or an expression that evaluates to a GEOMETRY type.

geom2

A value of data type GEOMETRY or an expression that evaluates to a GEOMETRY type. This value is compared with geom1 to determine if it covers geom1.

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 covers the second polygon.

SELECT ST_Covers(ST_GeomFromText('POLYGON((0 2,1 1,0 -1,0 2))'), ST_GeomFromText('POLYGON((-1 3,2 1,0 -3,-1 3))'));
st_covers ----------- false

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.