Santa Rosa: Overcast
 59.0°
San Francisco: A Few Clouds and Breezy
 64.0°
Oakland: Partly Cloudy
 63.0°
San Jose: Clear
 66.0°
South Tahoe: Fair
 62.0°
North Tahoe: Clear
 64.0°

The Bay Area to Tahoe

I have wanted to do some kind of weather-influenced website for a while now. While surfing around recently I came across NOAA's web site. I've been there before, but this was the first time I noticed their XML and RSS feeds. The feeds are updated every hour (at about 5 before the hour).

I had a quick look around and found an XML transform that is built into PHP. After sorting through a few complications, my PHP goes out and gets the XML file for the four different locations on the left (San Francisco, San Jose, Oakland, and Santa Rosa) and the two locations on the right(Truckee and South Lake Tahoe). I then use the XML transform (and some XSL files I wrote) to store the temperature and a descriptive string of the current weather, for each city.

Next, I cycle through the descriptive strings, and based on what they say, I pick out an image I created.
               sunny fog partly cloudy cloudy rain thunderstorm hail snow
Finally, I display the image and the temperature on top of the bay area map using a little CSS positioning. (I created the bay area map by tracing a nice map I found on SFGate.com. Frankly, creating the map and the weather icons in photoshop was by far the most time consuming part.) The bay area map is set as a background to an underlying DIV tag.

If an image or two is missing over there it's because I haven't built an icon yet. For example, NOAA passes "A Few Clouds" and I display "partlyCloudy.gif". I have half a dozen icons, but I don't yet know all the descriptions that NOAA may pass. For example, they may send "Windy" later, but since I don't know about it, I won't have an image. As time goes by I'll keep an eye on this page and make images as necessary. (Though it would be nice if NOAA would document their XML...)

The page is a little slow to load, but this is only my own demo work so I haven't tried to speed it up (yet). Maybe in the future.