private IEnumerable <NeighbourInfo> CalculateNeighbours(KeyValuePair <Parcel, ISubdivisionContext> subject, NeighbourSet <ISubdivisionContext> nodes) { foreach (var edge in subject.Key.Edges) { var query = new LineSegment2(edge.Start, edge.End); var neighbours = nodes.Neighbours(query, MathHelper.ToRadians(5), 1); foreach (var neighbour in neighbours) { //Do not add self as a neighbour! if (neighbour.Value.Equals(subject.Value)) { continue; } yield return(new NeighbourInfo( neighbour.Value, neighbour.Segment.Transform(WorldTransformation), neighbour.SegmentOverlapStart, neighbour.SegmentOverlapEnd, query.Transform(WorldTransformation), neighbour.QueryOverlapStart, neighbour.QueryOverlapEnd )); } } }