naqsha-0.2.0.0: A library for working with geospatial data types.

Safe HaskellNone
LanguageHaskell2010

Naqsha.Geometry.Coordinate.GeoHash

Description

This module implements the geohash encoding of geo-locations. https://en.wikipedia.org/wiki/Geohash. To try out geohash encoding on web visit http://geohash.org

Synopsis

Documentation

data GeoHash Source #

The encoding of geo-coordinates as a geohash string. Currently, the encoding supports 24 base32 digits of geo hash value which means we loose about 4-bits of accuracy w.r.t the representation of angles in the library. However, this loss is rather theoretical as the angular error that results from such loss is so insignificant that for all practical purposes, this accuracy is good enough --- GPS devices will have much greater errors. The quantity accuracy gives the number of bits of precision supported by the geohash implementation exposed here. As expected GeoHash implementations here will have problems at regions close to the poles.

encode :: Geo -> GeoHash Source #

Encode a geo-location into its GeoHash string.

decode :: GeoHash -> Geo Source #

Decode the geo-location from its GeoHash string.

accuracy :: Int Source #

Precision of encoding measured in bits.

toByteString :: GeoHash -> ByteString Source #

Convert the geo hash to bytestring.