GeoJSON Service Help


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

This script will create GeoJSON output using data from the ADDS database. This will extract a list of METAR reporting sites from the database. Here is sample output:

{ "type": "FeatureCollection",
    "features": [
    { "type": "Feature",
	"properties": {
	    "id": "CYZF",
	    "name": "Yellowknife_Arpt",
	    "state": "NT",
	    "region": "CN",
	    "prior": "2",
	    "elev": "206",
	    "wmo": "71936"
	"geometry": {
	    "type": "Point",
	    "coordinates": [-114.44,62.47]
    { "type": "Feature",
	"properties": {
	    "id": "RKNY",
	    "name": "Yangyang_Intl",
	    "state": "--",
	    "region": "KO",
	    "prior": "3",
	    "elev": "74",
	    "wmo": "99999"
	"geometry": {
	    "type": "Point",
	    "coordinates": [128.67,38.06]

The properties output from the script are:

  • id - ICAO station identifier
  • name - The long name for the site
  • state - State within country/region
  • region - Country or region (as in Pacific)
  • prior - Plotting priority level (0 to 7)
  • elev - Elevation of site in meters
  • wmo - WMO station identifier

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 3.
  • 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.
  • 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.