Portability | GHC |
---|---|
Stability | experimental |
Maintainer | marius@monkey.org |
Compute geohashes as per http://en.wikipedia.org/wiki/Geohash.
- encode :: (Fractional a, Ord a) => Int -> (a, a) -> Maybe String
- decode :: Fractional a => String -> Maybe (a, a)
- decode_ :: Fractional a => String -> Maybe ((a, a), (a, a))
Documentation
:: (Fractional a, Ord a) | |
=> Int | precision |
-> (a, a) |
|
-> Maybe String | geohash |
Encode a geohash from the given (lat, lon)
pair with the given
precision.
encode 10 (37.775, -122.419)
:: Fractional a | |
=> String | geohash |
-> Maybe (a, a) | (lat, lon) |
Decode a geohash into a (lat, lon)
pair.
decode "9q8yyk9pqd"
:: Fractional a | |
=> String | geohash |
-> Maybe ((a, a), (a, a)) | ((latmin, latmax), (lonmin, lonmax)) |
Decode a geohash into ranges of latitude & longitude. This reflects the precision of the decode and can be used to construct a bounding box.
decode_ "9q8yyk9pqd"