Adjacent
Namespace: Digi21.DigiNG.Entities.Relations
Assembly: Digi21.DigiNG
Indicates whether two areas are adjacent: they share at least one edge and neither has a vertex inside the other.

public static bool Adjacent(ReadOnlyLine a, ReadOnlyLine b)
public static bool Adjacent(ReadOnlyLine a, ReadOnlyPolygon b)
public static bool Adjacent(ReadOnlyPolygon a, ReadOnlyLine b)
public static bool Adjacent(ReadOnlyPolygon a, ReadOnlyPolygon b)
| Parameter | Description |
|---|---|
a |
First area: a closed ReadOnlyLine or a ReadOnlyPolygon. |
b |
Second area. |
Return value
true if all three conditions are met:
- No vertex of
ais insideband no vertex ofbis insidea. - The two areas have common vertices.
- Two consecutive vertices of a ring of
aare also consecutive vertices of a ring ofb(a common edge). Hole rings also count.
If the two areas are equal, or one is inside the other, the method returns false. See AreaArea for the full classification. If the areas have common vertices but no common edge, Join returns true.
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.