LatLongPosition

Unmodifiable state version of LatLng, also implementing the GeoPosition interface.

Constructors

Link copied to clipboard
constructor(lat: Double, lon: Double)
constructor(lat: Double, lon: Double, distanceFormula: LatLongPosition.DistanceFormula)
constructor(lat: Double, lon: Double, distanceFormula: Int)
constructor(lat: Number, lon: Number)

Types

Link copied to clipboard
Possible methods to compute the distance between two latitude-longitude points.

Properties

Link copied to clipboard
Link copied to clipboard
Mean Earth radius in meters.

Functions

Link copied to clipboard
open fun boundingBox(range: Double): List<GeoPosition>
Given a range, produces N coordinates, representing the N opposite vertices of the hypercube having the current coordinate as center and circumscribing the N-sphere defined by the range.
Link copied to clipboard
open fun distance(point1: LatLng, point2: LatLng, df: LatLongPosition.DistanceFormula): Double
Distance between two points.
open fun distance(point1: LatLng, point2: LatLng, unit: LengthUnit, df: LatLongPosition.DistanceFormula): Double
Distance between two points with arbitrary LengthUnit.
Link copied to clipboard
open fun distanceInRadians(point1: LatLng, point2: LatLng, precision: LatLongPosition.DistanceFormula): Double
This "distance" function is mostly for internal use.
Link copied to clipboard
open fun distanceTo(other: GeoPosition): Double
Computes the distance between this position and another compatible position.
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
abstract fun getCoordinate(dimension: Int): Double

Allows to access the value of a coordinate.

open fun getCoordinate(dimension: Int): Double
Allows to access the value of a coordinate.
Link copied to clipboard
Allows to get the position as a Number array.
Link copied to clipboard
open fun getDimensions(): Int
Link copied to clipboard
open fun getLatitude(): Double
Link copied to clipboard
open fun getLongitude(): Double
Link copied to clipboard
open fun getX(): Double
Link copied to clipboard
open fun getY(): Double
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun minus(other: Array<Double>): GeoPosition
Considers both positions as vectors, and returns the difference between this position and the passed one.
open fun minus(other: GeoPosition): GeoPosition
Subtracts the provided GeoPosition from this GeoPosition.
Link copied to clipboard
open fun plus(other: Array<Double>): GeoPosition
Considers both positions as vectors, and sums them.
open fun plus(other: GeoPosition): GeoPosition
Adds two GeoPosition.
Link copied to clipboard
open fun toString(): String