<s>
The	O
Dimensionally	B-Algorithm
Extended	I-Algorithm
9-Intersection	I-Algorithm
Model	I-Algorithm
(	O
DE-9IM	B-Algorithm
)	O
is	O
a	O
topological	O
model	O
and	O
a	O
standard	O
used	O
to	O
describe	O
the	O
spatial	O
relations	O
of	O
two	O
regions	O
(	O
two	O
geometries	B-Algorithm
in	I-Algorithm
two-dimensions	I-Algorithm
,	O
R2	O
)	O
,	O
in	O
geometry	O
,	O
point-set	O
topology	O
,	O
geospatial	O
topology	O
,	O
and	O
fields	O
related	O
to	O
computer	O
spatial	O
analysis	O
.	O
</s>
<s>
The	O
spatial	O
relations	O
expressed	O
by	O
the	O
model	O
are	O
invariant	O
to	O
rotation	B-General_Concept
,	O
translation	B-Algorithm
and	O
scaling	B-Algorithm
transformations	O
.	O
</s>
<s>
The	O
matrix	B-Architecture
provides	O
an	O
approach	O
for	O
classifying	O
geometry	O
relations	O
.	O
</s>
<s>
Roughly	O
speaking	O
,	O
with	O
a	O
true/false	O
matrix	B-Architecture
domain	B-Application
,	O
there	O
are	O
512	O
possible	O
2D	O
topologic	O
relations	O
,	O
that	O
can	O
be	O
grouped	O
into	O
binary	O
classification	O
schemes	O
.	O
</s>
<s>
It	O
has	O
been	O
used	O
as	O
a	O
basis	O
for	O
standards	O
of	O
queries	B-Library
and	O
assertions	O
in	O
geographic	B-Application
information	I-Application
systems	I-Application
(	O
GIS	B-Application
)	O
and	O
spatial	B-Algorithm
databases	I-Algorithm
.	O
</s>
<s>
The	O
DE-9IM	B-Algorithm
model	O
is	O
based	O
on	O
a	O
3×3	O
intersection	B-Algorithm
matrix	B-Architecture
with	O
the	O
form	O
:	O
</s>
<s>
where	O
is	O
the	O
dimension	O
of	O
the	O
intersection	B-Algorithm
( ∩	O
)	O
of	O
the	O
interior	O
(	O
I	O
)	O
,	O
boundary	O
(	O
B	O
)	O
,	O
and	O
exterior	O
(	O
E	O
)	O
of	O
geometries	O
a	O
and	O
b	O
.	O
</s>
<s>
The	O
dimension	O
of	O
non-empty	O
sets	O
( ¬∅	O
)	O
are	O
denoted	O
with	O
the	O
maximum	O
number	O
of	O
dimensions	O
of	O
the	O
intersection	B-Algorithm
,	O
specifically	O
for	O
points	O
,	O
for	O
lines	O
,	O
for	O
areas	O
.	O
</s>
<s>
Then	O
,	O
the	O
domain	B-Application
of	O
the	O
model	O
is	O
.	O
</s>
<s>
A	O
simplified	O
version	O
of	O
values	O
are	O
obtained	O
mapping	O
the	O
values	O
to	O
(	O
true	O
)	O
,	O
so	O
using	O
the	O
boolean	O
domain	B-Application
.	O
</s>
<s>
The	O
elements	O
of	O
the	O
matrix	B-Architecture
can	O
be	O
named	O
as	O
shown	O
below	O
:	O
</s>
<s>
Both	O
matrix	B-Architecture
forms	O
,	O
with	O
dimensional	O
and	O
boolean	O
domains	O
,	O
can	O
be	O
serialized	B-Application
as	O
"	O
DE-9IM	B-Algorithm
string	O
codes	O
"	O
,	O
which	O
represent	O
them	O
in	O
a	O
single-line	O
string	O
pattern	O
.	O
</s>
<s>
For	O
output	O
checking	O
or	O
pattern	O
analysis	O
,	O
a	O
matrix	B-Architecture
value	O
(	O
or	O
a	O
string	O
code	O
)	O
can	O
be	O
checked	O
by	O
a	O
"	O
mask	O
"	O
:	O
a	O
desired	O
output	O
value	O
with	O
optional	O
asterisk	B-Language
symbols	O
as	O
wildcards	B-Algorithm
—	O
that	O
is	O
,	O
""	O
indicating	O
output	O
positions	O
that	O
the	O
designer	O
does	O
not	O
care	O
about	O
(	O
free	O
values	O
or	O
"	O
don't-care	O
positions	O
"	O
)	O
.	O
</s>
<s>
The	O
domain	B-Application
of	O
the	O
mask	O
elements	O
is	O
,	O
or	O
for	O
the	O
boolean	O
form	O
.	O
</s>
<s>
The	O
simpler	O
models	O
4-Intersection	O
and	O
9-Intersection	O
were	O
proposed	O
before	O
DE-9IM	B-Algorithm
for	O
expressing	O
spatial	O
relations	O
(	O
and	O
originated	O
the	O
terms	O
4IM	O
and	O
9IM	O
)	O
.	O
</s>
<s>
They	O
can	O
be	O
used	O
instead	O
of	O
the	O
DE-9IM	B-Algorithm
to	O
optimize	O
computation	O
when	O
input	O
conditions	O
satisfy	O
specific	O
constraints	O
.	O
</s>
<s>
This	O
matrix	B-Architecture
can	O
be	O
serialized	B-Application
.	O
</s>
<s>
Any	O
topological	O
property	O
based	O
on	O
a	O
DE-9IM	B-Algorithm
binary	O
spatial	O
relation	O
is	O
a	O
spatial	O
predicate	O
.	O
</s>
<s>
The	O
spatial	O
predicate	O
functions	O
that	O
can	O
be	O
derived	O
from	O
DE-9IM	B-Algorithm
include	O
:	O
</s>
<s>
Predicates	O
defined	O
with	O
masks	O
of	O
domain	B-Application
:	O
</s>
<s>
Name	O
(	O
synonym	O
)	O
Intersection	B-Algorithm
matrix	B-Architecture
and	O
mask	O
code	O
string(boolean OR between matrices )	O
Meaning	O
and	O
definitionEquivalent	O
Equals	O
a	O
and	O
b	O
are	O
topologically	O
equal	O
.	O
</s>
<s>
"	O
Two	O
geometries	O
are	O
topologically	O
equal	O
if	O
their	O
interiors	O
intersect	O
and	O
no	O
part	O
of	O
the	O
interior	O
or	O
boundary	O
of	O
one	O
geometry	O
intersects	O
the	O
exterior	O
of	O
the	O
other	O
"	O
.JTS	O
Technical	O
Specifications	O
of	O
2003.Within	O
&	O
Contains	O
T*F**FFF*	O
Disjoint	B-Algorithm
a	O
and	O
b	O
are	O
disjoint	B-Algorithm
:	O
they	O
have	O
no	O
point	O
in	O
common	O
.	O
</s>
<s>
Predicates	O
that	O
can	O
be	O
obtained	O
from	O
the	O
above	O
by	O
logical	O
negation	O
or	O
parameter	O
inversion	O
(	O
matrix	B-Architecture
transposition	O
)	O
,	O
as	O
indicated	O
by	O
the	O
last	O
column	O
:	O
</s>
<s>
Intersects	O
a	O
intersects	O
b	O
:	O
geometries	O
a	O
and	O
b	O
have	O
at	O
least	O
one	O
point	O
in	O
common.not	O
Disjoint	B-Algorithm
T********	O
*	O
T*******	O
***	O
T*****	O
****	O
T****	O
Within	O
(	O
inside	O
)	O
a	O
is	O
within	O
b	O
:	O
a	O
lies	O
in	O
the	O
interior	O
of	O
b.Contains(b,a )	O
T*F**F***	O
CoveredBy	O
a	O
is	O
covered	O
by	O
b	O
(	O
extends	O
Within	O
)	O
:	O
geometry	O
a	O
lies	O
in	O
b	O
.	O
</s>
<s>
Predicates	O
that	O
utilize	O
the	O
input	O
dimensions	O
,	O
and	O
are	O
defined	O
with	O
masks	O
of	O
domain	B-Application
:	O
</s>
<s>
Crosses	O
or	O
a	O
crosses	O
b	O
:	O
they	O
have	O
some	O
but	O
not	O
all	O
interior	O
points	O
in	O
common	O
,	O
and	O
the	O
dimension	O
of	O
the	O
intersection	B-Algorithm
is	O
less	O
than	O
that	O
of	O
at	O
least	O
one	O
of	O
them	O
.	O
</s>
<s>
Mask	O
selection	O
rules	O
are	O
checked	O
only	O
when	O
,	O
except	O
by	O
line/line	O
inputs	O
,	O
otherwise	O
is	O
false:ST_Crosses	O
T*T******	O
T*****T**	O
0********	O
Overlaps	O
a	O
overlaps	O
b	O
:	O
they	O
have	O
some	O
but	O
not	O
all	O
points	O
in	O
common	O
,	O
they	O
have	O
the	O
same	O
dimension	O
,	O
and	O
the	O
intersection	B-Algorithm
of	O
the	O
interiors	O
of	O
the	O
two	O
geometries	O
has	O
the	O
same	O
dimension	O
as	O
the	O
geometries	O
themselves	O
.	O
</s>
<s>
Historically	O
,	O
other	O
terms	O
and	O
other	O
formal	O
approaches	O
have	O
been	O
used	O
to	O
express	O
spatial	O
predicates	O
;	O
for	O
example	O
region	B-Application
connection	I-Application
calculus	I-Application
was	O
introduced	O
in	O
1992	O
by	O
Randell	O
,	O
Cohn	O
and	O
Cohn	O
.	O
</s>
<s>
The	O
choice	O
of	O
terminology	O
and	O
semantics	B-Application
for	O
the	O
spatial	O
predicates	O
is	O
based	O
on	O
reasonable	O
conventions	O
and	O
the	O
tradition	O
of	O
topological	O
studies	O
.	O
</s>
<s>
Relationships	O
such	O
as	O
Intersects	O
,	O
Disjoint	B-Algorithm
,	O
Touches	O
,	O
Within	O
,	O
Equals	O
(	O
between	O
two	O
geometries	O
a	O
and	O
b	O
)	O
have	O
an	O
obvious	O
semantic	B-Application
:	O
</s>
<s>
For	O
this	O
case	O
,	O
the	O
predicate	O
Covers	O
has	O
more	O
intuitive	O
semantics	B-Application
(	O
see	O
definition	O
)	O
,	O
avoiding	O
boundary	O
considerations	O
.	O
</s>
<s>
For	O
better	O
understanding	O
,	O
the	O
dimensionality	O
of	O
inputs	O
can	O
be	O
used	O
as	O
justification	O
for	O
a	O
gradual	O
introduction	O
of	O
semantic	B-Application
complexity	O
:	O
</s>
<s>
The	O
number	O
of	O
possible	O
results	O
in	O
a	O
boolean	O
9IM	O
matrix	B-Architecture
is	O
29	O
=	O
512	O
,	O
and	O
in	O
a	O
DE-9IM	B-Algorithm
matrix	B-Architecture
is	O
39	O
=	O
6561	O
.	O
</s>
<s>
The	O
composite	O
predicates	O
"	O
Intersects	O
OR	O
Disjoint	B-Algorithm
"	O
and	O
"	O
Equals	O
OR	O
Different	O
"	O
have	O
the	O
sum	O
100%	O
(	O
always	O
true	O
predicates	O
)	O
,	O
</s>
<s>
The	O
DE-9IM	B-Algorithm
offers	O
a	O
full	O
descriptive	O
assertion	O
about	O
the	O
two	O
input	O
geometries	O
.	O
</s>
<s>
It	O
is	O
a	O
mathematical	O
function	O
that	O
represents	O
a	O
complete	O
set	O
of	O
all	O
possible	O
relations	O
about	O
two	O
entities	O
,	O
like	O
a	O
Truth	O
table	O
,	O
the	O
Three-way	O
comparison	O
,	O
a	O
Karnaugh	O
map	O
or	O
a	O
Venn	B-Application
diagram	I-Application
.	O
</s>
<s>
As	O
illustrated	O
above	O
,	O
the	O
output	O
'	O
212101212	O
 '	O
