GeoJSON Service Help


Location: /gis/scripts/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",
       "properties": {
	   "id": "KIAD",
	   "site": "Washington/Dulles In",
	   "obsTime": "2013-04-09T17:52:00Z",
	   "temp": 27.8,
	   "dewp": 10.0,
	   "wspd": 6,
	   "wdir": 220,
	   "cover": "SCT",
	   "visib": 10.00,
	   "fltcat": "VFR",
	   "altim": 1017.4,
	   "slp": 1016.8,
	   "rawOb": "KIAD 091752Z 22006KT 10SM FEW045 SCT250 28/10 A3004 
	       RMK AO2 SLP168 T02780100 10278 20167 58017"
       "geometry": {
	   "type": "Point",
	   "coordinates": [-77.45,38.95]
  { "type": "Feature",
      "properties": {
	  "id": "KSEA",
	  "site": "Seattle-Tacoma 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.
  • 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.

Page loaded:  00:22 UTC  |   05:22 PM Pacific  |   06:22 PM Mountain  |   07:22 PM Central  |   08:22 PM Eastern