-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weather alert feature #3125
Comments
After working on the prototype to pull NWS alerts into the system, I propose a table structure something like the following: CREATE TABLE safety_alerts (
id uuid PRIMARY KEY,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
expires_at timestamp with time zone,
title text NOT NULL,
summary text NOT NULL,
geometry geometry NOT NULL,
data jsonb NOT NULL DEFAULT '{}'::jsonb
); The top-level table design has enough common information to display the alert, with all of the details from the upstream service stored in the In terms of data ingestion, I think we should create a Ruby base class that sets up the database connection and defines helpers for inserting the records into the database. We could define a callback that would return a list of objects that contain the right data, and the base class would then insert that data into the database. We could wrap all of that in a base image that would make it easy to spin up new Lambda jobs with different import services. @bernardd Thoughts? |
Sounds like a good starting point to me. |
Just looking at that schema, I think we should add two more fields: |
Also probably worth having a |
Also also, on reflection I'm not sure the |
Sure, the NWS uses CAP in XML. I was thinking that we would store the parsed alert in the |
What do you think about establishing a convention for the source names? Maybe a two-letter country code, followed by a state code (if applicable), and then the service acronym. For example:
I'm thinking this might help disambiguate the myriad of TLAs that we are likely to encounter. |
In general, I think Wocky should own its database. I've created a migration in a branch to create the safety alerts table: https://github.com/hippware/wocky/blob/safety_alerts/apps/wocky/priv/repo/migrations/20200224225018_safety_alerts.exs |
We want to alert users to significant adverse weather events (and other natural disasters) near them. We should pull data from national and state sources like the US National Weather Service and alert users when we become aware of an adverse event near them, or they move into an area where an adverse event is expected.
The text was updated successfully, but these errors were encountered: