Geohash

@Serializable(with = GeohashSerializer::class)
class Geohash : Comparable<Geohash> (source)

A rectangular cell on the WGS84 longitude and latitude plane, addressed by a Geohash string.

A Geohash is a cell rather than a string codec. Altitude is ignored.

Types

Link copied to clipboard
object Companion

Factories for valid Geohash cells.

Properties

Link copied to clipboard

The cell's two-dimensional extent in west, south, east, north order.

Link copied to clipboard

The geometric center of this cell.

Link copied to clipboard

The 32 finer cells, in base32ghs character order.

Link copied to clipboard
val length: Int

Number of base32ghs characters in this cell's address.

Link copied to clipboard

The adjacent cells at this length, with named compass directions.

Link copied to clipboard

The enclosing cell one character shorter, or null when length is 1.

Link copied to clipboard

This cell's lowercase base32ghs address.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Geohash): Int

Orders cells in the same order as their text forms.

Link copied to clipboard
operator fun contains(other: Geohash): Boolean

Returns true when other is this cell or one of its descendants.

operator fun contains(position: Position): Boolean

Returns true when position falls inside this cell.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun offsetBy(east: Int, north: Int): Geohash?

Returns the cell reached by moving east cells east and north cells north.

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

Returns text.

Link copied to clipboard
fun truncatedTo(length: Int): Geohash

Returns the enclosing cell whose address has length characters.