metaf2xml can download, parse and decode aviation routine weather reports
(METAR, SPECI, SAO), aerodrome forecasts (TAF), synoptic observations
(SYNOP), observations from buoys (BUOY) and meteorological reports from
aircrafts (AMDAR). Data can also be taken from decoded BUFR messages.
The extracted data can be written as XML or passed to a user-defined
function (all done in Perl).
It also provides XSLT style sheets to convert the XML to plain language
(text, HTML), or XML with different schemas. A web-based (CGI) user
interface can be used to download and display up-to-date weather data from
NOAA, Ogimet, and other sources.
The documentation for all Perl scripts and modules (as manual and in other
formats) can be generated from the POD inside them.
metaf2xml consists of the following files:
metaf2xml/parser.pm (manual: metaf2xml::parser(3pm))
Perl module to parse messages and write the data as XML or pass
it to a user-defined function
requires the Perl module metaf2xml::bufr
The XML output is intended to:
- contain all data from the message, but no additional data,
- allow validation to be as strict as possible,
- not require further parsing or decoding,
- be concise, and human-legible.
DTD is used for validation, as XSD seemed more effort.
DTD cannot restrict the string-value of a node, but only its
attributes. Therefore values are assigned to an otherwise empty node
with the attribute 'v' (for "value") and, if applicable, 'u' (for
"unit"), 'q' (for "qualifier"), and 'rp'/'rpi' and/or 'rn'/'rne'
(possible positive and/or negative deviation from the displayed value
due to rounding of the observed value):
Each entry also contains the original string from the message as an
attribute named 's' (for "string"):
There are 2 exceptions to the "no additional data" goal:
- if a cloud layer is the ceiling, it will have the "isCeiling" tag
- if temperature and dew point are given it will have 4 tags for the
humidity (from 4 different formulas)
Both items are considered "hard to compute" in XSL though it certainly
is possible.
Versioning of the contents of the XML is implemented using the
namespace attribute for the "" node with the version as the
last part of its value.
metaf2xml/bufr.pm
supplementary Perl module for metaf2xml::parser to process a decoded
BUFR message
metaf2xml.pl (manual: metaf2xml(1))
example Perl script for metaf2xml::parser
metaf2xml/src2raw.pm (manual: metaf2xml::src2raw(3pm))
Perl module to convert data from different sources of weather
information to the format expected by metaf2xml::parser
requires the Perl module Geo::BUFR 1.37+ and ECC BUFR table files from
ECWMF to decode binary BUFR messages
metafsrc2raw.pl (manual: metafsrc2raw(1))
example Perl script for metaf2xml::src2raw
metaf.pl (manual: metaf(1))
(CGI) script to download and display METAR/TAF/SYNOP/BUOY/AMDAR messages
requires the Perl modules CGI, metaf2xml::parser, metaf2xml::src2raw
may require curl, xsltproc, and/or a web server (depending on use)
metaf.xsl
XML style sheet to transform the contents of the generated XML file
for detailed output
All groups/items are converted to plain language (language support
from metaf-lang*.xml), one line (or more) per group/item.
The output format can be text or HTML. For the text format, the
columns are separated by tabulators.
metaf-sum.xsl
XML style sheet to transform the contents of the generated XML file
for summary output
The output is in the form of a summary, one line per message
(plus one line per METAR/TAF trend).
The output format can be text or HTML. For the text format, the
columns are separated by tabulators.
metaf-html.xsl, metaf-text.xsl
XML style sheets for detailed output
They define the output method (HTML or text) and then include
metaf.xsl.
metaf-sum-html.xsl, metaf-sum-text.xsl
XML style sheets for summary output
They define the output method (HTML or text) and then include
metaf-sum.xsl.
metaf-ui.xsl
XML style sheet to generate the header, footer and input form for the
user interface
metaf-fullhtml.xsl, metaf-sum-ui.xsl
XML style sheets for the user interface
They define the output method HTML and then include metaf.xsl or
metaf-sum.xsl, respectively, and metaf-ui.xsl.
metaf-lang.xml, metaf-lang-*.xml
XML files with translated plain language text in various languages
stations.xml
example data file with additional station information, read by
metaf.xsl and metaf-sum.xsl
This is, and will remain, a stub, and will not be extended or updated.
metaf.dtd
the Document Type Definition for the XML data