Latest 3.2.0
Homepage https://github.com/ckhsponge/iAirportsDB
License MIT
Platforms ios 9.3, osx 10.9, tvos 9.0, watchos 3.0
Authors

NOTE: this library was converted to Swift 3 and made a pod! See the objectivec or swift2 branch for the old style.

This project is a mac and iOS database for airports worldwide. A Cocoa framework Core Data model and accompanying Swift classes are used. Runway and frequency information is also included.

Add this line to your Podfile:

pod 'iAirportsDB', :git => 'https://github.com/ckhsponge/iairportsdb.git'

IMPORTANT: The pod now only includes an empty database. Download a complete database using the below command.

curl -O https://raw.githubusercontent.com/ckhsponge/iairportsdb/master/Example/data/iAirportsDBExample.sqlite

Add the downloaded file to your Xcode project and then configure IADB to use it using:

IADBModel.setPersistence(path: Bundle.main.path(forResource: "iAirportsDBExample", ofType: "sqlite")!)

This databse is used in the wildly popular NRST: Descent Rate & Airport Finder for iOS.

Here are some stubs of the data you get:

class IADBAirport {
    var identifier: String // gps code
    var latitude: Double
    var longitude: Double
    var name: String
    var type: String
    var elevationFeet: NSNumber? // for objc compatibility Int32? is not allowed, -1 is a valid elevation
    var code: String // iata code e.g. ICN, this is what is printed on boarding passes
    var municipality: String /// Normally the nearby city e.g. Seoul
    var runways:[IADBRunway]
    var frequencies:[IADBFrequency]
}

class IADBRunway {
    var closed: Bool
    var lighted: Bool
    var headingTrue: Float // runway 12 will have a magnetic heading of ~120
    var identifierA: String // e.g. 12
    var identifierB: String // e.g. 30
    var lengthFeet: Int32
    var surface: String // e.g. TURF
    var widthFeet: Int32
}

class IADBFrequency {
    var mhz: Float
    var name: String // e.g. APP
    var type: String // e.g. NORCAL APP
}

Find airports using:

  • IADBAirport.findNear(CLLocation, withinNM:CLLocationDistance)
  • IADBAirport.findNear(CLLocation, withinNM:CLLocationDistance, types:[IADBAirport.AirportType]?)
  • IADBAirport.findAllByIdentifier(String)

Or in Objective C:

  • [IADBAirport findNear:(CLLocation *) location withinNM:(CLLocationDistance) distance]
  • [IADBAirport findAllByIdentifier:(NSString *) identifier]
  • [IADBNavigationAid findNear:(CLLocation *) location withinNM:(CLLocationDistance) distance]
  • [IADBNavigationAid findAllByIdentifier:(NSString *) identifier]
  • [IADBLocation findNear:(CLLocation *) location withinNM:(CLLocationDistance) distance]
  • [IADBLocation findAllByIdentifier:(NSString *) identifier]

Latest podspec

{
    "name": "iAirportsDB",
    "version": "3.2.0",
    "summary": "Quickly find airports near a location",
    "swift_version": "4.2",
    "description": "Airports, heliports, seaplane bases, and balloonports can quickly be found near a location or by identifier. Supporting information such as runways and frequencies are provided. Information is global. The library is Swift but Objective C is supported. Behind the scenes Core Data using sqlite provides the framework for fast lookups.",
    "homepage": "https://github.com/ckhsponge/iAirportsDB",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Hobbs": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ckhsponge/iAirportsDB.git",
        "tag": "3.2.0"
    },
    "platforms": {
        "ios": "9.3",
        "osx": "10.9",
        "tvos": "9.0",
        "watchos": "3.0"
    },
    "source_files": "iAirportsDB/Classes/**/*",
    "resource_bundles": {
        "resourcebundle": [
            "iAirportsDB/Assets/*"
        ]
    }
}

Pin It on Pinterest

Share This