resulted	O
from	O
DE-9IM(a,b )	O
is	O
a	O
complete	O
description	O
of	O
all	O
topologic	O
relations	O
between	O
specific	O
geometries	O
a	O
and	O
b	O
.	O
</s>
<s>
This	O
independence	O
of	O
geometry-type	O
and	O
the	O
lack	O
of	O
completeness	O
,	O
on	O
predicates	O
,	O
are	O
useful	O
for	O
general	B-Language
queries	I-Language
about	O
two	O
geometries	O
:	O
</s>
<s>
For	O
usual	O
applications	O
,	O
the	O
use	O
of	O
spatial	O
predicates	O
also	O
is	O
justified	O
by	O
being	O
more	O
human-readable	B-General_Concept
than	O
DE-9IM	B-Algorithm
descriptions	O
:	O
a	O
typical	O
user	O
have	O
better	O
intuition	O
about	O
predicates	O
(	O
than	O
a	O
set	O
of	O
interiors/border/exterior	O
intersections	B-Algorithm
)	O
.	O
</s>
<s>
Predicates	O
have	O
useful	O
semantic	B-Application
into	O
usual	O
applications	O
,	O
so	O
it	O
is	O
useful	O
the	O
translation	B-Algorithm
of	O
a	O
DE-9IM	B-Algorithm
description	O
into	O
a	O
list	O
of	O
all	O
associated	O
predicates	O
,	O
that	O
is	O
like	O
a	O
casting	O
process	O
between	O
the	O
two	O
different	O
semantic	B-Application
types	O
.	O
</s>
<s>
The	O
string	O
codes	O
""	O
and	O
""	O
have	O
the	O
semantic	B-Application
of	O
"	O
Intersects	O
&	O
Crosses	O
&	O
Overlaps	O
"	O
.	O
</s>
<s>
The	O
string	O
code	O
""	O
have	O
the	O
semantic	B-Application
of	O
"	O
Equals	O
"	O
.	O
</s>
<s>
The	O
string	O
codes	O
""	O
,	O
""	O
,	O
""	O
,	O
""	O
,	O
and	O
""	O
have	O
the	O
semantic	B-Application
of	O
"	O
Intersects	O
&	O
Touches	O
"	O
.	O
</s>
<s>
as	O
boolean	O
functions	O
,	O
and	O
the	O
DE-9IM	B-Algorithm
model	O
,	O
as	O
a	O
function	O
that	O
returns	O
a	O
string	O
(	O
the	O
DE-9IM	B-Algorithm
code	O
)	O
,	O
with	O
domain	B-Application
of	O
,	O
meaning	O
=	O
point	O
,	O
=	O
line	O
,	O
=	O
area	O
,	O
and	O
=	O
"	O
empty	O
set	O
"	O
.	O
</s>
<s>
This	O
DE-9IM	B-Algorithm
string	O
code	O
is	O
a	O
standardized	O
format	O
for	O
data	O
interchange	O
.	O
</s>
<s>
The	O
DE-9IM	B-Algorithm
in	O
the	O
OGC	O
standards	O
use	O
the	O
following	O
definitions	O
of	O
Interior	O
and	O
Boundary	O
,	O
for	O
the	O
main	O
OGC	O
standard	O
geometry	O
types	O
:	O
</s>
<s>
Most	O
spatial	B-Algorithm
databases	I-Algorithm
,	O
such	O
as	O
PostGIS	B-Application
,	O
implements	O
the	O
DE-9IM( )	O
model	O
by	O
the	O
standard	O
functions	O
:	O
ST_Relate	O
,	O
ST_Equals	O
,	O
ST_Intersects	O
,	O
etc	O
.	O
</s>
<s>
The	O
function	O
ST_Relate(a,b )	O
outputs	O
the	O
standard	O
OGC	O
's	O
DE-9IM	B-Algorithm
string	O
code	O
.	O
</s>
<s>
When	O
ST_Relate(a,b )	O
=	O
'	O
0FFFFF212	O
 '	O
