geohash

package module
v0.0.0-...-c1f9b5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2015 License: MIT Imports: 2 Imported by: 0

README

Build Status

Geohash for Go

Usage

Encode:

geohash := geohash.Encode(37.941882, 23.653022)

Decode in BoundingBox

bbox := geohash.DecodeBoundingBox("sw8zf5pe7r7w")

Decode:

coords := geohash.Decode("sw8zf5pe7r7w")

Get Neighbor:

neighbor := geohash.Neighbor("sw8zf5pe7r7w", "left")

Get All Neighbors:

neighbors := geohash.Neighbors("sw8zf5pe7r7w")

http://en.wikipedia.org/wiki/Geohash

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Base32Map = []byte("0123456789bcdefghjkmnpqrstuvwxyz")

Functions

func Encode

func Encode(lat float64, long float64) string

func Neighbor

func Neighbor(geohash string, dir string) string

func Neighbors

func Neighbors(geohash string) []string

func PrecisionEncode

func PrecisionEncode(latitude float64, longitude float64, precision int) string

Types

type BoundingBox

type BoundingBox struct {
	MinLatitude  float64
	MaxLatitude  float64
	MinLongitude float64
	MaxLongitude float64
}

func DecodeBoundingBox

func DecodeBoundingBox(geohash string) *BoundingBox

type Coords

type Coords struct {
	Latitude  float64
	Longitude float64
}

func Decode

func Decode(geohash string) *Coords

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL