Location

open class Location(var latitude: Angle, var longitude: Angle)

Geographic location with a latitude and longitude.

Inheritors

Constructors

Link copied to clipboard
constructor(latitude: Angle, longitude: Angle)
constructor()

Constructs a location with latitude and longitude both 0.

constructor(location: Location)

Constructs a location with the latitude and longitude of a specified location.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The location's latitude.

Link copied to clipboard

The location's longitude.

Functions

Link copied to clipboard
fun copy(location: Location): Location

Sets this location to the latitude and longitude of a specified location.

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

Computes the azimuth angle (clockwise from North) for the great circle path between this location and a specified location. This angle can be used as the starting azimuth for a great circle path beginning at this location, and passing through the specified location. This function uses a spherical model, not elliptical.

Link copied to clipboard

Computes the angular distance of the great circle path between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun greatCircleLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on the great circle path starting at this location and traversing with the specified azimuth and angular distance. This function uses a spherical model, not elliptical.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun interpolateAlongPath(endLocation: Location, pathType: PathType, amount: Double, result: Location): Location

Compute a location along a path between two locations. The amount indicates the fraction of the path at which to compute a location. This value is typically between 0 and 1, where 0 indicates the begin location (this location) and 1 indicates the end location.

Link copied to clipboard
fun linearAzimuth(location: Location): Angle

Computes the azimuth angle (clockwise from North) for the linear path between this location and a specified location. This angle can be used as the starting azimuth for a linear path beginning at this location, and passing through the specified location. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard

Computes the angular distance of the linear path between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard
fun linearLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on the linear path starting at this location and traversing with the specified azimuth and angular distance. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard
fun rhumbAzimuth(location: Location): Angle

Computes the azimuth angle (clockwise from North) for the rhumb path (line of constant azimuth) between this location and a specified location. This angle can be used as the starting azimuth for a rhumb path beginning at this location, and passing through the specified location. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun rhumbDistance(location: Location): Double

Computes the angular distance of the rhumb path (line of constant azimuth) between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun rhumbLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on a rhumb path (line of constant azimuth) starting at this location and traversing with the specified azimuth and angular distance. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun set(latitude: Angle, longitude: Angle): Location

Sets this location to a specified latitude and longitude.

Link copied to clipboard
fun setDegrees(latitudeDegrees: Double, longitudeDegrees: Double): Location

Sets this location to a specified latitude and longitude in degrees.

Link copied to clipboard
fun setRadians(latitudeRadians: Double, longitudeRadians: Double): Location

Sets this location to a specified latitude and longitude in radians.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String