Documentation ¶
Overview ¶
Package geohash : go版的redis-geo模块,貌似有内存泄露问题,待查找和修正,目前不建议使用
Index ¶
- func Decode(code uint64) (float64, float64)
- func Distance(longitude1, latitude1, longitude2, latitude2 float64) float64
- func Encode(longitude, latitude float64) uint64
- func FromUInt64(code uint64) []byte
- func GetNeighbours(longitude, latitude, radiusMeters float64) [][2]uint64
- func ToString(buf []byte) string
- func ToUInt64(buf []byte) uint64
- type GeoCache
- func (g *GeoCache) GeoAdd(points ...*GeoPoint) int
- func (g *GeoCache) GeoDist(name1, name2 string) (float64, error)
- func (g *GeoCache) GeoDistPoint(lng1, lat1, lng2, lat2 float64) (float64, error)
- func (g *GeoCache) GeoPos(names ...string) []*GeoPoint
- func (g *GeoCache) GeoRadius(longitude, latitude, radius float64) []*GeoPoint
- func (g *GeoCache) GeoRadiusByMember(name string, radius float64) []*GeoPoint
- func (g *GeoCache) GeoRem(names ...string) int
- func (g *GeoCache) Len() int64
- func (g *GeoCache) LoadFromFile() error
- func (g *GeoCache) Reset()
- func (g *GeoCache) SaveToFile() error
- type GeoPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromUInt64 ¶
FromUInt64 converts uint64 geohash code to bytes
func GetNeighbours ¶
GetNeighbours returns geohash code of blocks within radiusMeters to the given coordinate
Types ¶
type GeoCache ¶
type GeoCache struct {
// contains filtered or unexported fields
}
GeoCache geo数据缓存集
func (*GeoCache) GeoDistPoint ¶
GeoDistPoint 计算距离,单位米
func (*GeoCache) GeoRadiusByMember ¶
GeoRadiusByMember 获取指定成员半径内的点
Click to show internal directories.
Click to hide internal directories.