metar-post-featured

The METAR and TAF WordPress Plugin

We’ve looked at various means in which to display aviation METAR or TAF (Terminal Area Forecast) data on your WordPress website in the past. However, the hurdles required to overcome the mild complexity involved with editing various files and messing with code often prohibits a lot of people from using the functionality we describe – or so we’re told. The solution: Another WordPress plugin.

METAR does what the functions we’ve formerly provided will do — display raw aviation data. The difference is that we now provide the options of including specific elements of a report rather than the whole thing. While we’ve launched it with just temperature and QNH (altimeter), we’ll be deploying additional versions in the near future that’ll make all sorts of interesting weather related data available, including all the other elements of a METAR or TAF report.

Note that we’re caching the examples on this page for up to a few hours to avoid making unnecessary requests to NOAA’s source website. The reports are not accurate.

The Metar and TAF

As we’ve seen before, once installed, the following line of code will render a current Sydney METAR report into your WordPress website.

[metar loc="yssy"]

The result:

TTF METAR YSSY 271130Z 02009KT CAVOK 25/21 Q1010 RMK RF00.0/000.0 NOSIG

To show a TAF report for JFK (New York), we’ll use [taf loc="kjfk"]. The result:

TAF COR KJFK 270848Z 2708/2812 07007KT 2SM -DZ BR OVC005 FM271000 08006KT 1SM -RADZ BR OVC004 FM271400 14008KT 2SM -RA BR OVC006 WS020/22035KT FM271600 17008KT 4SM -RA BR OVC015 FM271800 20009KT P6SM BKN030 FM272100 20008KT P6SM BKN040 FM280300 19003KT 5SM BR OVC025 FM280600 17003KT 1/2SM FG OVC004

The only two available shortcode attributes for a Metar report are loc and cache. The cache is set to keep METAR results for an hour by default (cache="3600"). To increase this to two hours (7200 seconds), for example, use [taf loc="kjfk" cache="7200"] or to retrieve a new result every 15 minutes, use [taf loc="kjfk" cache="900"].

The location must be a valid 4-digit ICAO code (not the IATA code). For example, Sydney is YSSY, not SYD. You can find a list of all available Metar stations here.

Pressure – QNH or Inches of Mercury

To extract the aerodrome pressure from the report, the shortcode of [qnh loc="yssy"] should be used (where yssy is your location of choice). By default, we’ll always return the QNH – not inches of mercury.

The shortcode of [qnh loc="yssy"] will output a QNH of 1010.

A USA METAR report will normally prefix their pressure with an A, for altimeter, while it’s Q in most other parts of the world. Since QNH is the ICAO standard, it defaults to true, regardless of what pressure the report provides.

  • QNH JFK is 1021 [qnh loc="kjfk"]
  • Altimeter JFK is 30.16 [qnh loc="kjfk" unit="0"]

The shortcode provides the value only. Bolding is mine to highlight the result.

Airport Termperature

The temperature (and dew point temperature) on a Metar report is almost always reported in Celsius. The following temperature results are based on data from KJFK. Again, the option to cache your report for longer or shorter than the default hour applies. To cache your report for two hours, use [temperature loc="kjfk" temp="1" cache="7200"], or to cache it for just 30 minutes, use [temperature loc="kjfk" temp="1" cache="1800"].

The bold text in the below results is my own to illustrate the differences between the returned temperatures.

  • Temperature (normalised integer °C) is 6 [temperature loc="kjfk" temp="1"]
  • Dew Point Temp (normalised integer °C) is 6 [temperature loc="kjfk" temp="2"]
  • Raw Temp (from Metar °C) is 06 [temperature loc="kjfk" temp="3"]
  • Raw Dew Point Temp (from Metar °C) is 06 [temperature loc="kjfk" temp="4"]
  • Temperature (°F) (normalised integer) is 43 [temperature loc="kjfk" temp="5"]
  • Dew Point Temp (°F) (normalised integer) is 43 [temperature loc="kjfk" temp="6"]
  • Raw report data is 06/06 [temperature loc="kjfk" temp="7"]

In the examples above, the ‘raw’ temperature will return whatever is provided in the report. Negative temperatures will be prefixed with an ‘M’ and single digit temperatures will include a leading ‘0’.

Installing Metar

To install Metar, you have a few options.

  • Download from the WordPress repository and FTP into your plugin directory, then activate via your control panel.
  • Download from the WordPress repository and upload the zip file into WordPress via the administration panel.
  • Easiest and fastest: Search for “Metar” from within your WordPress plugin dashboard. “Install” then “Activate”. Make sure you download our version, by BeliefMedia .
Plugin Title: Metar
Description: Include global Metar and TAF reports (and individual data) on your website.
Download (downloaded 1684 times) | Plugin Page

If you have problems, leave a comment below.

Showing Metar Reports in Widgets

There’s are a couple of plugins that don’t do anything other than provide a widget for various reports. We’ve avoided this in the first instance because shortcodes give you more freedom in how you format data and seriously flexibility in where you place it.

Since WordPress doesn’t enable shortcodes in Widget areas by default, we’ve provided an option to enable the functionality. Navigate your way to  Settings  Metar Shortcode  (once the plugin is activated) and you’ll see the following option.

If your shortcodes are showing up in Widgets as plain text, and only if they’re showing as text (and not rendering a result), select the option to ‘Yes’ and click  Update » .

You then only have to drag a normal text widget into a sidebar, or another location that supports them, and include your shortcode.

How do I Add the °C or °F part?

We didn’t want to provide °C or °F extension because it limits the way in which you can present data. For example, the temperature in Sydney is currently 25°C (77°F) … but I could also just write that it’s currently 25 degrees.

SYD 25°C

I created the degrees symbol with the string of °.

Features Coming Soon

As with a lot of the plugins we’ll be adding over the next few months, most of them are just to establish a means of eliciting feedback from the people that are most likely to use them. That said, the following features will likely be added in the next release.

  • While widgets are limiting, we’ll likely add them for those few that’ll use them.
  • Add other elements of both METAR and TAF reports: wind, weather, cloud etc.
  • Add (US) PIREPs as reported by AviationWeather.gov .
  • Add reports not provided by NOAA. Bankstown (YSBK), in Australia, for example.
  • Include traditional weather forecasts.

Download, Support & Suggestions

Download the plugin below or, as suggested, install it directly from within WordPress.

Plugin Title: Metar
Description: Include global Metar and TAF reports (and individual data) on your website.
Download (downloaded 1684 times) | Plugin Page

If you have any specific feature requests or suggestions, please let us know.

Version 0.2 – 18th December, 2015

Changes and considerations in Version 0.2 are as follows:

  • We’ve rewritten chunks of code to prepare for widgets, and to make obtaining reports more efficient.
  • Any Australian report is now obtained from the Bureau of Meteorology website. This means you can obtain a report for any Australian METAR/TAF, or ARFOR.
  • ARFORs should be obtained with the shortcode of [sc]arfor loc=”21″[/sc] where 21 is the area you wish to query.
  • For Australian reports only, you can render a TAF or METAR with the line breaks included (as intended) by using tidy="0". We wrap everything into one string by default.
  • We’ve added the option to remove paragraph tags (as is the case with the naked shortcode function). To render reports inline use p="0".
  • All existing reports in your website will be unchanged.
  • To include a degrees symbol (°) alongside temperatures, use degrees="1" in your temperature shortcode.
  • Consideration needs to be made to any copyright that the BOM might apply. Any Australian report needs to be accompanied with a operational disclaimer citing the source.

The next release should be far more comprehensive.

Shortt URL for this post:

Leave a Reply

Your email address will not be published. Required fields are marked *