Module oldnav_lib::navdata::geohash [] [src]

An integer based geohash. Inspired by the geohashrust package.

It uses the first 4 bits of the u64 to store the precision then the subsequent bits are used to store the hash value.

Currently there is a maximum precision of 15

Structs

Bounds

A rectangular boundary

Statics

LATLON_BOUNDS

bounds for the lat/lon coordinate system

PRECISION_BITS

number of precision bits

PRECISION_MAX

maximum value for precision of a geohash

PRECISION_MIN

minimum value for precision of a geohash

Traits

Geohashable

An object which is able to be geohashed.

Rectifiable

A trait for a vector type object that can be rectified to fit within a boundary.

Functions

decode

Decode integer geohash into a Bounds

decode_precision

decode an integer geohash with the specified precision.

decode_precision_nocheck

decode an integer geohash with specified precision, without checking whether or not the precision is less than the hash's internal precision.

encode

encode a Vector2 position into an unsigned integer geohash. wraps the position around the boundaries, to keep it within them.

hash_from_string

Create an integer geohash from a String

hash_precision

Get the precision value for an integer geohash.

hash_to_string

Convert an integer geohash to a string representation of the binary values

neighbor

Get the neighboring hash in the direction specified spherical: is whether or not to use spherical rectification/bounds wrapping.