Add to Technorati Favorites .................................. - Mountain Biking
..................................
the blog@spencerwilliams.net

What I really want in a MTB Trail site for Austin

January 19, 2008 15:20 by Spencer

So the NOAA web service is great.  It is a nice easy way to give forecasts based on LatLong, etc.  The problem that it doesn't conquer is the question that my wife and I (and all Austin mountain bikers) ask before we choose which wonderful Austin trail to ride - when was the last time it rained at the trail?  Once you have the answer to that - you can whittle down your trail choice - or if it's been dry for weeks, have them all to choose from.  Let's take two trails as examples.

If I know that it has rained more than 1.5" at the Barton Creek Greenbelt, then I probably won't want to ride it (or at least the part North of 360) until at least 2 to 3 dry days (depending on sunlight and humidity...it's really wooded) after that rainfall.  On the other hand, the same rainfall amount (or even a little more) could fall at Emma Long Park yesterday and be ok to ride today (Emma Long is more rock/caliche than dirt).  I need a service that will not just give you the forecast for the future, but give you the history of rainfall/sunlight/etc so you can make your decision.  I want to be able to go to a website, look at this data for all of the trails on one page, make the decision as to which one I want to ride that I also CAN ride, then click on the map for a refresher on the route in Virtual Earth.  Today I started looking for a service that would provide historical weather data.  There aren't very many "almanac" data sites that keep this data and provide it in a easily available format (XML).  Also, the data is usually from the airport, a military base, or a weather station not near any of the trails...and I wanted this to be specific.

Enter the PWS or personal weather station.  I never really realized that there is this whole world of personal weather stations.  The place that I found the 2 components I was looking for - detailed historical weather data recorded at a specific LatLong PLUS the XML format was at Weather Underground.  Type in a zip code to get started, then down near the middle of the page you can see a map of all the PWS in the area using Google Maps.  Pretty cool!  Of course there aren't any right smack in the middle of the Greenbelt, but it's better than the airport data, right?  You can even view the current conditions AND the daily observations in XML!  Not all of the PWS have daily observations that go back very far, probably a limitation of the weather station itself or the service that they use to send the data.  So now all I have to do is find the page that shows the WSDL to get me all of this great data.

No dice.  As far as I can tell I don't see that WUnderground has a web services setup.  I wrote them an email to inquire about becoming a member if this were the case.  I looked into it a little further, and what I want IS possible, it just requires too much care and feeding for a site that would be a hobby.  The URL of the daily observations for a weather station don't change.  Every station in Austin has a name that begins with KTXAUSTI followed by a number .  The LatLong is in the data that is returned via XML, so I could map the stations myself.  I would just have to build the list of stations, query the data a few times a day and put that in SQL, add the station location to the maps of the trails using the LatLong returned by the XML query (which is really just a GET on the HTML of the page linked above), summarize the data that I want - precipitation, sunlight, humidity, etc, and add that to a SQL view or table that keeps data for a specified amount of time (probably one week or so) and only return weather data for a set of trails based on the proximity of the weather station location in the database to the trails location in the KML overlay and I suppose that if there were multiple weather stations that contained data that was relevant to the same trail, I would have to aggregate and average the data to give an accurate report.  Not too much work (ha!) and it could all break if WUnderground changes their URL style or subdomains...or they could ban my IP.  They should just offer this as a web service though, I think it would be a great pay web service (not for hobbyists like me of course, but for people who use it commercially) for places like ski areas...many times during the year, the weather at the base is not available because there's ONE weather station - run by a resort - that's broken or needs to be reset, or isn't linking to their website.  You would still be able to get that data (or at least nearby data) from other sources on a ski conditions site.  Just a thought. 

Also, I looked into it a little further and if you take apart the code on the WUnderground site, there is a web service of sorts (not WSDL) already.  There is a cgi-bin call back to the server that uses the corners of the GMap control to return a list of weather stations in the map's visible area.  Pretty sure using that would get you into some sort of trouble though.  For now, I'll wait for a response back instead of going down the aforementioned path, but if I get really bored over a weekend, it could happen.


 
Blog Information Profile for williasp