M2LatLong

Latitude/longitude coordinate with optional timestamp.

Inheritors

Constructors

Link copied to clipboard
constructor()
constructor(lat: Double, lon: Double)
constructor(lat: Double, lon: Double, timestamp: Long)
constructor(xy: M2LatLong)

Properties

Link copied to clipboard
@SerialName(value = "latitude")
var latitude: Double

Latitude in decimal degrees (positive = north, negative = south).

Link copied to clipboard
@SerialName(value = "longitude")
var longitude: Double

Longitude in decimal degrees (positive = east, negative = west).

Link copied to clipboard

Application-defined tag for attaching arbitrary data. Not serialized.

Link copied to clipboard
@SerialName(value = "time")
var time: Long?

Epoch timestamp in milliseconds when this coordinate was recorded, or null.

Functions

Link copied to clipboard

Calculates the great-circle distance to other in kilometers.

fun distanceBetween(latitude: Double, longitude: Double): Float

Calculates the great-circle distance to another coordinate using the haversine formula.