The spatial operations allow you to determine the relationship between two or more geometry objects. Some examples are:
Geometries are next to each other
Geometries are contained by one another
Geometries intersect boundaries
In the last chapter, you used the contain
operation. Let's start by revisiting it:
boolean contain@spatial( Geometry containingGeometry, Geometry containedGeometry, double tolerance)
The contain()
function returns true
if the containedGeometry
is contained by the containingGeometry
, otherwise it returns false
. A geometry is considered contained by another geometry if all the points that make up the former is completely within the shape of the latter. In particular, a geometry is not considered contained by another geometry if they touch boundaries. This is exemplified in the following diagram:
The tolerance argument is used as a measure of accuracy of the data. When you specify a tolerance for the spatial operations...