{"id":22180681,"url":"https://github.com/jftuga/geodist","last_synced_at":"2025-04-09T19:19:02.242Z","repository":{"id":117699183,"uuid":"407163090","full_name":"jftuga/geodist","owner":"jftuga","description":"Golang package to compute the distance between two geographic latitude, longitude coordinates","archived":false,"fork":false,"pushed_at":"2024-01-09T16:17:16.000Z","size":9,"stargazers_count":180,"open_issues_count":0,"forks_count":16,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T19:18:58.313Z","etag":null,"topics":["distance","geolocation","go","golang","haversine","vincenty"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-16T12:51:09.000Z","updated_at":"2025-04-07T09:50:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c240e0b-3e67-49cf-8bec-4762fcf4e883","html_url":"https://github.com/jftuga/geodist","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgeodist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgeodist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgeodist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgeodist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/geodist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094990,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distance","geolocation","go","golang","haversine","vincenty"],"created_at":"2024-12-02T09:19:14.969Z","updated_at":"2025-04-09T19:19:02.196Z","avatar_url":"https://github.com/jftuga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# geodist\nGoLang package to compute the distance between two geographic latitude, longitude coordinates\n\n## Algorithm Comparison\n* `Vincenty` is more accurate than `Haversine` because is considers the Earth's [ellipticity](https://www.dictionary.com/browse/ellipticity) when performing the calculation, but takes a longer time to compute.\n* [Wikipedia: Haversine](https://en.wikipedia.org/wiki/Haversine_formula)\n* [Wikipedia: Vincenty](https://en.wikipedia.org/wiki/Vincenty%27s_formulae)\n* [Is the Haversine Formula or the Vincenty's Formula better for calculating distance?](https://stackoverflow.com/q/38248046/452281)\n\n## Example\n* [example.go](example/example.go)\n\n```go\n\tvar newYork = geodist.Coord{Lat: 40.7128, Lon: 74.0060}\n\tvar sanDiego = geodist.Coord{Lat: 32.7157, Lon: 117.1611}\n\tmiles, km, ok := geodist.VincentyDistance(newYork, sanDiego)\n\tif !ok {\n\t\tfmt.Println(\"Unable to compute Vincenty Distance.\")\n\t\treturn\n\t}\n\tfmt.Printf(\" [Vincenty] New York to San Diego: %.3f m, %.3f km\\n\", miles, km)\n\n\tvar elPaso = geodist.Coord{Lat: 31.7619, Lon: 106.4850}\n\tvar stLouis = geodist.Coord{Lat: 38.6270, Lon: 90.1994}\n\tmiles, km = geodist.HaversineDistance(elPaso, stLouis)\n\tfmt.Printf(\"[Haversine] El Paso to St. Louis:  %.3f m, %.3f km\\n\", miles, km)\n```\n\n## Online Calculators\n* **Great Circle**: [NOAA: Latitude/Longitude Distance Calculator](https://www.nhc.noaa.gov/gccalc.shtml)\n* **Haversine**: [Moveable Type: Calculate distance, bearing and more between Latitude/Longitude points](https://www.movable-type.co.uk/scripts/latlong.html)\n* **Vincenty**: [CQSRG: WGS-84 World Geodetic System Distance Calculator](https://www.cqsrg.org/tools/GCDistance/)\n\n## Acknowledgements\n* [Haversine Algorithm](https://gist.github.com/cdipaolo/d3f8db3848278b49db68) in `GoLang`\n* [Vincenty Algorithm](https://web.archive.org/web/20181109001358/http://www.5thandpenn.com/GeoMaps/GMapsExamples/distanceComplete2.html) in `JavaScript`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fgeodist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Fgeodist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fgeodist/lists"}