Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeAreaToLongLat(area *Area) (float64, float64)
- func DecodeToLongLatWGS84(bits uint64) (float64, float64)
- func DistBetweenGeoHashWGS84(hash0 uint64, hash1 uint64) float64
- func EncodeToBase32(hash uint64) []byte
- func EncodeWGS84(longitude, latitude float64) (uint64, error)
- func GetDistance(lon0d, lat0d, lon1d, lat1d float64) float64
- type Area
- type HashBits
- type Neighbors
- type Point
- type Radius
- type Range
Constants ¶
View Source
const ( WGS84_LAT_MIN = -85.05112878 WGS84_LAT_MAX = 85.05112878 WGS84_LONG_MIN = -180 WGS84_LONG_MAX = 180 WGS84_GEO_STEP = 26 )
View Source
const ( MERCATOR_MAX float64 = 20037726.37 EARTH_RADIUS_IN_METERS float64 = 6372797.560856 D_R = (math.Pi / 180.0) )
Variables ¶
View Source
var ( WGS84_LONG_RANGE = &Range{Max: WGS84_LONG_MAX, Min: WGS84_LONG_MIN} WGS84_LAT_RANGE = &Range{Max: WGS84_LAT_MAX, Min: WGS84_LAT_MIN} )
View Source
var ( ErrPositionOutOfRange = errors.New("position out of range of WGS84") ErrStepOutOfRange = errors.New("geohash encode step must less-equal than 32 and greater than 0") )
Functions ¶
func DecodeAreaToLongLat ¶
func DecodeToLongLatWGS84 ¶
func DistBetweenGeoHashWGS84 ¶
func EncodeToBase32 ¶
func EncodeWGS84 ¶
func GetDistance ¶
Types ¶
type Area ¶
func DecodeWGS84 ¶
type Neighbors ¶
type Neighbors struct { North HashBits East HashBits West HashBits South HashBits NorthEast HashBits SouthEast HashBits NorthWest HashBits SouthWest HashBits }
func GetNeighbors ¶
type Radius ¶
func GetAreasByRadiusWGS84 ¶
Click to show internal directories.
Click to hide internal directories.