GPXWaypoint
public class GPXWaypoint : GPXElement, GPXWaypointProtocol, Codable
A value type that represents waypoint based off GPX v1.1 schema’s wptType
.
According to the GPX schema, the waypoint type can represent the following:
- a waypoint
- a point of interest
- a named feature on a map
The waypoint should at least contain the attributes of both latitude
and longitude
in order to be considered a valid waypoint. Most attributes are optional, and are not required to be implemented.
-
Elevation of current point
Should be in unit meters (m)
Declaration
Swift
public var elevation: Double?
-
Date and time of current point
Should be in Coordinated Universal Time (UTC), without offsets, not local time.
Declaration
Swift
public var time: Date?
-
Magnetic Variation of current point
Should be in unit degrees (º)
Declaration
Swift
public var magneticVariation: Double?
-
Geoid Height of current point
Should be in unit meters (m). Height of geoid, or mean sea level, above WGS84 earth ellipsoid
Declaration
Swift
public var geoidHeight: Double?
-
Name of current point
Warning
- This attribute may not be useful, in schema context.
- This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var name: String?
-
Comment of current point
Warning
- This attribute may not be useful, in schema context.
- This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var comment: String?
-
Description of current point
Warning
- This attribute may not be useful, in schema context.
- This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var desc: String?
-
Source of data of current point
For assurance that current point is reliable
Declaration
Swift
public var source: String?
-
Text of GPS symbol name
Warning
- This attribute does not appear to be useful due to
CoreLocation
API. - This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var symbol: String?
- This attribute does not appear to be useful due to
-
Type of current point
Declaration
Swift
public var type: String?
-
Type of GPS fix of current point, represented as a number
- Supported Types: (written in order)
- None: No fix
- 2D: Position only
- 3D: Position and Elevation
- DGPS: Differential GPS
- PPS: Military Signal
Unknown fix should leave fix attribute as
nil
Warning
- This attribute may have limited usefulness due to
CoreLocation
API. - This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var fix: GPXFix?
- Supported Types: (written in order)
-
Number of satellites used to calculate GPS fix of current point
Declaration
Swift
public var satellites: Int?
-
Horizontal dilution of precision of current point
Declaration
Swift
public var horizontalDilution: Double?
-
Vertical dilution of precision of current point
Declaration
Swift
public var verticalDilution: Double?
-
Position dilution of precision of current point
Declaration
Swift
public var positionDilution: Double?
-
Age of DGPS Data
Number of seconds since last DGPS update
Warning
- This attribute may not be useful.
- This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var ageofDGPSData: Double?
-
DGPS’ ID
ID of DGPS station used in differential correction.
Warning
- This attribute may not be useful.
- This is carried over from GPX schema, to be compliant with the schema.
Declaration
Swift
public var DGPSid: Int?
-
Extension to GPX v1.1 standard.
Declaration
Swift
public var extensions: GPXExtensions?
-
Latitude of current point
- Latitude value should be within range of -90 to 90
- Should be in unit degrees (º)
- Should conform to WGS 84 datum.
Declaration
Swift
public var latitude: Double?
-
Longitude of current point
- Longitude value should be within range of -180 to 180
- Should be in unit degrees (º)
- Should conform to WGS 84 datum.
Declaration
Swift
public var longitude: Double?
-
Initialize with current date and time
The waypoint should be configured appropriately after initializing using this initializer. The
time
attribute will also be set to the time of initializing.Note
At least latitude and longitude should be configured as required by the GPX v1.1 schema.Declaration
Swift
public required init()
-
Initialize with current date and time, with latitude and longitude.
The waypoint should be configured appropriately after initializing using this initializer. The
time
attribute will also be set to the time of initializing, along withlatitude
andlongitude
attributes.Remark
Other attributes can still be configured as per normal.
Declaration
Swift
public init(latitude: Double, longitude: Double)
Parameters
latitude
latitude value of the waypoint, in
Double
orCLLocationDegrees
, WGS 84 datum only. Should be within the ranges of -90.0 to 90.0longitude
longitude value of the waypoint, in
Double
orCLLocationDegrees
, WGS 84 datum only. Should be within the ranges of -180.0 to 180.0 -
Initialize a point type, and verifies that point is within ranges of what latitude and longitude should be.
See also
init(latitude:longitude:)Declaration
Swift
public convenience init(verifiedLatitude latitude: Double, longitude: Double) throws
-
for initializing a
GPXLink
with href, which is added to this point type as well.This method works by initializing a new
GPXLink
, adding to this point type, then return theGPXLink
Warning
Will be deprecated starting version 0.5.0Declaration
Swift
@available(*, deprecated, message: "Initialize GPXLink first then, add it to this point type instead.") public func newLink(withHref href: String) -> GPXLink
Parameters
href
a URL hyperlink as a
String