Hermosillo timezone

Eric Muller emuller at adobe.com
Sun Sep 28 04:37:32 UTC 2008


Jesper Norgaard Welen wrote:
> Of course you would need the Latitude and Longitude of the airport codes
> to do what *you* mentioned, but I assume that would be trivial?
>   

The UN/LOCODE (CODE FOR TRADE AND TRANSPORT LOCATIONS) database has 
coordinates for many locations, and airport codes for airports. 
http://www.unece.org/cefact/locode

Generating the list for all the airports should be relatively trivial if 
you put the map in spatially-enabled database such as PostGIS. Something 
like

SELECT unlocode.code, tz.tzid
FROM unlocode, tz
WHERE ST_within (tz.geom, unlocode.location)
AND unlocode.class = airport;

assuming that unlocode is a table  for the UN/LOCODE database and the 
coordinates have been turned into point geometries (of course, the SQL 
above is just the idea)

The main difficulty would be to have a good enough map, so that the 
UN/LOCODE coordinates do not fall in water. May be a bit of buffering 
around the point and an intersection with tz polygons would do the trick.

Eric.




More information about the tz mailing list