Giter Club home page Giter Club logo

aviation-weather's Introduction

Aviation Weather

A simple (Laravel compatible) library for fetching and decoding METARs. (Soon to be more than this, however)

Prerequisites

  • Laravel is now required for this library to work properly (due to use of Laravel's Cache and Log system)

Installation

Using Composer:

$ composer require cobaltgrid/aviation-weather

This will ensure that all required dependencies will be installed automatically.

Usage

At the moment, Aviation Weather only support ICAO codes. You can load a METAR by passing the ICAO code when you construct the class.

use Cobaltgrid\Aviation\Weather;
...
$weather = new Weather("EGKK");
$metar = $weather->latest_metar(); // Returns a Cobaltgrid\Aviation\Weather\Metar object

Metar Object Methods

Method Description
raw_response() This gets you the raw JSON from the data source (SimpleXMLElement)
raw() This gets you the raw JSON METAR data from the data source (SimpleXMLElement)
raw_string() The raw METAR string (String)
icao() The ICAO code of the station (String)
time() A carbon object for the METAR's observation time (Carbon)
latitude() A float of the latitude of the observation (Float)
longitude() A float of the longitude of the observation (Float)
temperature() The temperature, in degrees celsius (Float)
dewpoint() The dew point, in degrees celsius (Float)
wind_direction() The wind direction, in whole degrees. If 0, this indicates a variable wind. (Int)
wind_speed() The wind speed, in knots. If both speed and direction are 0, wind is 'calm' (Int)
wind_gust() The wind gust, in knots (Int)
visibility($unit="m") Options: "km", "m", "nm", "mi". Gives the visibility in the chosen units. (Float/Int)
qnh($unit="hpa") Options: "hpa", "hg". Gives the QNH pressure setting in the chosen units. (Float/Int)
weather_array() An array of raw weather codes (i.e "-HZ +SH" etc) (Array)
weather() An array of decoded weather codes of the format: ['code' => '-RA', 'human' => 'Light Rain'] (Array)
sky_cover() An array of decoded cloud cover. Each array item is an array with the following format: ['type' => 'SCT', 'type_human' => 'Scattered', 'height' => 2000] . Height is in feet.
flight_cat() An indication of the type of flying permitted by the weather. Example values: MVFR, IFR, LVFR, etc.
toArray() Converts the above into an array format

aviation-weather's People

Contributors

atoff avatar f2m2rd avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

f2m2rd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.