What they are and where to get them
METAR is a common weather report format used by airports around the world.
Each station has a unique four letter location code assigned by the International Civil Aviation Organization (ICAO). The first letter identifies which part of the world the station is in. For instance, all codes beginning with K are within the continental United States.
Hytar CC-BY-SA 3.0, via Wikimedia Commons
Now you might ask: given an ICAO location code, how do I find the station it corresponds to? ICAO provides a list of all the assigned codes in Doc 7910: a $257 PDF. Programmatic access to the API for Doc 7910 costs at least $400 🤑
Fortunately, there is a much more cost effective (read: free) alternative. Greg Thompson at the National Center for Atmospheric Research (NCAR) maintains a comprehensive list of stations: stations.txt. The format is pretty straightforward:
... WASHINGTON 21-OCT-20 CD STATION ICAO IATA SYNOP LAT LONG ELEV M N V U A C WA SEATTLE/METRO KSEA SEA 72793 47 27N 122 19W 115 X U A 0 US ...
The file is split into sections by US state, Canadian province, and other countries. Each 83-character entry contains a station’s:
I’ve mapped the stations with OpenLayers below:
Click on a station for its name, location, and ICAO + IATA codes.