ST_OVERLAPS scalar function
The ST_OVERLAPS function takes two geometries as input parameters. If the intersection of the geometries results in a geometry of the same dimension but is not equal to either of the given geometries, it returns 1. Otherwise, it returns 0 (zero).
If geometry1 or geometry2 is null, the result is the null value. If geometry1 or geometry2 is empty, 0 (zero) is returned.
- geometry1
- A value of type ST_GEOMETRY or one of its subtypes that represents the geometry that is tested to overlap with geometry2.
- geometry2
- A value of type ST_GEOMETRY or one of its subtypes that represents the geometry that is tested to overlap with geometry1.
The result of the function is an INTEGER.
Example
Determine if two lines overlap.
VALUES CASE QSYS2.ST_OVERLAPS(QSYS2.ST_LINESTRING('linestring(50 12, 50 10, 60 8)'),
QSYS2.ST_LINESTRING('linestring(50 10, 50 12, 45 10)'))
WHEN 0 THEN 'Lines do not overlap'
WHEN 1 THEN 'Lines overlap'
END;
Results:
Lines overlap
