Coordinate
A geographic location — a 2D point plus indoor levels, altitude, bearing, horizontal accuracy and time.
An immutable value type. The horizontal position is held as a single 2D GeoJSON point (the analog of iOS CLLocationCoordinate2D), with latitude/longitude exposed as accessors over it; altitude is kept separately in altitude. Build one from a point or from raw latitude/longitude, bridge from an Android Location via the Location constructor, or let the SDK decode it from API responses. Use copy to derive a modified instance, and toLocation to bridge back to an Android Location.
Constructors
Builds a coordinate from raw latitude/longitude with optional indoor levels and altitude.
Builds a coordinate from raw latitude/longitude placed on a single indoor level.
Builds a coordinate from raw latitude/longitude spanning a range of indoor levels.
Properties
Height from the floor of the defined level. Must be null outdoor.
Height from the ground of the defined level. Must be null outdoor.
The radius of uncertainty for the location, measured in meters, at the 68th percentile confidence level.
Get the latitude in radians.
The indoor levels this coordinate belongs to, or Levels.Outdoor when it is not inside a building.
Get the longitude in radians.
Functions
Returns the approximate initial bearing in degrees east of true north when traveling along the shortest path between this coordinate and the given coordinate. The shortest path is defined using the WGS84 ellipsoid. Coordinates that are (nearly) antipodal may produce meaningless results.
Returns a copy of this coordinate with the given fields replaced and every other field preserved.
Calculates the distance (measured in meters) from the current object’s coordinate to the specified coordinate. This uses the Haversine formula to account for global curvature.
Calculates the distance (measured in meters) from the current object’s coordinate to the specified coordinate taking altitude into account. This uses the Haversine formula to account for global curvature.
Calculates the distance (measured in meters) from the current object’s coordinate to the specified coordinate. This uses the Haversine formula to account for global curvature.
Adapted to Cartesian coordinates using Spherical model
Returns a compact, human-readable representation of this value.
Builds an Android Location representation of this coordinate from the stored values.