An open API service indexing awesome lists of open source software.

https://github.com/vectorhacker/go.geohash

geohash is a simple implementation of the Public Domain Geohash algorithm. It represents the hashes using boxes which contain the resulting hashes and can reverse the box, using the geohash and the precision to recreate it at.
https://github.com/vectorhacker/go.geohash

Last synced: 5 months ago
JSON representation

geohash is a simple implementation of the Public Domain Geohash algorithm. It represents the hashes using boxes which contain the resulting hashes and can reverse the box, using the geohash and the precision to recreate it at.

Awesome Lists containing this project

README

          

GeoHash Algororithm in Go
=====

Example

```go
package main

import "github.com/vectorhacker/go.geohash"

func main() {
box := geohash.Encode(46.7666, -101.4650, 0) // 0 is the same as full presicion

boxes := box.Neighbors()

boxesBoxes := boxes[0].Neighbors()

// ....

box1 := geohash.Decode("c8rf51e7n", 12)
box1.Neighbors()

// ...
}
```