Package com.citymapper.sdk.core.geo

Types

Link copied to clipboard
data class Coords(latitude: Double, longitude: Double)
Link copied to clipboard
data class CoordsBounds(latNorth: Double, lonEast: Double, latSouth: Double, lonWest: Double)

A geographical area representing a latitude/longitude aligned rectangle.

Link copied to clipboard
value class Distance(value: Double) : Comparable<Distance>
Link copied to clipboard
enum DistanceUnit : Enum<DistanceUnit>
Link copied to clipboard
data class Location(latitude: Double, longitude: Double, horizontalAccuracy: Distance, verticalAccuracy: Distance?, altitude: Distance?, speedMetersPerSecond: Float?, speedAccuracyMetersPerSecond: Float?, bearingDegrees: Float?, bearingAccuracyDegrees: Float?, date: Date)
Link copied to clipboard
typealias Path = List<Coords>
Link copied to clipboard
typealias PathGeometry = List<Coords>

Functions

Link copied to clipboard
fun Location.asCoords(): Coords
Link copied to clipboard
fun Coords.bearingTo(other: Coords): Double
Link copied to clipboard
fun Coords.coordinateAtOffset(distance: Distance, bearing: Double): Coords
Link copied to clipboard
fun Coords.distanceTo(other: Coords): Distance
Link copied to clipboard
tailrec fun PathGeometry.fractionalIndexBackwards(fromIndex: Float, distance: Distance): Float
fun PathGeometry.fractionalIndexBackwards(fromIndex: Int, distance: Distance): Float
Link copied to clipboard
tailrec fun PathGeometry.fractionalIndexForwards(fromIndex: Float, distance: Distance): Float
fun PathGeometry.fractionalIndexForwards(fromIndex: Int, distance: Distance): Float
Link copied to clipboard
fun PathGeometry.getBearingAfterPoint(pathIndex: Int): Float
Link copied to clipboard
fun PathGeometry.getBearingBeforePoint(pathIndex: Int): Float
Link copied to clipboard
fun PathGeometry.getDistanceBetween(startIndex: Int, endIndex: Int): Distance
Link copied to clipboard
fun PathGeometry.getPathBetween(fractionalStartIndex: Float, fractionalEndIndex: Float): List<Coords>
Link copied to clipboard
fun PathGeometry.getPointAtFractionalIndex(fractionalIndex: Float): Coords
Link copied to clipboard
fun Coords.isEffectivelyEqualTo(other: Coords): Boolean

https://xkcd.com/2170/

Link copied to clipboard
fun Coords.nearestPointOnLine(from: Coords, to: Coords): Pair<Coords, Double>
Link copied to clipboard
fun Double.toDistance(distanceUnit: DistanceUnit): Distance

Properties

Link copied to clipboard
val Location.accuracy: Distance
Link copied to clipboard
val Double.feet: Distance
Link copied to clipboard
val Float.feet: Distance
Link copied to clipboard
val Int.feet: Distance
Link copied to clipboard
val Long.feet: Distance
Link copied to clipboard
val Double.meters: Distance
Link copied to clipboard
val Float.meters: Distance
Link copied to clipboard
val Int.meters: Distance
Link copied to clipboard
val Long.meters: Distance
Link copied to clipboard
val Double.miles: Distance
Link copied to clipboard
val Float.miles: Distance
Link copied to clipboard
val Int.miles: Distance
Link copied to clipboard
val Long.miles: Distance
Link copied to clipboard
val PathGeometry.totalDistance: Distance
Link copied to clipboard
val Double.yards: Distance
Link copied to clipboard
val Float.yards: Distance
Link copied to clipboard
val Int.yards: Distance
Link copied to clipboard
val Long.yards: Distance