An open API service indexing awesome lists of open source software.

https://github.com/sbooth/geodesic

CLLocationCoordinate2D extensions for geodesic calculations.
https://github.com/sbooth/geodesic

geodesic geodesy swift

Last synced: 3 months ago
JSON representation

CLLocationCoordinate2D extensions for geodesic calculations.

Awesome Lists containing this project

README

          

# Geodesic

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsbooth%2FGeodesic%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/sbooth/Geodesic)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsbooth%2FGeodesic%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/sbooth/Geodesic)

`CLLocationCoordinate2D` extensions for solving geodesic problems on an ellipsoid model of the Earth.

```swift
let lax = CLLocationCoordinate2D(latitude: 33.9424964, longitude: -118.4080486)
let jfk = CLLocationCoordinate2D(latitude: 40.6399278, longitude: -73.7786925)
let distance = lax.distanceTo(jfk)
// distance is approx. 3,982,961 m
```

## Installation

### Swift Package Manager

Add a package dependency to https://github.com/sbooth/Geodesic in Xcode.

### Manual or Custom Build

1. Clone the [Geodesic](https://github.com/sbooth/Geodesic) repository.
2. `swift build`.

## License

Geodesic is released under the [MIT License](https://github.com/sbooth/Geodesic/blob/main/LICENSE.txt).