【R】openSkies

1. はじめに

openSkiesは、航空や飛行データを取得したり表示、解析するためのパッケージです。OpenSky REST APIへのインターフェースの機能を提供しています。

2. インストール

CRANからインストールできます。

install.packages("openSkies")

3. つかってみる

情報を得るには、空港のICAOコードが必要です。

例えば、2020-01-01 12:00:00から2020-01-02 12:00:00までのフランクフルト空港発着データです。

library(openSkies)
dat <- getAirportArrivals(airport = "EDDF", startTime = "2020-01-01 12:00:00", endTime = "2020-01-02 12:00:00",
                   timeZone = "Europe/Berlin")
head(dat)
> head(dat)
[[1]]
Flight performed by aircraft with ICAO 24-bit address 780aec
Take-off time: 2020-01-02 13:09:59 Asia/Tokyo
Landing time:  2020-01-02 19:59:51 Asia/Tokyo
[[2]]
Flight performed by aircraft with ICAO 24-bit address 3c4d68
Take-off time: 2020-01-02 19:27:02 Asia/Tokyo
Landing time:  2020-01-02 19:59:11 Asia/Tokyo
[[3]]
Flight performed by aircraft with ICAO 24-bit address 3c65c3
Take-off time: 2020-01-02 19:19:49 Asia/Tokyo
Landing time:  2020-01-02 19:58:29 Asia/Tokyo
[[4]]
Flight performed by aircraft with ICAO 24-bit address 4d20f8
Take-off time: 2020-01-02 18:56:19 Asia/Tokyo
Landing time:  2020-01-02 19:57:19 Asia/Tokyo
[[5]]
Flight performed by aircraft with ICAO 24-bit address 3c60d6
Take-off time: 2020-01-02 17:52:12 Asia/Tokyo
Landing time:  2020-01-02 19:56:54 Asia/Tokyo
[[6]]
Flight performed by aircraft with ICAO 24-bit address 3c6677
Take-off time: 2020-01-02 19:10:49 Asia/Tokyo
Landing time:  2020-01-02 19:55:08 Asia/Tokyo

航空機を指定することもできます。

getAircraftFlights("346190", startTime = "2019-07-26 00:00:00", endTime = "2019-07-26 23:59:59",
                   timeZone = "Europe/Madrid")
[[1]]
Flight performed by aircraft with ICAO 24-bit address 346190
Take-off time: 2019-07-26 23:27:36 Asia/Tokyo
Landing time:  2019-07-27 00:52:57 Asia/Tokyo
[[2]]
Flight performed by aircraft with ICAO 24-bit address 346190
Take-off time: 2019-07-26 21:15:31 Asia/Tokyo
Landing time:  2019-07-26 21:54:28 Asia/Tokyo
[[3]]
Flight performed by aircraft with ICAO 24-bit address 346190
Take-off time: 2019-07-26 19:48:45 Asia/Tokyo
Landing time:  2019-07-26 20:27:10 Asia/Tokyo
[[4]]
Flight performed by aircraft with ICAO 24-bit address 346190
Take-off time: 2019-07-26 15:54:01 Asia/Tokyo
Landing time:  2019-07-26 16:30:52 Asia/Tokyo
[[5]]
Flight performed by aircraft with ICAO 24-bit address 346190
Take-off time: 2019-07-26 14:32:33 Asia/Tokyo
Landing time:  2019-07-26 15:09:58 Asia/Tokyo

4. さいごに

飛行機のデータを簡単に扱えていいですね。久々に旅行したいです。

Add a Comment

メールアドレスが公開されることはありません。