The following example tests if a polygon contains a point. The polygon
completely contains the point, and the interior of the point (the point itself)
intersects the interior of the polygon, so the example returns 1.
The following example tests if a polygon contains a line. The polygon
completely contains the line, but the interior of the line and the
interior of the polygon do not intersect (the line only intersects the
polygon on the polygon's boundary, and the boundary is not part of the interior),
so the example returns 0. If ST_Covers was used in place of ST_Contains,
ST_Covers would return 1.
The following example lists the ShapeIDs where the given polygon contains
each Shape geometry. This example returns the result 16,17,19.
Note that ShapeID 1 is not listed because the polygon intersects
that row's Shape point at the polygon's boundary.
SELECT LIST( ShapeID ORDER BY ShapeID )
WHERE NEW ST_Polygon( NEW ST_Point( 0, 0 ),
NEW ST_Point( 8, 2 ) ).ST_Contains( Shape ) = 1