This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Brave New World^WWeather Applet

This is loosely related to AppletsRevisited

The goal, implement a server, weather.gnome.org, that hands out statically generated weather XML formed weather reports. Have a locations file available in multiple translations, similar to the existing Locations.xml.in that simply gives codes to retrieve XML data from the server.

Benefits

Disadvantages

Design

Ok, so what are the features of the current applet?

Things we want to add:

Format

XML, obviously. However, I think there are benefits to delivering it over Atom, using a custom namespace. Specifically, clients other than the weather applet can read it, the content model is easily extendable, it's designed for clients to check regularly, and we're already going to be using XML anyway. The only drawback I can think of is it will increase file size, and it people might demand an OPML (horrible, horrible format) file, but we can just have an xhtml page with atom autodiscovery links to every feed instead.

DavydMadeley: if anything I release uses OPML, several people have indicated an intention to fly to Australia and cause me pain ;-)

Details here and here. Basically we just include extra tags in our namespace in the atom:entry elements, with the current conditions and forecast in atom:content for normal feed readers.

So what is going to be in this XML namespace? Well, NOAA has XML with various attributes at http://www.nws.noaa.gov/data/current_obs/, example data file.

LuisVilla4: see also http://www.nws.noaa.gov/forecasts/xml/ which appears to be the new canonical way of getting US weather data, according to Wired: http://www.wired.com/news/technology/0,1282,65919,00.html?tw=wn_tophead_1

JamesHenstridge: In a previous development cycle, the weather applet was set up to download weather information in XML format from a site called weather.interceptvector.com. This code was backed out when the site disappeared. The schema for their format is available through the wayback machine though.

If using an XML format, it is probably worth trying to keep the data as small as possible, and as cache-friendly as possible. This might include using a gzip transfer encoding, and setting appropriate expiry times on the files served (eg. if the weather data for a particular city only updates once every hour, then tell the client so it doesn't try to reload the data every 15 minutes). If forecast data is issued once or twice a day, but the current observation is updated every 15 minutes, then it might make sense to serve them as separate resources.

Similarly, the weather applet should remember the etag/mtime of its previous request so that it can revalidate it's current data rather than redownload the same data. This would probably involve not using gnome-vfs as an HTTP client ...

JamesAndrewartha: Looking at the weather.xsd schema, the things it's missing compared to the NOAA data are lat/long/elevation (although we'd serve sunset/sunrise calculated from these on the server anyway), windchill, heatindex and dewpoint. Separating out the forecast is also a good idea, for your reason but also because observations and forecasts can have different coverage areas (eg I can get Swanbourne observations, but the forecast is for the Perth region). So for each atom entry we'd have a <atom:link rel="observation" href="whatever"> and a <atom:link rel="forecast" href="whereever">.

Locations

This leads into the format for the locations database. Basically I think if you have a tree of atom files, with region's file being a bunch of atom:entry elements for each subregion having an atom:link to that subregion's atom file everything is fairly sane. The leaves on the tree are atom:entry elements with atom:link elements as above. Also have an attached xsl transform so that people can easily browse using a web browser, and courtesy elements like <atom:content><a href="whereever">Weather data for whatever region</a></atom:content>.

Radar images - just a link to the hosted site as is currently done?

Ok, I have basic working code to generate a tree of atom files from Locations.xml.in. Localisation can be handled later, as can the question of where alphabetisation should be done. I still need to inherit zone and radar attributes.

This leads into the question of how the parsers get the location information - currently I'm thinking some sort of pickled text dict for each data source.

Data Sources

We have several sources to gather data:


2024-10-23 11:54