Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

# Within
[Spatial Relationships]

## OGC Definition

[OGC99-049] defines within as:

A.Within(B) iff ( A intersect B = A) and ( I(A) intersect I(B) is not empty)

where I(A) means the interior of A.

In terms of the DE-9IM [OGC99-049] defines within as:

A.Within(B) iff ( I(A) intersect I(B) is not empty) and ( I(A) intersect E(B) is empty) and ( B(A) intersect E(B) is empty) iff A.Relate(B, 'T*F**F***')

where E(B) means the exterior of B and the B(A) means the boundary of A and 'T*F**F***' means

dim( I(A) intersect I(B) ) belongs to { 0, 1, 2 }
dim ( I(A) intersect B(B) ) does not matter
dim ( I(A) intersect E(B) ) is empty
dim ( B(A) intersect I(B) ) does not matter
dim ( B(A) intersect B(B) ) does not matter
dim ( B(A) intersect E(B) ) is empty
dim ( E(A) intersect I(B) ) does not matter
dim ( E(A) intersect B(B) ) does not matter
dim ( E(A) intersect E(B) ) does not matter
where dim(...) means the dimension of ...

## Oracle Spatial Definition

There is none. The FDO Oracle Provider implements the Within operator using the OR'd combination of the inside and coveredby spatial operators.

within = Inside + CoveredBy as used in the third argument to the sdo_relate spatial operator, for example,
`sdo_relate(a.geometry, mdsys.sdo_geometry(2001, NULL, mdsys.sdo_point_type(1,1,NULL), NULL, NULL), 'mask=inside+coveredby')`.

## Illustration

Comments or suggestions? Send us feedback.