Categories:

Geospatial Functions

ST_COVEREDBY

This returns true if no point in geography g1 is outside geography g2. This is equivalent to ST_COVERS(g2, g1).

See also:

ST_COVERS

Syntax

ST_COVEREDBY( <geography_expression_1> , <geography_expression_2> )

Arguments

geography_expression_1

A GEOGRAPHY object.

geography_expression_2

A GEOGRAPHY object.

Returns

BOOLEAN.

Examples

This shows a simple use of the ST_COVEREDBY function:

create table geospatial_table_01 (g1 GEOGRAPHY, g2 GEOGRAPHY);
insert into geospatial_table_01 (g1, g2) values 
    ('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))', 'POLYGON((1 1, 2 1, 2 2, 1 2, 1 1))');
SELECT ST_COVEREDBY(g1, g2) 
    FROM geospatial_table_01;
+----------------------+
| ST_COVEREDBY(G1, G2) |
|----------------------|
| False                |
+----------------------+