GeoJSON Service Help


Location: /cgi-bin/json/MetarJSON.php

This script will create GeoJSON output using data from the ADDS database. The latest METAR is returned if site has reported within the last two hours. Here is sample output:

{ "type": "FeatureCollection",
  "features": [
  { "type": "Feature",
    "id": "140345056",
    "properties": {
        "data": "METAR",
        "id": "KATL",
        "site": "Atlanta/Hartsfield I",
        "prior": 0,
        "obsTime": "2019-12-30T18:52:00Z",
        "temp": 16.1,
        "dewp": 3.3,
        "wspd": 9,
        "wgst": 18,
        "wdir": 270,
        "cover": "FEW",
        "visib": 10.00,
        "fltcat": "VFR",
        "altim": 1011.9,
        "slp": 1011.1,
        "rawOb": "KATL 301852Z 27009G18KT 10SM FEW040 FEW200 FEW250 16/03 A2988 RMK AO2 SLP111 T01610033"
    "geometry": {
        "type": "Point",
        "coordinates": [-84.442,33.630]
  { "type": "Feature",
    "id": "140348068",
    "properties": {
        "data": "METAR",
        "id": "KDEN",
        "site": "Denver Intl",

The properties output from the script are:

  • id - Station identifier
  • site - The long name for the site
  • obsTime - ISO 8601 formatted date and time
  • temp - Temperature in Celsius
  • dewp - Dewpoint temperature in Celsius
  • wspd - Wind speed in knots
  • wdir - Wind direction in degrees
  • wgst - Wind gusts in knots
  • ceil - Cloud ceiling in 100s feet for broken or overcast skies (missing otherwise)
  • cover - Maximum cloud cover
  • visib - Visibility in miles
  • fltcat - Flight category, either VFR, MVFR, IFR, LIFR
  • altim - Altimeter setting in hPa
  • slp - Sea level pressure in hPa
  • rawOb - Raw METAR text
  • rawTaf - Raw TAF text

The script can be passed parameters via command line or through CGI REQUEST. The parameters to the script include:

  • bbox=minlon,minlat,maxlon,maxlat - This is the bounding box for area of interest. This limits the stations output in GeoJSON to those within that lat/lon range. The default is -130,20,-60,60.
  • zoom=level - This is the zoom level for the display. If this is available it will be used for progressive display of observations. The default is none.
  • filter=prior - This tells the script to use a priority scheme to filter stations on a priority scheme. It will base what priority to use on the size of the bounding box. The priority is set in the MetarSites table. The default is to only return stations with a priority of 2 or lower.
  • priority=# - This sets the default priority. The default is 2.
  • density=# - This augments the priority setting. This is used with the filter=prior setting to add more or less stations to the output relative to the default priority setting based on the bounding box. A setting of all will bypass the priority and display all stations.
  • taf=xxxx - If set to true or on or 1, this will include the latest TAF in the JSON output.
  • vfr=no - If set, this will only output sites that aren’t VFR.
  • date=yyyymmddhhnn - This sets the valid date for the data. The output will be the latest METAR data from the site relative to this date. The default is current time.
  • jsonp=callback - This sets the callback function to be used in a JSONP call. This is just when the script is called on another server. The default is null which outputs straight JSON.