CompletelyWithin

Namespace: Digi21.DigiNG.Entities.Relations
Assembly: Digi21.DigiNG

Indicates whether the first area is completely inside the second, without common vertices.

Area completely inside another area

public static bool CompletelyWithin(ReadOnlyLine a, ReadOnlyLine b)
public static bool CompletelyWithin(ReadOnlyLine a, ReadOnlyPolygon b)
public static bool CompletelyWithin(ReadOnlyPolygon a, ReadOnlyLine b)
public static bool CompletelyWithin(ReadOnlyPolygon a, ReadOnlyPolygon b)
Parameter Description
a Area to test for containment in b: a closed ReadOnlyLine or a ReadOnlyPolygon.
b Containing area.

Return value

true if all four conditions are met:

  • No vertex of a is outside b. A vertex inside a hole of b is outside b.
  • At least one vertex of a is inside b. Vertices of a lying on an edge of b are ignored.
  • No vertex of a coincides with a vertex of b.
  • No vertex of b, including holes, is inside a.

If a is inside b with any common vertex, this method returns false and Within(a, b) returns true. The method is asymmetric: to find whether b is completely inside a, call CompletelyWithin(b, a).

Exceptions

Exception When
ArgumentNullException a or b is null.
SEHException An area has an unclosed ring, a ring with zero area or a spike. See AreaArea exceptions.

Example

See the AreaArea example.