Giter Club home page Giter Club logo

rooper149 / openweather Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 1.18 MB

Open Weather is a simple library designed to take a coordinate (latitude and longitude) and find the closest weather station to that coordinate while also getting the current METAR and TAF weather data and parsing it.

Home Page: https://rooper149.github.io/OpenWeather/

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%
weather icao noaa faa iata geolocation hydrology geography weather-station weather-data

openweather's Introduction

This project has been quiet for a while, but I am working on udpates now.

Welcome to OpenWeather.

Open Weather is a simple library designed to take a coordinate (latitude and longitude) and find the closest weather station to that coordinate while also getting the current METAR or TAF weather data and parsing it. It has other features like being cross-platform (Windows/Linux/Android), searching by ICAO codes, automatic update intervals, and unit conversions. We hope to be adding more and more features as development continues!

Pre-Compiled Packages

You can get a pre-compiled nuget package by searching OpenWeather in NuGet or going directly to our NuGet page: https://www.nuget.org/packages/OpenWeather/

The Data

All the METAR data is obtained through NOAA and the Aviation Weather Center. Our weather station lookup list is adapted from Greg Thompson's station list which can be found here.

Getting Started

It's easy to search for a station and start getting weather data!

    static void Main(string[] args)
    {
        // get the closest station to 29.3389, -98.4717 lat/lon
        if(!OpenWeather.StationDictionary.TryGetClosestStation(29.3389, -98.4717, out var stationInfo))
        {
            Console.WriteLine($@"Could not find a station.");
            return;
        }

        Console.WriteLine($@"Name: {stationInfo.Name}");
        Console.WriteLine($@"ICAO: {stationInfo.ICAO}");
        Console.WriteLine($@"Lat/Lon: {stationInfo.Latitude}, {stationInfo.Longitude}");
        Console.WriteLine($@"Elevation: {stationInfo.Elevation}m");
        Console.WriteLine($@"Country: {stationInfo.Country}");
        Console.WriteLine($@"Region: {stationInfo.Region}");

        // get a MetarStation and autoupdate every 30 minutes
        // you can change this via Settings._UpdateIntervalSeconds = yourValue
        var metarStation = stationInfo.AsMetarStation(true, true);

        // subscribe to updates on the station
        _ = metarStation.Subscribe(x =>
        {
            Console.WriteLine("\n\nCurrent METAR Report:");
            Console.WriteLine($@"Temperature: {x.Temperature}C");
            Console.WriteLine($@"Wind Heading: {x.WindHeading}");
            Console.WriteLine($@"Wind Speed: {x.WindSpeed}Kts");
            Console.WriteLine($@"Dewpoint: {x.Dewpoint}");
            Console.WriteLine($@"Visibility: {x.Visibility}Km");
            Console.WriteLine($@"Presure: {x.Pressure}Pa");
        });

        Console.ReadLine();
    }

image

License

OpenWeather is under the BSD 3-Clause License.

openweather's People

Contributors

rooper149 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openweather's Issues

aviationweather.gov API updates

aviationweather.gov has improved their API quite a bit. There seems to be many more features and datasets we can pull from compared to the previous, rather basic API. We should explore migrating to the new API and adding more features.

Is This Project Still in Development?

Hi,

I was wondering if anyone knew if this project was still in development. I tried the example in the readme and it doesn't match what is in the code.... So I am figuring the project has been 100% abandoned.

Edit: Also the project website is non-working...

Any news would be helpful. I am looking to use this package for a project of mine.

Thanks!

Error with getting sky conditions.

Sky conditions are not always present in METAR data, and it is throwing an error since it is expected to be there. Probably will be fixed as I redesign to support TAF data.

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.