booleanDisjoint function

bool booleanDisjoint(
  1. GeoJSONObject feature1,
  2. GeoJSONObject feature2, {
  3. bool ignoreSelfIntersections = false,
})

Returns true if the intersection of the two geometries is an empty set. example:

var point = Point(coordinates: Position.of([2, 2]));
var line = LineString(
  coordinates: [
    Position.of([1, 1]),
    Position.of([1, 2]),
    Position.of([1, 3]),
    Position.of([1, 4])
  ],
);
booleanDisjoint(line, point);
//=true

Implementation

bool booleanDisjoint(GeoJSONObject feature1, GeoJSONObject feature2,
    {bool ignoreSelfIntersections = false}) {
  var bool = true;
  flattenEach(
    feature1,
    (flatten1, featureIndex, multiFeatureIndex) {
      flattenEach(
        feature2,
        (flatten2, featureIndex, multiFeatureIndex) {
          if (!bool) {
            return bool;
          }
          bool = _disjoint(
              flatten1.geometry!, flatten2.geometry!, ignoreSelfIntersections);
        },
      );
    },
  );
  return bool;
}