Issue running anyflights() function cannot open file at get_planes()
Hello, running into an issue trying out the anyflights() function. Opened a fresh renv project with only this package and dependents installed. I believe based on the status messages its in the get_planes() part of the function.
For fun I also tried making a folder called "flights_data" in the project and writing to it. Frustratingly I can see the file does exist but it says it cant open it, weird.
It exists:
Hm, interesting. Could you run this code and paste the results here?
# if needed:
# install.packages("reprex")
reprex::reprex({
tempfile <- tempfile()
writeLines("This is a test line", tempfile)
zip_tempfile <- tempfile(fileext = ".zip")
zip(zip_tempfile, files = tempfile)
unzip(zip_tempfile)
})
there was no output so i added the print line. when i run it outside of reprex in console i get this instead
tempfile <- tempfile()
writeLines("This is a test line", tempfile)
zip_tempfile <- tempfile(fileext = ".zip")
zip(zip_tempfile, files = tempfile)
unzip(zip_tempfile)
print("do something")
#> [1] "do something"
Created on 2025-01-22 with reprex v2.1.1
It seems the issue is that
planes_src <- paste0(
"http://registry.faa.gov/database/yearly/ReleasableAircraft.",
year,
".zip"
)
in get_planes_data() now automatically reroutes to https://www.faa.gov/about/office_org/headquarters_offices/avs/offices/afx/afb/afb700 . The get_planes() help refers to this page https://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/releasable_aircraft_download and it looks like the "Download the Aircraft Registration Database (60MB)" link there to https://registry.faa.gov/database/ReleasableAircraft.zip does work. I'm testing to see if that file is in the same format as the yearly data to see if the fix can be to download that file instead and forget about year.