Documentation ¶
Index ¶
- Constants
- Variables
- func BboxesInt(minLat float64, minLon float64, maxLat float64, maxLon float64, bitDepth int64) []int64
- func DecodeBboxInt(geohash int64, bitDepth int64) (minLat float64, minLng float64, maxLat float64, maxLng float64)
- func DecodeInt(geohash int64, bitDepth int64) (lat float64, lng float64, latErr float64, lngErr float64)
- func EncodeInt(latitude float64, longitude float64, bitDepth int64) int64
- func FindBitDepth(distanceMeters float64) int64
- func NeighborInt(geohash int64, bearing bearing, bitDepth int64) int64
- func NeighborsInt(geohash int64, bitDepth int64) []int64
- func Shift(value int64, bitDepth int64) int64
Constants ¶
const ( // MaxBitDepth defines both the maximum and default geohash accuracy. MaxBitDepth int64 = 52 )
Variables ¶
var East = bearing{0, 1}
East bearing from reference point X
var North = bearing{1, 0}
North bearing from reference point X
var NorthEast = bearing{1, 1}
NorthEast bearing from reference point X
var NorthWest = bearing{1, -1}
NorthWest bearing from reference point X
var South = bearing{-1, 0}
South bearing from reference point X
var SouthEast = bearing{-1, 1}
SouthEast bearing from reference point X
var SouthWest = bearing{-1, -1}
SouthWest bearing from reference point X
var West = bearing{0, -1}
West bearing from reference point X
Functions ¶
func BboxesInt ¶
func BboxesInt(minLat float64, minLon float64, maxLat float64, maxLon float64, bitDepth int64) []int64
BboxesInt will return all the hash integers between minLat, minLon, maxLat, maxLon at the requested bitDepth
func DecodeBboxInt ¶
func DecodeBboxInt(geohash int64, bitDepth int64) (minLat float64, minLng float64, maxLat float64, maxLng float64)
DecodeBboxInt will decode a geohash integer into the bounding box that matches it.
Returned as a four corners of a square region.
func DecodeInt ¶
func DecodeInt(geohash int64, bitDepth int64) (lat float64, lng float64, latErr float64, lngErr float64)
DecodeInt with decode a integer geohashed number into pair of latitude and longitude value approximations.
Returned values include a latitude and longitude along with the maximum error of the calculation. This effectively means that a geohash integer will not return a location but an "area". The size of the area returned will be vary with different bitDepth settings.
Note: You should provide the same bitDepth to decode the number as was used to produce the geohash originally.
func EncodeInt ¶
EncodeInt will encode a pair of latitude and longitude values into a geohash integer.
The third argument is the bitDepth of this number, which affects the precision of the geohash but also must be used consistently when decoding. Bit depth must be even.
func FindBitDepth ¶
FindBitDepth will attempt to find the maximum bitdepth which contains the supplied distance
func NeighborInt ¶
NeighborInt will find the neighbor of a integer geohash in certain bearing/direction.
The bitDepth should be specified and the same as the value used to generate the hash.
func NeighborsInt ¶
NeighborsInt is the same as calling NeighborInt for each direction and will return all 8 neighbors and the center location.
Types ¶
This section is empty.