geo

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDistance

func ConvertDistance(
	distance float64,
	unit string,
) (converted float64, err []byte)

ConvertDistance converts a distance from meters to the desired unit

func DecodeInt

func DecodeInt(hash float64) (lat, lon float64)

DecodeInt returns the latitude and longitude from a geo hash The hash should be a float64, as it is used as score in a zset

func DegToRad

func DegToRad(deg float64) float64

func EncodeInt

func EncodeInt(lat, lon float64) float64

EncodeInt returns a geo hash for a given coordinate, and returns it in float64 so it can be used as score in a zset

func EncodeString

func EncodeString(lat, lon float64) string

func GetDistance

func GetDistance(
	lon1,
	lat1,
	lon2,
	lat2 float64,
) float64

func GetLatDistance

func GetLatDistance(lat1, lat2 float64) float64

func RadToDeg

func RadToDeg(rad float64) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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