Swift Package Index


Location-related APIs intended to be used by server-side Swift applications.


  • The latest stable release is 1.0.5. Released over 1 year ago.
  • The last commit to master was over 1 year ago.

Swift Version Compatibility

  • 1.0.5 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 1.0.5 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

GeoSwift

Location-related APIs intended to be used by server-side Swift applications since there is no CoreLocation on Linux.

Build Status Latest Release Platforms Package Managers

Distance between 2 locations

do {
    let prague = try GeoCoordinate2D(latitude: 50.0880400, longitude: 14.4207600)
    let brno = try GeoCoordinate2D(latitude: 49.195060, longitude: 16.606837)

    let distancePragueBrnoInMeters = prague.distance(from: brno)
    print("Distance between Prague and Brno is \(distancePragueBrnoInMeters * 0.00062137) mi.")
} catch {
    // Tried to create an instance of `GeoCoordinate2D` with invalid coordinates.
}

Installation

Swift Package Manager

.Package(url: "https://github.com/petrpavlik/GeoSwift.git", majorVersion: 1)

License

MIT

Author

Petr Pavlik - @ptrpavlik