Equal

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

Indicates whether two areas are equal.

Area equal to another area

public static bool Equal(ReadOnlyLine a, ReadOnlyLine b)
public static bool Equal(ReadOnlyLine a, ReadOnlyPolygon b)
public static bool Equal(ReadOnlyPolygon a, ReadOnlyLine b)
public static bool Equal(ReadOnlyPolygon a, ReadOnlyPolygon b)
Parameter Description
a First area: a closed ReadOnlyLine or a ReadOnlyPolygon.
b Second area.

Return value

true if either condition is met:

  • The outer rings have the same vertices in the same circular order, starting at any vertex and in either direction, and each hole of a is equal to a hole of b under the same rule. Both areas have the same number of holes. The closing vertex and consecutive duplicate vertices are removed before comparison.
  • The areas have common vertices and neither has a vertex inside or outside the other: vertices that are not common lie on the other area's edges. Thus an area is equal to another with the same outline and intermediate vertices on its edges.

A closed ReadOnlyLine can be equal to a ReadOnlyPolygon without holes. The Z coordinate, codes and attributes are not compared.

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.