{"id":15038948,"url":"https://github.com/dastrobu/geodesic","last_synced_at":"2025-09-01T06:31:22.580Z","repository":{"id":31323716,"uuid":"127553247","full_name":"dastrobu/geodesic","owner":"dastrobu","description":"Compute distances in Swift","archived":false,"fork":false,"pushed_at":"2023-12-17T12:54:21.000Z","size":100,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T12:44:03.411Z","etag":null,"topics":["distance-calculation","geodesic","geodesics","swift","swift-4","swift-5","swift-library","swift-linux","vincenty","vincenty-formula"],"latest_commit_sha":null,"homepage":"","language":"C","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/dastrobu.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":"2018-03-31T17:05:59.000Z","updated_at":"2023-05-08T14:09:00.000Z","dependencies_parsed_at":"2025-02-16T03:31:42.789Z","dependency_job_id":"ea61acd8-2be9-4103-95e8-309d8f391ad0","html_url":"https://github.com/dastrobu/geodesic","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"f834e5e9d87a4e04f2bed24a892c91ec210d401b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dastrobu/geodesic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastrobu%2Fgeodesic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastrobu%2Fgeodesic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastrobu%2Fgeodesic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastrobu%2Fgeodesic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dastrobu","download_url":"https://codeload.github.com/dastrobu/geodesic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastrobu%2Fgeodesic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273082407,"owners_count":25042282,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-calculation","geodesic","geodesics","swift","swift-4","swift-5","swift-library","swift-linux","vincenty","vincenty-formula"],"created_at":"2024-09-24T20:40:54.093Z","updated_at":"2025-09-01T06:31:22.537Z","avatar_url":"https://github.com/dastrobu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# geodesic\n\n[![Swift Version](https://img.shields.io/badge/swift-5.9-blue.svg)](https://swift.org)\n![Platform](https://img.shields.io/badge/platform-macOS|linux--64-lightgray.svg)\n![Build](https://github.com/dastrobu/geodesic/actions/workflows/ci.yaml/badge.svg)\n[![GeographicLib Version](https://img.shields.io/badge/GeographicLib-2.1-blue.svg)](https://github.com/geographiclib/geographiclib-c/releases/tag/v2.1)\n\nSolver for the inverse geodesic problem in Swift.\n\nThe inverse geodesic problem must be solved to compute the distance between two points on an oblate spheroid, or\nellipsoid in general. The generalization to ellipsoids, which are not oblate spheroids is not further considered here,\nhence the term ellipsoid will be used synonymous with oblate spheroid.\n\nThe distance between two points is also known as the\n[Vincenty distance](https://en.wikipedia.org/wiki/Vincenty's_formulae).\n\nHere is an example to compute the distance between two points (the poles in this case) on the\n[WGS 84 ellipsoid](https://en.wikipedia.org/wiki/World_Geodetic_System).\n\n    import geodesic\n    let d = distance((lat: Double.pi / 2,lon: 0), (lat: -Double.pi / 2, lon: 0))\n\nand that's it.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [Installation](#installation)\n  - [Swift Package Manager](#swift-package-manager)\n- [Implementation Details](#implementation-details)\n- [Convergence and Tolerance](#convergence-and-tolerance)\n- [WGS 84 and other Ellipsoids](#wgs-84-and-other-ellipsoids)\n- [Known Issues](#known-issues)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\nAt least `clang-3.6` is required. On linux one might need to install it explicitly. There are no dependencies on macOS.\n\n### Swift Package Manager\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/dastrobu/geodesic.git\", from: \"1.4.0\"),\n    ]\n)\n```\n\n## Implementation Details\n\nThis Swift package is a wrapper for the\n[C implementation of the geodesic routines in GeographicLib](https://github.com/geographiclib/geographiclib-c).\nThe goal of this Swift package is to make some algorithms from\nGeographicLib available to the Swift world. Alternatively one can employ the\npackage [vincenty](https://github.com/dastrobu/vincenty)\nwhich is a much simpler solver for the inverse geodesic problem, completely written in Swift. Vincenty's formulae does,\nhowever, have some convergence problems in rare cases and may not give the same accuracy as Karney's algorithm.\n\n## Convergence and Tolerance\n\nThe computation does always converge and is said to compute up to machine precision. See documentation\nof [GeographicLib](https://geographiclib.sourceforge.io/) for details.\n\n## WGS 84 and other Ellipsoids\n\nBy default the\n[WGS 84 ellipsoid](https://en.wikipedia.org/wiki/World_Geodetic_System)\nis employed, but different parameters can be specified, e.g. for the\n[GRS 80 ellipsoid](https://en.wikipedia.org/wiki/GRS_80).\n\n    distance((lat: Double.pi / 2, lon: 0), (lat: -Double.pi / 2, lon: 0), \n             ellipsoid (a: 6378137.0, f: 1/298.257222100882711))\n\n## Known Issues\n\n* Compilation with gcc on Linux does not work. `swift build` fails. No problems with clang on Linux. \n \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastrobu%2Fgeodesic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdastrobu%2Fgeodesic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastrobu%2Fgeodesic/lists"}