OpenWeather 2.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OpenWeather --version 2.2.0                
NuGet\Install-Package OpenWeather -Version 2.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenWeather" Version="2.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OpenWeather --version 2.2.0                
#r "nuget: OpenWeather, 2.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OpenWeather as a Cake Addin
#addin nuget:?package=OpenWeather&version=2.2.0

// Install OpenWeather as a Cake Tool
#tool nuget:?package=OpenWeather&version=2.2.0                

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.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.