Within

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

Indicates whether the line is inside the area.

Line inside an area

public static bool Within(ReadOnlyLine line, ReadOnlyLine area)
public static bool Within(ReadOnlyLine line, ReadOnlyPolygon area)
Parameter Description
line Line.
area Area: a closed ReadOnlyLine or a ReadOnlyPolygon.

Return value

true if all line vertices are inside the area. A vertex on the boundary or inside a polygon's hole is not considered inside the area, so the method returns false if any line vertex touches the boundary.

Because only vertices are analyzed, the method returns true even if a line edge leaves the area between two interior vertices, for example by crossing an indentation in the outline or a hole.

Exceptions

Exception When
ArgumentNullException line or area is null.

Example

See the LineArea example.