Gocek weather data
gocek.org ... Webcam ... Leave a comment ... Contact

Please avoid repeated downloads.

Scroll down for XML details ... icao-usgs-full-20101018.zip ZIP (12.6MB)
icao-usgs-runtime-20101018.zip ZIP  (5.9MB)
icao-usgs-resx-20101018.zip ZIP  (5.6MB)
The United State Geological Survey (USGS) provides a list of each "feature" in the USA with its latitude and longitude. The International Civil Aviation Organization (ICAO) provides a list of each registered aviation station (airport) around the world with its latitude and longitude. Many American stations feed weather observations to the National Oceanic and Atmospheric Administration (NOAA), which makes the observations available in the form of XML feeds and RSS feeds.

The United States Postal Service (USPS) provides zip code data for a fee, and I do not subscribe to those products. The United States Census Bureau provides a zip code listing created in 1999 with latitudes and longitudes, but no longer issues updates. I have found no other source and I do not include zip code data in my download files.

I am not aware of another free source for place names cross-referenced against weather sites. The weather reports on this page use the runtime file availble via the link above. My webcam page uses similar XML files to present conditions and forecasts for upstate NY.

Enter a town, select a state and click 'Go'.
My ZIP files each contain an XML file that cross-references USGS locations with the closest NOAA-feeding ICAO stations. In other words, I wrote software (not available for download) to calculate the distance from selected USGS features to every US ICAO station that feeds weather data to NOAA. From the USGS National file, the software selects every feature with a class of "Populated Place" or "Civil". Certain feature name phrases are trimmed, such as "City of" and "(historical)". The ZIP files, together with NOAA's free services, effectively allow a web page developer to provide weather services for any place in the United States. The ZIP files contain essentially the same data, but in different formats. You may need software to extract the XML files from the ZIP files.

The XML files contained in the ZIP files begin with the EF BB BF byte order mark for UTF-8. I believe that UTF-8 is required and ASCII is insufficient, since Hawaiian names often contain characters outside of ASCII.

Statistics: Out of 3,348 ICAO stations in the USA (50 states plus DC and PR), 2,033 feed weather data to NOAA. There are about 9,000 stations around the world. 254,328 USGS features out of 2,152,972 in the National file refer to towns and other named regions. The other features are mountains, schools and other features for which few end users would search for weather data or are potentially far from a weather station. My software first collects the list of weather feeds. Many ICAO stations do not feed weather data, but there is no way to tell without actually trying, and I retry failed hits a few times to weed out momentary network glitches. Second, the software calculates the distance and direction from each of the 254,328 features to each of the 2,033 ICAO stations, using the available latitudes and longitudes. The formula to calulate the distance between two lat/lon poiunts can be found on the web. My software's web hits, distance calculations and file I/O run for a couple hours.

XML file details:

- icao-usgs-full-20101018.zip contains icao-usgs-full.xml
 <State name="AK">
  <Usgs name="Ester" latitude="64.8472222" longitude="-148.0144444">
   <Icao code="PAFA" name="FAIRBANKS" state="AK" latitude="64.8166667" longitude="-147.8666667"
          direction="E" distance="4.8250160" />
   <Icao code="PAFB" name="FORT WAINWRIGHT" state="AK" latitude="64.8333333" longitude="-147.6166667"
          direction="E" distance="11.7159581" />
   <Icao code="PAEI" name="EIELSON AFB" state="AK" latitude="64.6666667" longitude="-147.1000000"
          direction="E" distance="29.6720195" />
The "full" file provides friendly attribute names and 7 digits to the right of the decimal point. The USGS features are grouped by state (incouding DC and PR). The three closest ICAO sites to the USGS feature are included. At the time the file was generated, NOAA returned weather data for the ICAO sites. The direction and distance (miles) for each ICAO station are from the USGS feature to the ICAO station. In the example above, the FAIRBANKS ICAO station is 4.8 miles east of Ester.

- icao-usgs-runtime-20101018.zip contains icao-usgs-runtime.xml
 <State name="AK">
  <U f="Ester" a="64.85" o="-148.01">
   <I i="PAFA" c="E" d="4.8" />
   <I i="PAFB" c="E" d="11.7" />
   <I i="PAEI" c="E" d="29.7" />
In the "runtime" file, I trimmed out excess text and provide less numeric precision. The USGS elements are grouped by state. A "U" element is a USGS element, with attributes "f" for feature, "a" for latitude and "o" for longitude. Three ICAO sites are grouped within a U element. The ICAO elements are named "I", i.e., capital letter "eye". The attributes are "i" for ICAO code, "c" for (compass) direction and "d" for distance (miles). The latitude and the longitude are provided for the USGS features, but not for the ICAO stations.

- icao-usgs-resx-20101018.zip contains icao-usgs.resx
<data name="Ester, AK">
The "resx" file is a standard resource file suitable for inclusion in a Microsoft Visual Studio project. The name of the resource is the USGS feature name followed by a comma and a space and the state abbreviation. The value of the resource is a delimited string. When software retrieves the value via a resource manager, the value must be split into its parts.

Split the value first on "@". This results in four parts. The first part contains the latitude and longitude of the USGS feature separated by "|" (or-bar).
The other three parts are the three closest ICAO stations. Each of these parts contains the ICOA code, direction from the USGS feature and distance to the USGS feature in miles, separated by "|" (or-bar). The latitude and the longitude are provided for the USGS features, but not for the ICAO stations.