contains function

Returns true if and only if no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a.

Syntax

contains( geometry a , geometry b)

Arguments

geometry → geometry geometry → geometry

Example

 contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' ))    → returns 1
 contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ))          → returns 0