RectangleGeographicArea constructor

RectangleGeographicArea({
  1. required Coordinates topLeft,
  2. required Coordinates bottomRight,
})

Creates a rectangular geographic area from corner coordinates.

Constructs a rectangle using the specified top-left (northwest) and bottom-right (southeast) corner coordinates. The rectangle's sides will be aligned with latitude and longitude lines.

Parameters

  • topLeft: The northwest corner coordinate. Should have latitude greater than bottomRight and longitude less than bottomRight for a valid rectangle.
  • bottomRight: The southeast corner coordinate.

Note

The constructor does not validate coordinate ordering. Ensure that topLeft.latitude > bottomRight.latitude and topLeft.longitude < bottomRight.longitude for correct behavior.

Implementation

RectangleGeographicArea({required this.topLeft, required this.bottomRight});