gpsutil

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

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

Go to latest
Published: Oct 5, 2014 License: MIT Imports: 3 Imported by: 0

README

gpsutil

Geo/GPS related functionalities

Build Status GoDoc Go Walker

Documentation

Index

Constants

View Source
const (
	EARTH_RADIUS = 6371000.0
	MIN_LNG      = -math.Pi
	MAX_LNG      = math.Pi
	MIN_LAT      = -math.Pi / 2
	MAX_LAT      = math.Pi / 2
)

Variables

This section is empty.

Functions

func GeohashEncode

func GeohashEncode(lat, lng float64, precision int) string

func GetDistance

func GetDistance(lng1, lat1, lng2, lat2 float64) float64

GetDistance returns distance in meters between 2 given points

func GetTotalDistance

func GetTotalDistance(points []*LatLng) float64

GetTotalDistance returns total distance in meters for between points in a list

Types

type BBox

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

func GetBoundingBox

func GetBoundingBox(lat, lng, distance float64) *BBox

GetBoundingBox returns a bounding box for a point and certain distance in meters

func (*BBox) Northeast

func (bbox *BBox) Northeast() *LatLng

func (*BBox) Southwest

func (bbox *BBox) Southwest() *LatLng

type GeohashDecoded

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

func GeohashDecode

func GeohashDecode(hash string) (*GeohashDecoded, error)

func (*GeohashDecoded) Lat

func (ghd *GeohashDecoded) Lat() float64

func (*GeohashDecoded) LatErr

func (ghd *GeohashDecoded) LatErr() float64

func (*GeohashDecoded) Lng

func (ghd *GeohashDecoded) Lng() float64

func (*GeohashDecoded) LngErr

func (ghd *GeohashDecoded) LngErr() float64

type LatLng

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

func GetMidPoint

func GetMidPoint(points []*LatLng) (*LatLng, error)

GetMidPoint returns center point calculated based on a list of points

func GetPointByBearing

func GetPointByBearing(lat, lng, bearing, distance float64) *LatLng

GetPointByBearing returns a point calculated based on a given point, bearing and travelling distance lat, lng given in decimal degrees, bearing is given in degrees and distance is in meters

func (*LatLng) Lat

func (latlng *LatLng) Lat() float64

func (*LatLng) Lng

func (latlng *LatLng) Lng() float64

Jump to

Keyboard shortcuts

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