GeoPoint

data class GeoPoint(@FloatRange(from = -90.0, to = 90.0) val latitude: Double, @FloatRange(from = -180.0, to = 180.0) val longitude: Double) : Parcelable

The implementation of geographic coordinates.

Constructors

Link copied to clipboard
constructor(@FloatRange(from = -90.0, to = 90.0) latitude: Double, @FloatRange(from = -180.0, to = 180.0) longitude: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Latitude value. It should be between -90.0 and 90.0.

Link copied to clipboard

The latitude of this GeoPoint as an Angle.

Link copied to clipboard

Longitude value. It should be between -180.0 and 180.0.

Link copied to clipboard

The longitude of this GeoPoint as an Angle.

Functions

Link copied to clipboard
fun angleTo(other: GeoPoint): Angle

Calculates the angle (bearing) between this GeoPoint and the GeoPoint given as an argument.

Link copied to clipboard

Calculates the geographic distance from this GeoPoint to the GeoPoint given as an argument.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks if this GeoPoint object is equal to another object. The objects are equal if the difference between the latitudes and longitudes is less than COORDINATE_COMPARISON_TOLERANCE.

Link copied to clipboard
fun fractionTo(other: GeoPoint, distance: Distance): Double

Calculates the fraction between this GeoPoint and the GeoPoint comparing to the total distance.

Link copied to clipboard
open override fun hashCode(): Int

Generates a hash code for this GeoPoint object by taking COORDINATE_COMPARISON_TOLERANCE into account.

Link copied to clipboard

Calculates a GeoPoint between this GeoPoint and the GeoPoint given as an argument.

Link copied to clipboard
fun toPlainString(coordinateSeparator: String): String

Renders a GeoPoint as a string.

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)