https://github.com/echoface/proximityhash
generates a set of geohashes that cover a circular area, given the center coordinates and the radius
https://github.com/echoface/proximityhash
Last synced: 5 months ago
JSON representation
generates a set of geohashes that cover a circular area, given the center coordinates and the radius
- Host: GitHub
- URL: https://github.com/echoface/proximityhash
- Owner: echoface
- License: mit
- Created: 2023-01-29T13:41:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-12T07:22:57.000Z (over 3 years ago)
- Last Synced: 2025-06-14T09:23:30.989Z (12 months ago)
- Language: Go
- Size: 3.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go version of proximity hash
ProximityHash(go): Geohashes in Proximity (with the option of compression util)
this package is a port of [ashwin711/proximityhash](https://github.com/ashwin711/proximityhash)
Geohash is a geocoding system invented by Gustavo Niemeyer and placed into the public domain. It is a hierarchical spatial data structure which subdivides space into buckets of grid shape, which is one of the many applications of what is known as a Z-order curve, and generally space-filling curves.
**ProximityHash** generates a set of geohashes that cover a circular area, given the center coordinates and the radius. It also has an additional option to use **GeoRaptor** that creates the best combination of geohashes across various levels to represent the circle, starting from the highest level and iterating till the optimal blend is brewed. Result accuracy remains the same as that of the starting geohash level, but data size reduces considerably, thereby improving
speed and performance.
Example
-------
$ proximityhash 48.858156 2.294776 1000 7

$ proximityhash 48.858156 2.294776 2000 7 --georaptor true

$ proximityhash 48.858156 2.294776 2000 7 --georaptor true --minlevel 3 --maxlevel 6

Installation
------------
To install proximityhash, simply
`go get github.com/echoface/proximityhash`
API:
```go
package proximityhash
// CompressGeoHash compress api, merge geohash codes as most as possible
func CompressGeoHash(codes []string, minPrecision, cutoffPrecision int) []string
// CreateGeohash generate geohash codes that cover a circular area
func CreateGeohash(latitude, longitude, radius float64, precision uint) []string
```
License:
--------
Licensed under the MIT License
Contributors:
-------------
- gonghuan.dev@gmail.com [https://github.com/echoface]