Aeronautical Server API and reference

Table of contents


Introduction

MVCS contains an interface that allows the following aeronautical server-based functions:

Currently, the aeronautical server-based functions fetch data from aviationweather.gov.


getMetar()

Syntax

aeroServer.getMetar(station)
aeroServer.getMetar(station, distance)
aeroServer.getMetar(station, distance, latitude, longitude)

Retrieve METAR data for a METAR station. Only the METARS issued within the last hour are fetched. If the station has issued more than one METAR in the last hour, they will all be returned. If provided, distance specifies a statute-mile radius from the station to retrieve all METARs. This allows for finding the nearest published conditions if a station does not issue METARs, or for determining better conditions with a reasonable distance from the station. If omitted, only METARs from the station are returned. If provided, latitude and longitude, specify the center of the search radius. If latitude and longitude are provided, the station may be ''.

Returns a Promise that resolves with a Response whose text contains a list of retrieved METARs separated by newlines. The Promise rejects if something goes wrong.

aeroServer.getMetar() calls server.stdOp() to pass the standard headers and arguments in addition to the supplied arguments.

Parameters

Return value

A Promise that resolves with text containing a list of retrieved METARs separated by newlines, if the status is OK. Otherwise, the Promise is rejected with the returned or timeout Response. The Response can contain the following status codes:


windsAloft()

Syntax

aeroServer.windsAloft()
aeroServer.windsAloft(region)
aeroServer.windsAloft(region, level)

Retrieve winds aloft data for region and level. The region and level values are as specified by the aviationweather.gov data API for "windtemp". If omitted, level defaults to 'low' and region defaults to 'all'.

Returns a Promise that resolves with a Response whose text contains the text retrieved from the aviationweather.gov data API for "windtemp". The Promise rejects if something goes wrong.

Note: the current server-side implementation ignores both region and level and assumes the default values.

aeroServer.getMetar() calls server.stdOp() to pass the standard headers and arguments in addition to the supplied arguments.

Parameters

Return value

A Promise that resolves with text containing the text retrieved from the aviationweather.gov data API for "windtemp", if the status is OK. Otherwise, the Promise is rejected with the returned or timeout Response. The Response can contain the following status codes: