FastSphericalUtils

open class FastSphericalUtils

FastSphericalUtils

Use this for indoors, for example, within the same venue. The refLatitude could be taken from the venue's anchor/position

Credits: Mapbox - Cheap Ruler

Author

Jose J Varó - Copyright © 2018 MapsPeople A/S. All rights reserved.

Constructors

Link copied to clipboard
open fun FastSphericalUtils(refLatitude: Double)
Units in meters
Link copied to clipboard
open fun FastSphericalUtils(refLatitude: Double, units: Double)

Functions

Link copied to clipboard
open fun area(@NonNull polygon: Array<Array<Array<Double>>>): Double
Given a polygon (an array of rings, where each ring is an array of points), returns the area.
open fun area(@NonNull multiPolygon: Array<Array<Array<Array<Double>>>>): Double
open fun area(@NonNull southwest: LatLng, @NonNull northeast: LatLng): Double
Link copied to clipboard
open fun bearing(@NonNull from: LatLng, @NonNull to: LatLng): Double
Returns the bearing between two points in degrees.
Link copied to clipboard
open fun distance(@NonNull from: LatLng, @NonNull to: LatLng): Double
open fun distance(    fromLatitude: Double,     fromLongitude: Double,     toLatitude: Double,     toLongitude: Double): Double
Given two points, returns the distance.
Link copied to clipboard
@NonNull
open fun get(): FastSphericalUtils
Link copied to clipboard
open fun getSquaredDistanceToLine(    @NonNull point: LatLng,     @NonNull lineP0: LatLng,     @NonNull lineP1: LatLng): Double
open fun getSquaredDistanceToLine(    @NonNull point: Point,     @NonNull lineP0: Point,     @NonNull lineP1: Point): Double
open fun getSquaredDistanceToLine(    pntX: Double,     pntY: Double,     lineP0x: Double,     lineP0y: Double,     lineP1x: Double,     lineP1y: Double): Double
Link copied to clipboard
@NonNull
open fun interpolate(    @NonNull from: LatLng,     @NonNull to: LatLng,     t: Double): LatLng
Link copied to clipboard
open fun manhattanDistance(@NonNull from: LatLng, @NonNull to: LatLng): Double
Given two points, returns the distance.
Link copied to clipboard
open fun sqrDistance(@NonNull from: LatLng, @NonNull to: LatLng): Double
open fun sqrDistance(@NonNull from: Point, @NonNull to: Point): Double
open fun sqrDistance(    fromLatitude: Double,     fromLongitude: Double,     toLatitude: Double,     toLongitude: Double): Double
Given two points, returns the squared distance.
Link copied to clipboard
open fun updateReferenceLatitude(refLatitude: Double): FastSphericalUtils
Updates the ruler with a new reference

Properties

Link copied to clipboard
val UNIT_FEET: Double
Link copied to clipboard
val UNIT_INCHES: Double
Link copied to clipboard
val UNIT_KILOMETERS: Double
Link copied to clipboard
val UNIT_METERS: Double
Link copied to clipboard
val UNIT_METRES: Double
Link copied to clipboard
val UNIT_MILES: Double
Link copied to clipboard
val UNIT_NAUTICALMILES: Double
Link copied to clipboard
val UNIT_YARDS: Double