ST_CoveredBy(A, B) returns true if no point in A lies outside of shape B. Otherwise, it returns false.
In other words, shape B must completely cover every point in A.
ST_CoveredBy works on the following data types:
ST_CoveredBy will attempt to use any available spatial index to speed up its
operation. Use the prefixed variant _ST_CoveredBy if you do not want any spatial indexes to be used.This function is the inverse of
ST_Covers.Examples
The screenshots in these examples were generated using geojson.io, but they are designed to
showcase the shapes, not the map. Representing
GEOMETRY data in GeoJSON can lead to unexpected results if using
geometries with SRIDs other than 4326 (as shown below).True
In this example,ST_CoveredBy returns true because:
- No Point in the smaller Polygon A lies outside of the larger Polygon B.

False
In this example,ST_CoveredBy returns false because:
- Many Points in the smaller Polygon A lie outside of the larger Polygon B.

See also
- Export Spatial Data
- Spatial tutorial
- Spatial and GIS Glossary of Terms
- Spatial indexes
- Spatial functions
ST_CoversST_ContainsST_WithinST_IntersectsST_CoveredByST_CoversST_DisjointST_EqualsST_OverlapsST_TouchesST_ConvexHullST_Union- Migrate from Shapefiles
- Migrate from GeoJSON
- Migrate from GeoPackage
- Migrate from OpenStreetMap
- Introducing Distributed Spatial Data in CockroachDB (blog post)
- Using GeoServer with CockroachDB

