This topic describes the ST_Overlaps function. This function checks whether two geometry objects spatially overlap but one is not included in the other. If the two geometry objects spatially overlap but one is not included in the other, this function returns True. Otherwise, this function returns False.

Syntax

boolean  ST_Overlaps(geometry  a , geometry  b);

Parameters

Parameter Description
a The first geometry object that you want to specify.
b The second geometry object that you want to specify.

Description

  • This function does not support GeometryCollection objects.
  • This function generates a bounding box, which allows you to use the indexes that are available on the geometry objects that you specify. If you do not want to use indexes, you can use the _ST_Overlaps function.

Examples

Compare two geometry objects by using the default parameter settings.
SELECT ST_Overlaps('LINESTRING(0 0,0 2)'::geometry,'LINESTRING(0 1,0 3)'::geometry);
 st_overlaps
-------------
 t
(1 row)