computes the perimeter of polygon pg and the
function
CLOSED(I) =
(XCOORD(SP())) - XCOORD(EP(I)))
AND
(YCOORD(SP())) - YCOORD(EP()))
returns the logical value TRUE if and only if line [ is
a closed line.
4. Topological spatial relations
Topological relations are such spatial relations that
are invariant under topological transformations
between two topologically equivalent spaces
(Armstrong 1979). Adjacency, overlapping, and
containment are typical examples. It is known that
totally eight different topological relations exist
between two regions (Egenhofer et al 1990).
By disregarding orders of containment and coverage
and taking point and line objects into account, six
topological relations between two spatial objects can
be named (Svensson et al 1991). Table 1 presents the
topological relations with different combinations of
object types.
In some combinations of object types, one
topological relation may be implied by different
names. For example, MEETS, EQUALS, COVERS,
OVERLAPS indicate the same topological relation of
two points. In order to avoid ambiguity, only
EQUALS is defined.
Table 1. Topological relations between objects of different types
combination of object types
topological
relations PP PL PPg LL LPg PgPg
DISOINT Y Y Y Y Y Y
MEETS - - - Y Y Y
EQUALS Y - - Y - Y
CONTAINS - - Y - Y Y
COVERS - Y Y Y. Y Y
OVERLAPS - - - Y Y Y
Y/- means the topological relationship exists /undefined.
Visualization of topological relationships between
two polygons is given in (Egenhofer et al 1990).
5. Topological operators
Spatial relations vary in the same topological
relations. For example, when two polygons meet,
they may meet at boundaries (meets-1), or they may
meet at a corner (meets-0). It is necessary to specify
the cases because the merging of two primitive
polygons which meet at boundaries produces a
primitive polygon, whereas the merging of two
primitive polygons which meet at a corner results in
a non-primitive polygon.
275
Spatial operators are needed to detect topological
spatial relations of two objects. In order to define
spatial operators, specific cases of spatial relations
should be investigated. Some operators, called
fundamental operators, must be defined and
implemented at the system level. Others can be
expressed by using fundamental operators and other
given functions.
Below, we use some examples to argue the necessary
fundamental operators needed for detecting some
general and specified topological relations, and to
show how to create new operators by combinations
of those fundamental operators and other functions
and operators.
Since the disjoint relation exists in any combination
of spatial object types (see Table 1), the operator
DISJOINT is defined as a fundamental operator.
Example 1: Operators for checking topological
relations between two points p and q.
There are only two kinds of topological relations
between two points. They are either disjoint or not
disjoint. We define the operator EQUALS to describe
the not-disjoint relation.
p EQUALS gq iff NOT(p DISJOINT gq)
EQUALS is a non-fundamental operator defined by
the fundamental operator DISJOINT. EQUALS can
also be defined as
p EQUALS 3
iff (XCOORD(p) = XCOORD(4)) AND
(YCOORD(p) = YCOORD(4))
This example shows that non-fundamental
operators can sometimes be defined in several ways.
Example 2: Function for checking closedness of a
line I.
CLOSED() iff SP() EQUALS EP(I)
This example shows that spatial operators can be
used to define spatial functions.
Example 3: Operators for checking spatial relations
between a point p and a line /.
Two general topological relations are disjoint and
not disjoint. We describe the not-disjoint relation by
the operator COVERS defined as
I COVERS p iff NOT(p DISJOINT I)
Under the COVERS relation, two cases must be
distinguished. The point p is either located at the
end points, or on the other place of the line I. We
define the operator P-AT-ENDS to describe the first
case.
p P-AT-ENDS | iff (I COVERS p ) AND
((p EQUALS SP(l)) OR