Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Golang package to compute the distance between two geographic latitude, longitude coordinates

License

NotificationsYou must be signed in to change notification settings

jftuga/geodist

Repository files navigation

GoLang package to compute the distance between two geographic latitude, longitude coordinates

Algorithm Comparison

Example

varnewYork= geodist.Coord{Lat:40.7128,Lon:74.0060}varsanDiego= geodist.Coord{Lat:32.7157,Lon:117.1611}miles,km,ok:=geodist.VincentyDistance(newYork,sanDiego)if!ok {fmt.Println("Unable to compute Vincenty Distance.")return}fmt.Printf(" [Vincenty] New York to San Diego: %.3f m, %.3f km\n",miles,km)varelPaso= geodist.Coord{Lat:31.7619,Lon:106.4850}varstLouis= geodist.Coord{Lat:38.6270,Lon:90.1994}miles,km=geodist.HaversineDistance(elPaso,stLouis)fmt.Printf("[Haversine] El Paso to St. Louis:  %.3f m, %.3f km\n",miles,km)

Online Calculators

Acknowledgements

About

Golang package to compute the distance between two geographic latitude, longitude coordinates

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp