BoundingBox
public struct BoundingBox : Sendable
extension BoundingBox: Hashable
extension BoundingBox: Codable
A bounding box indicates the extremes of a GeoJSONObject
along the x- and y-axes (longitude and latitude, respectively).
-
The southwesternmost position contained in the bounding box.
Declaration
Swift
public var southWest: LocationCoordinate2D
-
The northeasternmost position contained in the bounding box.
Declaration
Swift
public var northEast: LocationCoordinate2D
-
Initializes the smallest bounding box that contains all the given coordinates.
Declaration
Swift
public init?(from coordinates: [LocationCoordinate2D]?)
Parameters
coordinates
The coordinates to fit in the bounding box.
-
Initializes a bounding box defined by its southwesternmost and northeasternmost positions.
Declaration
Swift
public init(southWest: LocationCoordinate2D, northEast: LocationCoordinate2D)
Parameters
southWest
The southwesternmost position contained in the bounding box.
northEast
The northeasternmost position contained in the bounding box.
-
Returns a Boolean value indicating whether the bounding box contains the given position.
Declaration
Swift
public func contains(_ coordinate: LocationCoordinate2D, ignoreBoundary: Bool = true) -> Bool
Parameters
coordinate
The coordinate that may or may not be contained by the bounding box.
ignoreBoundary
A Boolean value indicating whether a position lying exactly on the edge of the bounding box should be considered to be contained in the bounding box.
Return Value
true
if the bounding box contains the position;false
otherwise. -
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public init(from decoder: Decoder) throws