Skip to content

marcinwyszynski/geopoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GeoPoint GoDoc

Go library to represents geographical point and formulaes to calculate distance to another geographical point. The formula supplied here is Haversine but you can also use your own formula.

This library is extremely simple to use:

import (
  "fmt"
  "github.com/marcinwyszynski/geopoint"
)

func main() {
  dublin := geopoint.NewGeoPoint(53.347778, -6.259722)
  howth := geopoint.NewGeoPoint(53.386, -6.066)
  fmt.Printf("Author's daily commute is %.2f kilometres\n",
             2 * howth.DistanceTo(dublin), geopoint.Haversine)
}

For the full API please see godoc.org.

About

Go library to represent GPS coordinates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages