bbox property
Returns the BoundingBox of the MultiPolygon.
Example:
MultiPolygon([
[
LinearRing([Coordinate(1, 2), Coordinate(3, 4), Coordinate(5, 6), Coordinate(1, 2)])
],
[
LinearRing([Coordinate(7, 8), Coordinate(9, 10), Coordinate(11, 12), Coordinate(7, 8)])
]
]).bbox; // BoundingBox(2, 1, 12, 11)
Implementation
@override
BoundingBox get bbox {
List<Point> points = explode();
if (points.length < 2) {
return BoundingBox.empty();
}
return BoundingBox.fromPoints(points);
}