* Pablo J. -- Wednesday 12 January 2005 01:23:
> Regarding real weather processing from live METAR reports, please
> consider providing the capability to load the weather conditions from
> a file, not only from live stations.
> It may be possible for someone to wish to fly FGFS right now but using
> the "actual" weather from some day in the past, and those particular
> conditions are available through the respective METAR file. That
> capability will allow for example, that someone take-off from his
> local airport with the stormy and rainy nigth conditions from four
> days ago, just right now that the sun is shinning!!

This is now implemented. You just start a METAR proxy server and direct
fgfs to it. A sample implementation for such a server is in utils/metarproxy/.
See the README file in this dir for details. The protocol for the
fgfs<-->proxy interaction is simple. It's pure HTTP with two special

fgfs sends such a request (no matter if noaa.gov or the proxy is on the other 

  GET http://weather.noaa.gov/pub/data/observations/metar/stations/EGLL.TXT 
  X-Time: 1105534805

and noaa, which doesn't know what to do with an X-Time header and, thus, ignores
it, sends the very last METAR string. The proxy knows that X-Time is the POSIX
epoch time (seconds since 1970/1/1 00:00) for when the METAR string should be 
The proxy returns an answer like this:

   Content-Type: text/plain
   X-MetarProxy: whatever

   2005/01/12 12:50
   EGLL 121250Z 25019G30KT 9999 SCT032 09/02 Q1020 NOSIG

Which is what noaa.gov would send, too, *plus* an X-MetarProxy header, whose
contents are currently ignored -- only its existence counts. This header is
used in fgfs to determine the reference time for the age calculation: If the
info came from such a caching proxy, then the age is (simulated GMT)-(report 
If there's no such header and the information is (likely) from noaa.gov, then
the age is (real GMT)-(report time). METAR strings older than 4 hours are
currently dismissed. (The proxy server, however, will never really send old
METAR strings, but will re-send the last useful METAR information. This is
to avoid that fgfs turns off METAR fetching after a series of failures.)

Quick instructions to download the world weather for the last 3 hours
and run proxy and fgfs with it (2-3 MB download; for less bandwidth
consumption see the --record mode):

  $ metarproxy --download 3h
  $ metarproxy -v -c &
  $ fgfs --enable-real-weather-fetch --proxy=localhost:5509 --time-offset=-2


Flightgear-devel mailing list

Reply via email to