Create a PHP page that receives $_Get parameters for lat and lon of the user's location.? Use the GeoIP function? ? to calculate the distance between two GPS points, and loop through all the airport codes in the file list (below), calculating the distance, and return the airport code to the closest airport.
[login to view URL]
has a directory listing hundreds of airport codes. These 4-letter codes are those airports that have hourly weather reports.
Save that displayed list of stations with view Source. Write a script to strip out everything except the list of 4-letter codes, and save.? Its about 7280 codes.
http:/ /[login to view URL] ? ? ?
is an? online services that, given an airport code, will return the Latitude and Longitude of that airport.? ? ? ( and I want the timezone too.)
Eg.? CYEG is Edmonton International, and its location is at longitude is 113° 34’ 47?? W,? latitude 53° 18’ 35?? N
Automate the extraction of lat,long locations for each airport code in the 7280 list.
The method I suggest is: ? parse a code like CYEG, to find letter "Y"? and go to the page
http:/ /[login to view URL]
then RegEx search to match YEG, then follow the nearby link to
http:/ /[login to view URL]
And that page contains the info I need.? ? Build a file containing 4 columns, 7280ish rows.? ?
airport-code, latitude, longitude,? timezone
Please convert latitude and longitude from format
53° 18’ 35?? N? 113° 34’ 47?? W? ?
into this format:
-113.5797,? ? 53.3097
Here's how 113° 34’ 47?? W becomes -113.5797:
? 47 / 60 ? is .7833? Then? put the .7833 after 34, and? divide by 60 again,? ? 34.7833 / 60 = 0.5797
Longitudes that are "West" are given negative numbers.
Latitudes that are "South" are given negative numbers.
Timezone is to be an integer number like -7
Chances are, while building your code to work through the list of airport codes, some of the codes won't be findable, or the lat,long or timezone data won't exist, so build your code to be robust enough to ignore those for now.? Lines with missing data can be found by-hand later.
## Deliverables
Delivered should be a PHP file, and a data file of airport data.