geolib

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

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

Go to latest
Published: Aug 4, 2016 License: MIT Imports: 2 Imported by: 0

README

GoDoc

Geo calculations

Based on: https://en.wikipedia.org/wiki/Geohash

Install

go get github.com/mausimag/geolib

Usage

location := GeoLocation{
	lat: 48.668683,
	lon: -4.329321,
}

encoded := GeoEncode(&location, 9)
fmt.Printf("Encoded: [%s]", encoded)

decoded := GeoDecode("gbsuv7z7x")
fmt.Printf("Decoded: [%v, %v]", decoded.lat, decoded.lon)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistanceBoundingCheck

func DistanceBoundingCheck(slat, slon float64, distance float64) (topLeft GeoLocation, bottomRight GeoLocation)

func GeoEncode

func GeoEncode(gl *GeoLocation, precision int) string

GeoEncode encodes GeoLocation

func IsGeoLocationInArea

func IsGeoLocationInArea(gl *GeoLocation, lTopLeft, lBottomRight *GeoLocation) bool

Types

type GeoLocation

type GeoLocation struct {
	// contains filtered or unexported fields
}

GeoLocation holds geo location info

func GeoDecode

func GeoDecode(hash string) *GeoLocation

GeoDecode decodes hash

Jump to

Keyboard shortcuts

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