contains method

bool contains(
  1. RectangleGeographicArea area
)

Checks if this rectangle completely contains another rectangle.

Parameters

Returns

  • True if this rectangle contains the other, false otherwise.

Implementation

bool contains(final RectangleGeographicArea area) {
  return bottomRight.longitude >= area.bottomRight.longitude &&
      topLeft.longitude <= area.topLeft.longitude &&
      topLeft.latitude >= area.topLeft.latitude &&
      bottomRight.latitude <= area.bottomRight.latitude;
}