A Ruby library for METAR weather reports
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits ahead, 274 commits behind joeyates:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
data
lib
locales
test
.gitignore
COPYING
Gemfile
README.rdoc
Rakefile
metar-parser.gemspec

README.rdoc

metar - Downloads and parses weather status

The information comes from the National Oceanic and Atmospheric Association's raw data source.

Implementation

  • Parses METAR strings using a state machine.

Example

This prints the latest weather report for Portland International Airport:

require 'rubygems' require 'metar'

raw = Metar::Raw.new( 'KPDX' ) parser = Metar::Parser.new( raw ) report = Metar::Report.new( parser )

puts report.to_s

Data format descrition

Other software

Other Ruby libraries offering METAR parsing:

There are many reports (WMO) that these libraries do not parse.

There are two gems which read the National Oceanic and Atmospheric Association's XML weather data feeds:

Interactive map:

Testing

The tests use a local copy of the weather stations list: data/nsd_cccc.txt

If missing, the file gets downloaded before running tests.