isPointInsideComplex method

bool isPointInsideComplex(
  1. List<double> point
)

Checks if a point is within a complex polygon, considering the outer boundary and any inner holes.

The method first checks if the point is within the outer boundary. It then checks each hole, returning false if the point is found within any of them.

point is the point to check, represented as a List<double> containing the longitude and latitude coordinates.

Returns true if the point is within the outer boundary and not within any holes.

Implementation

bool isPointInsideComplex(List<double> point) {
  if (!isPointInside(point)) {
    return false;
  }
  for (int i = 1; i < coordinates.length; i++) {
    if (GeoJSONPolygon([coordinates[i]]).isPointInside(point)) {
      return false;
    }
  }
  return true;
}