Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dillant Hopkins Airport lat and long are switched and lat * -1 #42

Open
hlendway opened this issue Oct 14, 2019 · 2 comments
Open

Dillant Hopkins Airport lat and long are switched and lat * -1 #42

hlendway opened this issue Oct 14, 2019 · 2 comments

Comments

@hlendway
Copy link

I was looking at the airports data and noticed that Dillant Hopkins Airport was at 72.27, i.e. the furthest north. I knew there were airports in Alaska to this seemed incorrect. The lat and lon in this file show lat of 42.89, long of -72.27, which is correct:
image
It is shown incorrect in the csv:
image
and also incorrect when you load in R:
image

I didn't have time to look into where/why this is happening but wanted to report, Vermont is not the furthest north airport :-)

@jwhendy
Copy link

jwhendy commented Oct 14, 2019

The plot thickens:

I can confirm the Dillant Hopkins oddity. It should be at (lat, lon) = ~(43, -72).

> airports %>% filter(name=="Dillant Hopkins Airport")
  faa   name                      lat   lon   alt    tz dst   tzone
1 EEN   Dillant Hopkins Airport  72.3  42.9   149    -5 A     NA   

But picking the first row shows that Landsdowne is actually correct.

> airports %>% filter(name=="Lansdowne Airport")
  faa   name                lat   lon   alt    tz dst   tzone           
1 04G   Lansdowne Airport  41.1 -80.6  1044    -5 A     America/New_York

It's odd that these are both pretty close. I would have suspected some E/W reversal.

@jwhendy
Copy link

jwhendy commented Oct 14, 2019

Which are off from @hlendway 's raw data?

library(tidyverse)
library(nycflights13)
data(airports)

raw <- read.csv("https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat", header=F)
raw_sub <- raw %>% select(c(2, 7, 8))
names(raw_sub) <- c("name", "lat", "lon")

aports_sub <- airports %>% select(name, lat, lon)
data_merged <- merge(raw_sub, aports_sub, by="name")
data_merged <- data_merged %>% transform(lat_delta = lat.x-lat.y, lon_delta = lon.x-lon.y)
data_merged %>% filter(abs(lat_delta) > 1 | abs(lon_delta) > 1)

Results:

                           name    lat.x     lon.x    lat.y      lon.y
1          Capital City Airport 38.18250  -84.9047 40.21714  -76.85136
2          Capital City Airport 40.21710  -76.8515 38.18197  -84.90614
3          Capital City Airport 42.77870  -84.5874 38.18197  -84.90614
4          Capital City Airport 42.77870  -84.5874 40.21714  -76.85136
5       Dillant Hopkins Airport 42.89840  -72.2708 72.27083   42.89833
6     Douglas Municipal Airport 31.34260 -109.5060 31.47674  -82.86057
7     Douglas Municipal Airport 31.47670  -82.8605 31.34260 -109.50645
8    Lawrence Municipal Airport 39.01120  -95.2166 42.71719  -71.12342
9                Linden Airport  5.96592  -58.2703 40.61745  -74.24459
10 Marshfield Municipal Airport 44.63690  -90.1893 42.09825  -70.67214
11   Plymouth Municipal Airport 41.90900  -70.7288 41.36513  -86.30026
12           San Carlos Airport  9.64772  -68.5747 37.51194 -122.24944
13        Shelby County Airport 39.41040  -88.8454 33.17778  -86.78322
14        Shelby County Airport 33.17700  -86.7828 39.41056  -88.84556
15           Tri Cities Airport 42.07850  -76.0963 46.26470 -119.11900
     lat_delta    lon_delta
1   -2.0346400   -8.0533401
2    2.0351260    8.0546374
3    4.5967296    0.3187366
4    2.5615629   -7.7360412
5  -29.3724336 -115.1691307
6   -0.1341386  -26.6454303
7    0.1340970   26.6459579
8   -3.7059944  -24.0931818
9  -34.6515272   15.9742922
10   2.5386519  -19.5171616
11   0.5438693   15.5714594
12 -27.8642237   53.6747446
13   6.2326226   -2.0621757
14  -6.2335579    2.0627572
15  -4.1862010   43.0227040

One could set the filter however makes sense to decide what is actually an error. I also don't have time at the moment to understand where these errors come from, but hopefully this is helpful in identifying suspect cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants