CheapRuler

class CheapRuler(val lat: Double) : Ruler

A collection of very fast approximations to common geodesic measurements. Useful for performance-sensitive code that measures things on a city scale.

Creates a ruler instance for very fast approximations to common geodesic measurements around a certain latitude.

Parameters

{number} lat latitude

Constructors

Link copied to clipboard
constructor(lat: Double)

Properties

Link copied to clipboard
val kx: Double
Link copied to clipboard
val ky: Double
Link copied to clipboard
val lat: Double

Functions

Link copied to clipboard
open override fun along(line: LineString, dist: Double): LngLatAlt

Returns the point at a specified distance along the line.

Link copied to clipboard
open override fun bearing(a: LngLatAlt, b: LngLatAlt): Double

Returns the bearing between two points

Link copied to clipboard
open override fun destination(p: LngLatAlt, dist: Double, bearing: Double): LngLatAlt

Returns a new point given distance and bearing from the starting point.

Link copied to clipboard
open override fun distance(a: LngLatAlt, b: LngLatAlt): Double

Given two LngLatAlt returns the distance between them

Link copied to clipboard

Returns an object of the form {point, index, t}, where point is closest point on the line from the given point, index is the start index of the segment with the closest point, and t is a parameter from 0 to 1 that indicates where the closest point is on that segment.

Link copied to clipboard
Link copied to clipboard

Returns a new point given easting and northing offsets (in ruler units) from the starting point.

Link copied to clipboard

Returns the distance from a point p to a line segment a to b.