Swiftpack.co - csanfilippo/swift-sgp4 as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by csanfilippo.
csanfilippo/swift-sgp4 1.2.0
A Swift package to compute satellite positions from two-line elements (TLE).
⭐️ 3
🕓 1 year ago
iOS
.package(url: "https://github.com/csanfilippo/swift-sgp4.git", from: "1.2.0")

swift-sgp4

A Swift package to compute satellite positions from two-line elements (TLE), wrapping the sgp4lib library (by Daniel Warner)

Usage

import SGPKit

let title = "ISS (ZARYA)"
let firstLine = "1 25544U 98067A   13165.59097222  .00004759  00000-0  88814-4 0    47"
let secondLine = "2 25544  51.6478 121.2152 0011003  68.5125 263.9959 15.50783143834295"

// Instantiate a new TLE descriptor
let tle = TLE(title: title, firstLine: firstLine, secondLine: secondLine)

// Instantiate the interpreter
let interpreter = TLEInterpreter()

// Obtain the data
let data: SatelliteData = interpreter.satelliteData(from: tle, date: .now)

print(data.latitude)
print(data.longitude)
print(data.altitude)
print(data.speed)

Installation

Swift Package Manager

If you want to use SGPKit in any other project that uses SwiftPM, add the package as a dependency in Package.swift:

dependencies: [
  .package(
    url: "https://github.com/csanfilippo/swift-sgp4",
    from: "1.2.0"
  ),
]

GitHub

link
Stars: 3
Last commit: 50 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.2.0
1 year ago

Introducing TLEParser

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics