GeoBounds
public struct GeoBounds : Hashable, Codable, Sendable
A 2D-bounding box describing the area enclosing a track.
-
The minimum latitude value in degrees
Declaration
Swift
public var minLatitude: Double
-
The minimum longitude value in degrees
Declaration
Swift
public var minLongitude: Double
-
The maximum latitude value in degrees
Declaration
Swift
public var maxLatitude: Double
-
The maximum longitude value in degrees
Declaration
Swift
public var maxLongitude: Double
-
Initialized a
GeoBounds
value. You don’t need to construct this value by yourself, as it is done by GXPKits track parsing logic.Declaration
Swift
public init(minLatitude: Double, minLongitude: Double, maxLatitude: Double, maxLongitude: Double)
Parameters
minLatitude
The minimum latitude value in degrees.
minLongitude
The minimum longitude value in degrees.
maxLatitude
The maximum latitude value in degrees.
maxLongitude
The maximum longitude value in degrees.
-
The zero value of GeoBounds.
Its values are not zero but contain the following values:
minLatitude
Coordinate.validLatitudeRange.upperBound
minLongitude
Coordinate.validLongitudeRange.upperBound
maxLatitude
Coordinate.validLatitudeRange.lowerBound
maxLongitude
Coordinate.validLongitudeRange.lowerBound
See
Coordinate.validLongitudeRange
&Coordinate.validLatitudeRange.upperBound
for details.Declaration
Swift
static let empty: GeoBounds
-
Tests if two
GeoBound
values intersectsDeclaration
Swift
func intersects(_ rhs: GeoBounds) -> Bool
Parameters
rhs
The other
GeoBound
to test for intersection.Return Value
True if both bounds intersect, otherwise false.
-
Tests if a
GeoCoordinate
is within aGeoBound
Declaration
Swift
func contains(_ coordinate: GeoCoordinate) -> Bool
Parameters
coordinate
The
GeoCoordinate
to test for.Return Value
True if coordinate is within the bounds otherwise false.