📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_COVEREDBY



Returns TRUE if no point in the first GEOMETRY object lies outside the second GEOMETRY object.

See also: ST_COVERS

Syntax

ST_COVEREDBY(<geometry1>, <geometry2>)

Arguments

ArgumentsDescription
<geometry1>A GEOMETRY expression (the object being tested).
<geometry2>A GEOMETRY expression (the covering object).

Return Type

Boolean.

Examples

SELECT ST_COVEREDBY( TO_GEOMETRY('POINT(1 1)'), TO_GEOMETRY('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))') ); ┌────────┐ │ result │ ├────────┤ │ true │ └────────┘ SELECT ST_COVEREDBY( TO_GEOMETRY('POLYGON((1 1, 2 1, 2 2, 1 2, 1 1))'), TO_GEOMETRY('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))') ); ┌────────┐ │ result │ ├────────┤ │ true │ └────────┘ SELECT ST_COVEREDBY( TO_GEOMETRY('POINT(5 5)'), TO_GEOMETRY('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))') ); ┌────────┐ │ result │ ├────────┤ │ false │ └────────┘

Was this page helpful?