naqsha- A library for working with anything map related.

Safe HaskellNone



This module implements the geohash encoding of geo-locations. To try out geohash encoding on web visit



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.