onelifexv Posted July 27, 2012 Report Share Posted July 27, 2012 Trying to set up KATL as a hub and it doesn't recognize the ICAO code. Any suggestions? Thanks. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted July 28, 2012 Moderators Report Share Posted July 28, 2012 Add it manually using google earth for the lat and lon and so on for the description. Quote Link to comment Share on other sites More sharing options...
onelifexv Posted July 28, 2012 Author Report Share Posted July 28, 2012 Where does it actually pull the data from, though? Is it external or in a config file? Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted July 28, 2012 Moderators Report Share Posted July 28, 2012 Follow up the picture: Quote Link to comment Share on other sites More sharing options...
onelifexv Posted July 28, 2012 Author Report Share Posted July 28, 2012 I understand that. That wasn't the question. I'm curious as to where the 'Look up' actually pulls data from, whether it's internally and editable by an admin or whether it pulls from an external source, so I can fix issues like this and not need to rely on manual additoins. Quote Link to comment Share on other sites More sharing options...
PlumbBum Posted July 28, 2012 Report Share Posted July 28, 2012 I understand that. That wasn't the question. I'm curious as to where the 'Look up' actually pulls data from, whether it's internally and editable by an admin or whether it pulls from an external source, so I can fix issues like this and not need to rely on manual additoins. phpvms_airports table in your mysql database. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted July 28, 2012 Moderators Report Share Posted July 28, 2012 It's in admin/modules/operations and airports function will be the one but that function is connected to another function to find the airports which I don't know where it is, so my opinion is that instead of going through the whole lot of searching use the manual procedure. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted July 28, 2012 Report Share Posted July 28, 2012 Lat: 33.6366995 Lon: 84.4278639 Quote Link to comment Share on other sites More sharing options...
onelifexv Posted July 28, 2012 Author Report Share Posted July 28, 2012 phpvms_airports table in your mysql database. That's where airports that are saved are stored. I'm curious to know where the 'Lookup' function pulls it's data. KATL is the busiest airport in the world, kind of odd that it isn't in whatever database it's pulling from. I'm trying to determine if the lookup is pulling data stored locally or going elsewhere to find it's data. Quote Link to comment Share on other sites More sharing options...
onelifexv Posted July 28, 2012 Author Report Share Posted July 28, 2012 I've been able to determine that the function is lookupICAO(), but I haven't been able to find it yet. It's not in /admin/Modules/Operations. Still looking through the other files. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted July 28, 2012 Administrators Report Share Posted July 28, 2012 The function is contained in the phpvmsadmin.js file in the admin lib folder. function lookupICAO() { icao = $("#airporticao").val(); if (icao.length != 4) { $("#statusbox").html("Please enter the full 4 letter ICAO"); return false; } $("#statusbox").html("Fetching airport data..."); $("#lookupicao").hide(); if (airport_lookup == "geonames") { url = geourl + "/searchJSON?style=medium&maxRows=10&featureCode=AIRP&type=json&q=" + icao + "&callback=?"; } else { url = phpvms_api_server + "/airport/get/" + icao + "&callback=?"; } $.getJSON(url, function(data) { if (data.totalResultsCount == 0) { $("#statusbox").html("Nothing found. Try entering the full 4 letter ICAO"); $("#lookupicao").show(); return; } if (data.geonames) { data.airports = data.geonames; } $.each(data.airports, function(i, item) { $("#airporticao").val(icao); $("#airportname").val(item.name); $("#airportcountry").val(item.countryName); $("#airportlat").val(item.lat); $("#airportlong").val(item.lng); $("#statusbox").html(""); $("#lookupicao").show(); }); }); return false; } It is called by the look up button in the ops_airportform.tpl file on line 6 <button id="lookupicao" onclick="lookupICAO(); return false;">Look Up</button> The script will look in one of two places for the information; if (airport_lookup == "geonames") { url = geourl + "/searchJSON?style=medium&maxRows=10&featureCode=AIRP&type=json&q=" + icao + "&callback=?"; } else { url = phpvms_api_server + "/airport/get/" + icao + "&callback=?"; } You set the resource in the app.config file and if you are changing it from the default you should move the code to your local.config file so it does not get over written. /* Can be 'geonames' or 'phpvms'. Geonames will use the geonames.org server to look up the airport info phpvms will use the phpVMS API server */ Config::Set('AIRPORT_LOOKUP_SERVER', 'phpvms'); Config::Set('PHPVMS_API_SERVER', 'http://api.phpvms.net'); Config::Set('PHPVMS_NEWS_FEED', 'http://feeds.feedburner.com/phpvms'); Config::Set('VACENTRAL_NEWS_FEED', 'http://feeds.feedburner.com/vacentral'); Config::Set('GEONAME_API_SERVER', 'http://ws.geonames.org'); There are a few oddities on the geonames and phpvms airport database's, namely KORD - Chicago O'Hare comes up as being in Iran. I am sure there are a few more as well. Quote Link to comment Share on other sites More sharing options...
onelifexv Posted July 29, 2012 Author Report Share Posted July 29, 2012 Thanks. Appreciate it. It looks like the reason that it wasn't recognizing KATL as an airport on Geonames is that KATL is reported as an 'airfield' instead of 'airport. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.