Geolocation Information Gaps

I’ve been seeking out interesting data sources to plot in Google Earth after learning the basics of KML. I’ve been wanting to do something cool with NOAA’s XML weather feeds since I heard about them, so I thought I would download the 700kb list of stations serving up XML and spit out some KML from that data as a “neat” first step.

I’ll probably still do that, but after parsing the data, I’m a bit dissapointed. As always there are huge gaps in geolocation information. In order to get my hands on the data I turned to xmltramp which is an awesome library for accessing simple XML documents in a pythonic way. I then whipped up a few lines of Python to walk through the data:

import xmltramp # http://www.aaronsw.com/2002/xmltramp/

f=open('stations.xml', 'r')
doc=xmltramp.parse(f.read())
count = 0
total = 0
for station in doc['station':]:
  total = total + 1
  sid = str(station['station_id'])
  lat = str(station['latitude'])
  lon = str(station['longitude'])
  if (lat != 'NA') and (lon != 'NA'):
    print "Station ID: " + sid + 
    " (" + lat + "," + lon + ")"
    count = count + 1
print str(count) + " out of " + str(total) + 
" stations are geolocated."

Here’s the output of the above code:

mcroydon@mobilematt:~/py/kmlist$ python kmlist.py
Station ID: PAGM (63.46N,171.44W)
[... snip ...]
Station ID: KSHR (44.46.10N,106.58.08W)
422 out of 1775 stations are geolocated.

Well that’s a bummer. 422 out of 1775, or less than 25% of all stations are geolocated. While that’s still 422 more stations than I knew about previously, it’s a far cry from a majority of weather stations across the United States.

Another thing you will notice is that some stations appear to be expressed in degrees in decimal form (63.46N) while others appear to use Degrees/Minutes/Seconds (44.46.10N).

It’s gaps like these that can make working with “found” geolocation data frustrating.

10 Responses to “Geolocation Information Gaps”


  1. 1 Sean Gillies Aug 5th, 2005 at 9:20 am

    Matt,

    Try http://weather.noaa.gov/tg/site.shtml. I’m not sure it has everything you need, but has a couple big text files of site locations.

  2. 2 Matt Croydon Aug 5th, 2005 at 9:41 am

    Thanks Sean. I think something like this http://www.rap.ucar.edu/weather/surface/stations.txt should allow me to fill in the gaps. wc -l counts 8509 anyway, so here’s hoping.

  3. 3 Sean Gillies Aug 5th, 2005 at 10:51 am

    Daryl Herzmann, a WX/GIS/MapServer guy at Iowa State, has a bunch of weather-related OGC web services: http://mesonet.agron.iastate.edu/ogc/. The CONUS NEXRAD WMS you should be able to hack directly into your Google maps.

  4. 4 Simon Chan Aug 10th, 2005 at 10:52 am

    The value 63.46N is not in decimal form; it is Degrees/Minutes and without Seconds reading.

  5. 5 Matt Croydon Aug 10th, 2005 at 11:22 am

    Thanks for the heads up Simon.

  6. 6 Yoppi Do Jan 28th, 2010 at 11:48 am

    It’s gaps like these that can make working with
    http://westblog.ru/?p=140
    “found” geolocation data frustrating.

  1. 1 Term Insurance Trackback on Jan 21st, 2007 at 6:39 pm
  2. 2 Black Jack Trackback on Jan 22nd, 2007 at 5:30 pm
  3. 3 Home Insurance Trackback on Jan 28th, 2007 at 11:30 am
  4. 4 91d75aead549 Trackback on May 15th, 2008 at 6:19 am

Leave a Reply