detectAllOverlaps static method

Set<List<LatLng>> detectAllOverlaps(
  1. List<Polygon> targetSet, [
  2. List<Polygon>? neighbouringSet
])

This method accepts 2 lists of polygons and detect all possible overlaps within them targetSet and neighbouringSet

Implementation

static Set<List<LatLng>> detectAllOverlaps(List<Polygon> targetSet, [List<Polygon>? neighbouringSet]) {
  Set<List<LatLng>> overlaps = {};

  for (int i=0;i<targetSet.length-1;i++) {
    overlaps.addAll(detectOverlaps(targetSet[i], targetSet.sublist(i+1)));
  }

  if (neighbouringSet != null) {
    for (int i = 0; i < targetSet.length; i++) {
      for (int j = 0; j < neighbouringSet.length; j++) {}
      overlaps.addAll(detectOverlaps(targetSet[i], neighbouringSet));
    }
  }

  return overlaps;
}