Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Ruby library for METAR weather reports
Ruby
tree: 3142c96009

Fetching latest commit…

Cannot retrieve the latest commit at this time

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.

Something went wrong with that request. Please try again.