DistanceCalculator

interface DistanceCalculator

Fast distance calculator for WGS84 (Earth as spheroid). Should be initialized by latitude and used in some not far around area. Expected error is 0.04%.

To obtain DistanceCalculator instance, please, use MapboxSearchSdk.serviceProvider.

Return

Distance in meters.

Types

Companion
Link copied to clipboard
object Companion

Functions

distance
Link copied to clipboard
abstract fun distance(from: Point, to: Point): Double
Calculates distance between two coordinates.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
squareDistance
Link copied to clipboard
abstract fun squareDistance(from: Point, to: Point): Double
This function is faster than distance and used to compare distances.
toString
Link copied to clipboard
open fun toString(): String