,	O
the	O
returned	O
DE-9IM	B-Algorithm
code	O
have	O
the	O
semantic	B-Application
of	O
"	O
Intersects(a,b )	O
&	O
Crosses(a,b )	O
&	O
Within(a,b )	O
&	O
CoveredBy(a,b )	O
"	O
,	O
that	O
is	O
,	O
returns	O
true	O
on	O
the	O
boolean	O
expression	O
ST_Intersects(a,b )	O
AND	O
ST_Crosses(a,b )	O
AND	O
ST_Within(a,b )	O
AND	O
ST_Coveredby(a,b )	O
.	O
</s>
<s>
It	O
is	O
usual	O
to	O
overload	B-Language
the	O
by	O
adding	O
a	O
mask	O
parameter	O
,	O
</s>
<s>
"	O
Egenhofer-Matrix	O
"	O
is	O
a	O
synonym	O
for	O
the	O
9IM	O
3x3	O
matrix	B-Architecture
of	O
boolean	O
domain	B-Application
.	O
</s>
<s>
"	O
Clementini-Matrix	O
"	O
is	O
a	O
synonym	O
for	O
the	O
DE-9IM	B-Algorithm
3x3	O
matrix	B-Architecture
of	O
domain	B-Application
.	O
</s>
<s>
"	O
Egenhofer	O
operators	O
"	O
and	O
"	O
Clementini	O
operators	O
"	O
are	O
sometimes	O
a	O
reference	O
to	O
matrix	B-Architecture
elements	O
as	O
II	O
,	O
IE	O
,	O
etc	O
.	O
</s>
<s>
In	O
Region	B-Application
connection	I-Application
calculus	I-Application
operators	O
offer	O
some	O
synonyms	O
for	O
predicates	O
:	O
disjoint	B-Algorithm
is	O
DC	O
(	O
disconnected	O
)	O
,	O
touches	O
is	O
EC	O
(	O
externally	O
connected	O
)	O
,	O
equals	O
is	O
EQ	O
.	O
</s>
