Coder Social home page Coder Social logo

wunderground_test's Introduction

#Weather Radar TEST Radar Base Image This is the base image of the current area Weather Radar watches

##A backend server for retrieving weather information and determining whether weather is incoming

The weather radar started as a simple idea of being able to have a preemptive warning system for incoming rain when I was outside for the afternoon, either working in my yard, at a nearby park or on any outdoor event.

The larger idea is to have a system that retrieves the weather information and distributes out to all registered users, and their device can determine where the weather is relative to their set boundary marker.

This eliminates the need for a backend server to calculate the likelihood of inclement weather for each user. Also reducing the number of calls to the WunderGround API, but transferring the load to the Radar server to distribute the weather information to all users.

##Functionality

###Weather Array The server creates a 2D array of pixel values taken from a PNG image file of current weather given set bounds and resolution. The image file is converted into a 2D array for reference against a Boundary as set by a user.

#CURRENTLY ONLY PNW

###Boundary System The main function of the Boundary system is based on the MidPoint Circle algorithm

public static void DrawCircle(int x0, int y0, int radius)
{
  int x = radius;
  int y = 0;
  int radiusError = 1-x;
 
  while(x >= y)
  {
    DrawPixel(x + x0, y + y0);
    DrawPixel(y + x0, x + y0);
    DrawPixel(-x + x0, y + y0);
    DrawPixel(-y + x0, x + y0);
    DrawPixel(-x + x0, -y + y0);
    DrawPixel(-y + x0, -x + y0);
    DrawPixel(x + x0, -y + y0);
    DrawPixel(y + x0, -x + y0);
    y++;
    if (radiusError<0)
    {
      radiusError += 2 * y + 1;
    }
    else
    {
      x--;
      radiusError += 2 * (y - x) + 1;
    }
  }
}

This calculates a boundary circle that can be referenced against a 2D array of the current weather conditions. This allows for checking each point on a Boundary against the matching point on the weather array, instead of checking every point on the array.

##Quadrants

Each Boundary is composed of quadrants which correspond to the 8 cardinal directions, this gives a better granularity for smarter checking. In theory a user could set the direction to start checking on each update, or for the current wind direction to dictate where the check starts.

Each Boundary currently only supports a single level of checking at the outermost Boundary. Future implementations will have multiple levels for checking in order to gauge a time frame for when weather is expected to arrive at the center of the designated Boundary.

#TODO

  • Make weatherMap more modular for server/client
  • Implement basic bounds checking
  • [] Implement server iteration (RESTful?)
  • [] Fork for client
    • [] Web client
    • [] Android client
    • []

wunderground_test's People

Contributors

bingram avatar

Watchers

 avatar James Cloos avatar

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.